/* ==========================================================================
   QuickQuote — 초경량 견적서 PWA
   ========================================================================== */

:root{
  --brand:#2456ff;
  --brand-strong:#1a42d6;
  --brand-soft:#eaf0ff;
  --accent:#ff7a18;
  --ink:#0c1420;
  --ink-2:#344054;
  --muted:#667589;
  --line:#e3e8f0;
  --line-2:#eef2f8;
  --bg:#f4f6fa;
  --card:#ffffff;
  --ok:#0f9d6b;
  --danger:#d92d20;
  --radius:16px;
  --radius-sm:11px;
  --shadow-sm:0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.04);
  --shadow-md:0 10px 28px -12px rgba(16,24,40,.22), 0 2px 6px rgba(16,24,40,.05);
  --shadow-lg:0 24px 60px -24px rgba(16,24,40,.35), 0 8px 20px -12px rgba(16,24,40,.16);
  --font:"Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo",
         "Malgun Gothic", "Noto Sans KR", Roboto, "Helvetica Neue", Arial,
         "Liberation Sans", "DejaVu Sans", sans-serif;
  --header-h:60px;
}

*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none!important}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;
  font-family:var(--font);
  color:var(--ink);
  background:var(--bg);
  font-size:15px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
h1,h2,h3,p,ul{margin:0}
button{font-family:inherit;font-size:inherit;color:inherit}
input,select,textarea{font-family:inherit}
:focus-visible{outline:2.5px solid var(--brand);outline-offset:2px;border-radius:6px}

.sr-only{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
  clip:rect(0,0,0,0);white-space:nowrap;border:0;
}
.skip-link{
  position:absolute;left:-9999px;top:0;z-index:100;background:#fff;padding:10px 16px;border-radius:0 0 10px 0;
}
.skip-link:focus{left:0}

/* ------------------------------- header ---------------------------------- */
.app-header{
  position:sticky;top:0;z-index:40;
  height:var(--header-h);
  display:flex;align-items:center;justify-content:space-between;
  gap:12px;
  padding:0 16px;
  padding-top:env(safe-area-inset-top);
  background:rgba(255,255,255,.86);
  backdrop-filter:saturate(180%) blur(14px);
  -webkit-backdrop-filter:saturate(180%) blur(14px);
  border-bottom:1px solid var(--line);
}
.brand{display:flex;align-items:center;gap:10px;min-width:0}
.brand-mark{display:flex;filter:drop-shadow(0 3px 6px rgba(36,86,255,.28))}
.brand-text{display:flex;flex-direction:column;line-height:1.15;min-width:0}
.brand-text strong{font-size:16px;letter-spacing:-.02em}
.brand-text small{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.header-actions{display:flex;align-items:center;gap:6px}

.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  border:1px solid transparent;border-radius:11px;background:#fff;
  padding:9px 14px;font-weight:600;font-size:14px;letter-spacing:-.01em;
  cursor:pointer;white-space:nowrap;
  transition:background .16s ease, border-color .16s ease, transform .1s ease, box-shadow .16s ease;
  min-height:40px;
}
.btn:active{transform:translateY(1px)}
.btn-primary{background:var(--brand);color:#fff;box-shadow:0 6px 16px -8px rgba(36,86,255,.7)}
.btn-primary:hover{background:var(--brand-strong)}
.btn-ghost{background:#fff;border-color:var(--line);color:var(--ink-2)}
.btn-ghost:hover{background:#f7f9fc;border-color:#d3dbe8}
.btn-soft{background:var(--brand-soft);color:var(--brand-strong);border-color:#d9e3ff}
.btn-soft:hover{background:#dfe8ff}
.btn-outline{background:#fff;border-color:#cbd6ff;color:var(--brand-strong)}
.btn-outline:hover{background:var(--brand-soft)}
.btn-block{width:100%}
.btn-icon{padding:0 12px;gap:6px}
.btn-lang{font-weight:700;letter-spacing:.02em;min-width:46px;padding:9px 10px;border:1px solid var(--line);background:#fff}
.btn-label{white-space:nowrap}

.pill{font-size:11px;font-weight:700;padding:4px 9px;border-radius:999px;letter-spacing:.02em}
.pill-offline{background:#fff4e5;color:#a25200;border:1px solid #ffd9a8}

.link-btn{
  background:none;border:0;padding:2px 0;color:var(--brand-strong);
  font-size:13px;font-weight:600;cursor:pointer;border-radius:6px;
}
.link-btn:hover{text-decoration:underline}

/* ------------------------------- layout ---------------------------------- */
.app-body{display:block}
.panel{
  padding:14px 14px 14px;
}
.panel-inner{display:flex;flex-direction:column;gap:12px;max-width:560px;margin:0 auto}

.card{
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius);
  padding:14px;box-shadow:var(--shadow-sm);
}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.card-head h2{font-size:13px;font-weight:700;letter-spacing:.02em;color:var(--ink-2);text-transform:none}
.card-head .count{
  display:inline-block;min-width:20px;padding:1px 6px;border-radius:999px;background:var(--brand-soft);
  color:var(--brand-strong);font-size:11px;font-weight:700;text-align:center;
}

/* segmented control */
.segmented{
  display:grid;grid-template-columns:repeat(3,1fr);gap:4px;
  background:#f1f4f9;border-radius:12px;padding:4px;
}
.seg{
  border:0;background:transparent;border-radius:9px;padding:9px 6px;
  font-size:13.5px;font-weight:600;color:var(--muted);cursor:pointer;
  transition:background .15s ease,color .15s ease,box-shadow .15s ease;
}
.seg:hover{color:var(--ink-2)}
.seg.is-active{background:#fff;color:var(--brand-strong);box-shadow:var(--shadow-sm)}

/* fields */
.field{display:flex;flex-direction:column;gap:5px;min-width:0}
.field-label{font-size:11.5px;font-weight:600;color:var(--muted);letter-spacing:.01em}
.field-label em{color:var(--brand);font-style:normal}
.field input,.field select,.field textarea,.ir-cell input,.ir-desc input{
  width:100%;border:1px solid var(--line);border-radius:var(--radius-sm);
  padding:10px 11px;font-size:14.5px;color:var(--ink);background:#fff;
  transition:border-color .15s ease, box-shadow .15s ease;
  min-height:42px;
}
textarea{resize:vertical;line-height:1.45}
.field input::placeholder,.field textarea::placeholder{color:#a6b1c2}
.field input:hover,.field select:hover,.field textarea:hover{border-color:#cfd8e6}
.field input:focus,.field select:focus,.field textarea:focus{
  border-color:var(--brand);box-shadow:0 0 0 3.5px rgba(36,86,255,.13);outline:none;
}
.field select{appearance:none;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667589' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 10px center;padding-right:32px}

.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.mt-10{margin-top:10px}
.mt-14{margin-top:14px}

/* items */
.items{display:flex;flex-direction:column;gap:8px}
.item-row{
  display:grid;
  grid-template-columns:1fr 1fr 1fr 34px;
  grid-template-areas:
    "desc desc desc del"
    "qty  price amt amt";
  gap:7px 8px;
  padding:10px;border:1px solid var(--line-2);border-radius:13px;background:#fbfcfe;
}
.item-row:focus-within{border-color:#cfd9fb;background:#fff}
.ir-desc{grid-area:desc}
.ir-desc input{font-weight:600;background:#fff}
.ir-del{
  grid-area:del;align-self:start;width:34px;height:34px;border-radius:9px;
  border:1px solid transparent;background:transparent;color:#98a2b3;cursor:pointer;
  display:flex;align-items:center;justify-content:center;font-size:15px;line-height:1;
}
.ir-del:hover{background:#fee4e2;color:var(--danger);border-color:#fecdca}
.ir-cell{display:flex;flex-direction:column;gap:3px;min-width:0}
.ir-cell span,.ir-amt span{font-size:10.5px;font-weight:600;color:var(--muted)}
.ir-cell input{background:#fff;padding:8px 9px;min-height:38px;font-size:14px}
.ir-amt{grid-area:amt;display:flex;flex-direction:column;gap:3px;align-items:flex-end;justify-content:flex-end}
.ir-amt strong{font-size:14px;font-variant-numeric:tabular-nums;letter-spacing:-.01em;padding-bottom:9px}
.ir-cell.qty{grid-area:qty}
.ir-cell.price{grid-area:price}

/* stamp */
.stamp-field{display:flex;flex-direction:column;gap:6px}
.stamp-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.stamp-preview{
  width:64px;height:64px;flex:0 0 auto;border:1px dashed #cfd8e6;border-radius:10px;
  background:#fff;display:flex;align-items:center;justify-content:center;padding:5px;
}
.stamp-preview img{max-width:100%;max-height:100%;object-fit:contain;display:block}
.stamp-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.btn-sm{padding:7px 12px;font-size:13px;min-height:36px;border-radius:9px}
.stamp-input{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
label.btn{cursor:pointer}
.stamp-hint{margin-top:2px}

/* archive + pro */
.row-btns{display:flex;gap:8px;flex-wrap:wrap}
.row-btns .btn{flex:1 1 auto}
.hint{font-size:11.5px;color:var(--muted);line-height:1.45;margin-top:9px}

.card-pro{
  background:linear-gradient(160deg,#0d1b3f 0%,#132a63 55%,#1b3fa3 100%);
  border-color:transparent;color:#eaf0ff;
  position:relative;overflow:hidden;
}
.card-pro::after{
  content:"";position:absolute;right:-60px;top:-70px;width:200px;height:200px;border-radius:50%;
  background:radial-gradient(circle,rgba(93,137,255,.45),transparent 70%);
}
.pro-head{display:flex;align-items:center;gap:8px;margin-bottom:8px}
.pro-badge{
  font-size:10px;font-weight:800;letter-spacing:.09em;background:#fff;color:#12275c;
  padding:3px 7px;border-radius:6px;
}
.pro-soon{font-size:11px;font-weight:600;color:#a9bdf0}
.pro-title{font-size:15px;font-weight:700;letter-spacing:-.01em;margin-bottom:8px}
.pro-list{list-style:none;padding:0;display:flex;flex-direction:column;gap:5px;margin-bottom:12px}
.pro-list li{font-size:12.5px;color:#c6d4f7;padding-left:16px;position:relative}
.pro-list li::before{
  content:"";position:absolute;left:2px;top:7px;width:5px;height:5px;border-radius:50%;background:#7ea1ff;
}
.card-pro .btn-outline{background:rgba(255,255,255,.1);border-color:rgba(255,255,255,.28);color:#fff}
.card-pro .btn-outline:hover{background:rgba(255,255,255,.18)}
.card-pro .hint{color:#9fb2df}

/* ------------------------------- stage ----------------------------------- */
.stage{
  padding:0 14px calc(96px + env(safe-area-inset-bottom));
}
.stage-toolbar{
  display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;
  padding:10px 0 12px;
}
.stage-info{display:flex;align-items:center;gap:7px;font-size:12.5px;color:var(--muted);min-width:0}
.stage-info strong{color:var(--ink-2);font-size:12.5px;letter-spacing:.02em}
.stage-info .dot{color:#c3ccda}
#totalChip{font-weight:700;color:var(--brand-strong);font-variant-numeric:tabular-nums;font-size:13px}
.toolbar-actions{display:flex;gap:8px;margin-left:auto}

.preview-stage{
  background:
    radial-gradient(circle at 1px 1px, rgba(12,20,32,.055) 1px, transparent 0) 0 0/16px 16px,
    #e9edf5;
  border-radius:18px;border:1px solid #dfe5ee;
  padding:18px;
  overflow:hidden;
  display:flex;justify-content:center;
}
.doc-scaler{transform-origin:top center;will-change:transform}

.print-hint{font-size:11.5px;color:var(--muted);text-align:center;margin-top:10px}

.stage-foot{
  display:flex;flex-wrap:wrap;align-items:baseline;justify-content:center;gap:4px 8px;
  margin:16px auto 0;padding-top:12px;max-width:520px;
  border-top:1px solid var(--line);
  font-size:11.5px;color:var(--muted);text-align:center;
}
.stage-foot a{color:var(--brand-strong);font-weight:600;text-decoration:none;border-radius:6px}
.stage-foot a:hover{text-decoration:underline}
.stage-foot a:focus-visible{outline:2px solid var(--brand);outline-offset:2px}

/* ------------------------------- bottom bar ------------------------------ */
.bottom-bar{
  position:fixed;left:0;right:0;bottom:0;z-index:45;
  display:flex;align-items:center;gap:12px;min-height:72px;overflow:visible;
  padding:12px 14px calc(20px + env(safe-area-inset-bottom));
  background:rgba(255,255,255,.94);
  backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
  border-top:1px solid var(--line);
  box-shadow:0 -6px 20px -14px rgba(16,24,40,.4);
}
.bb-total{display:flex;flex-direction:column;line-height:1.15;min-width:0;flex:0 1 auto;padding-block:2px}
.bb-total small{font-size:10.5px;line-height:1.25;color:var(--muted);font-weight:600}
.bb-total strong{font-size:16px;line-height:1.45;letter-spacing:-.02em;white-space:nowrap;font-variant-numeric:tabular-nums}
.bottom-bar .btn{flex:1;justify-content:center}

/* ------------------------------- modal ----------------------------------- */
.modal{position:fixed;inset:0;z-index:60;display:flex;align-items:flex-end;justify-content:center}
.modal[hidden]{display:none}
.modal-backdrop{position:absolute;inset:0;background:rgba(12,20,32,.42);backdrop-filter:blur(2px)}
.modal-panel{
  position:relative;background:#fff;width:100%;max-width:520px;max-height:80vh;
  border-radius:18px 18px 0 0;padding:16px;display:flex;flex-direction:column;
  box-shadow:var(--shadow-lg);animation:sheetUp .22s cubic-bezier(.22,1,.36,1);
}
@keyframes sheetUp{from{transform:translateY(24px);opacity:.6}to{transform:none;opacity:1}}
.modal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.modal-head h2{font-size:16px;letter-spacing:-.01em}
.icon-btn{
  width:34px;height:34px;border-radius:9px;border:1px solid var(--line);background:#fff;
  cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--muted);
}
.icon-btn:hover{background:#f5f7fb;color:var(--ink)}
.lib-list{list-style:none;padding:0;margin:0;overflow-y:auto;display:flex;flex-direction:column;gap:8px}
.lib-item{
  display:flex;align-items:center;gap:10px;padding:11px 12px;border:1px solid var(--line);
  border-radius:12px;background:#fcfdff;
}
.lib-item .li-main{flex:1;min-width:0;cursor:pointer;text-align:left;background:none;border:0;padding:0}
.lib-item .li-title{font-weight:700;font-size:14px;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lib-item .li-sub{font-size:11.5px;color:var(--muted);display:block;margin-top:2px}
.lib-item .li-del{
  border:1px solid var(--line);background:#fff;border-radius:8px;width:30px;height:30px;
  cursor:pointer;color:var(--muted);flex:0 0 auto;
}
.lib-item .li-del:hover{border-color:#fecdca;color:var(--danger);background:#fff5f4}

/* ------------------------------- toast ----------------------------------- */
.toast{
  position:fixed;left:50%;bottom:calc(102px + env(safe-area-inset-bottom));transform:translate(-50%,12px);
  background:#0c1420;color:#fff;padding:11px 18px;border-radius:999px;font-size:13.5px;font-weight:600;
  box-shadow:var(--shadow-lg);opacity:0;pointer-events:none;transition:opacity .2s ease,transform .2s ease;
  z-index:70;max-width:88vw;text-align:center;
}
.toast.show{opacity:1;transform:translate(-50%,0)}

/* ==========================================================================
   DOCUMENT (A4)
   ========================================================================== */
.doc{
  font-family:var(--font);
  width:210mm;min-height:297mm;background:#fff;color:#0b1220;
  padding:14mm 15mm 12mm;
  font-size:10pt;line-height:1.5;
  display:flex;flex-direction:column;
  box-shadow:0 18px 40px -22px rgba(12,20,32,.45), 0 2px 8px rgba(12,20,32,.06);
  border-radius:2px;
  font-variant-numeric:tabular-nums;
}

/* head */
.doc-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10mm;padding-bottom:5mm}
.doc-brand{display:flex;gap:3.5mm;align-items:flex-start;min-width:0}
.doc-logo{
  width:12mm;height:12mm;border-radius:2.6mm;flex:0 0 auto;
  display:flex;align-items:center;justify-content:center;overflow:hidden;
  background:linear-gradient(140deg,#2456ff,#5b86ff);color:#fff;font-weight:800;font-size:11pt;letter-spacing:-.02em;
}
.doc-logo img{width:100%;height:100%;object-fit:contain;background:#fff}
.doc-seller-name{font-size:13pt;font-weight:700;letter-spacing:-.02em;line-height:1.25;margin-bottom:1.2mm}
.doc-seller-meta{font-size:8pt;color:#55637a;line-height:1.55;white-space:pre-line}
.doc-title-wrap{text-align:right;flex:0 0 auto}
.doc-title{
  font-size:24pt;font-weight:800;letter-spacing:.06em;line-height:1.05;margin:0 0 2mm;color:#0b1220;
}
.doc-no{font-size:8.5pt;color:#55637a;letter-spacing:.02em}

.doc-rule{height:1.1mm;background:linear-gradient(90deg,#2456ff 0%,#2456ff 26%,#e6ebf5 26%,#e6ebf5 100%);margin:0 0 6mm;border-radius:1mm}

/* meta */
.doc-meta{display:grid;grid-template-columns:1fr 66mm;gap:8mm;margin-bottom:6mm}
.doc-to-label{font-size:7.5pt;font-weight:700;letter-spacing:.14em;color:#8a96a8;text-transform:uppercase;margin-bottom:1.5mm}
.doc-to-name{font-size:12pt;font-weight:700;letter-spacing:-.01em;line-height:1.3}
.doc-to-meta{font-size:8.5pt;color:#55637a;margin-top:1mm;line-height:1.5}
.doc-dates{border:1px solid #e2e8f2;border-radius:2mm;overflow:hidden}
.doc-dates div{display:flex;justify-content:space-between;gap:4mm;padding:2mm 3mm;font-size:8.5pt}
.doc-dates div+div{border-top:1px solid #eef2f8}
.doc-dates dt{color:#7b8899}
.doc-dates dd{margin:0;font-weight:600}

/* intro */
.doc-intro{font-size:9pt;color:#3b4859;margin:0 0 3.5mm}

/* table */
.doc-table{width:100%;border-collapse:collapse;font-size:9pt;margin-bottom:5mm}
.doc-table th{
  background:#f2f5fa;border-top:1px solid #cfd9e8;border-bottom:1px solid #cfd9e8;
  padding:2.4mm 2mm;font-size:7.5pt;font-weight:700;letter-spacing:.08em;
  color:#4a5769;text-transform:uppercase;text-align:center;
}
.doc-table td{padding:2.6mm 2mm;border-bottom:1px solid #e8edf4;vertical-align:top;text-align:center}
.doc-table td.item-desc{text-align:left;font-weight:600;color:#16202e}
.doc-table td.item-desc small{display:block;font-weight:400;color:#7b8899;font-size:7.5pt;margin-top:.6mm}
.doc-table .col-no{width:9mm;color:#8a96a8}
.doc-table th.col-item{text-align:left}
.doc-table .col-qty{width:18mm}
.doc-table .col-price{width:30mm;text-align:right}
.doc-table .col-amt{width:32mm;text-align:right;font-weight:600}
.doc-table tr.is-empty td{color:#a9b3c2}
.doc-table .empty-row td{text-align:center;color:#a9b3c2;padding:8mm 2mm}
.doc-table tfoot td{border-bottom:none}

/* summary */
.doc-summary{display:grid;grid-template-columns:1fr 66mm;gap:8mm;align-items:start;margin-bottom:6mm}
.doc-memo{font-size:8.5pt;color:#55637a}
.doc-memo-label{font-size:7.5pt;font-weight:700;letter-spacing:.14em;color:#8a96a8;text-transform:uppercase;margin-bottom:1.5mm}
.doc-memo-body{white-space:pre-line;line-height:1.55;border-left:1.4px solid #e2e8f2;padding-left:3mm}
.doc-totals{width:100%;border-collapse:collapse;font-size:9pt}
.doc-totals td{padding:1.9mm 0}
.doc-totals td:last-child{text-align:right;font-weight:600;white-space:nowrap}
.doc-totals .lbl{color:#55637a}
.doc-totals tr.sum-row td{border-top:1.4px solid #16202e;padding-top:2.6mm;font-size:11pt;font-weight:800;color:#0b1220}
.doc-totals tr.sum-row td:last-child{font-size:12.5pt}
.doc-totals tr.wh-row td{color:#8a3c2a;padding-top:1.6mm}
.doc-totals tr.wh-row td:last-child{font-weight:600}
.doc-totals tr.net-row td{border-top:1px dashed #16202e;font-size:11pt;color:#0b1220}

/* footer */
.doc-foot{margin-top:auto;padding-top:6mm}
.doc-note{font-size:8pt;color:#7b8899;line-height:1.6;border-top:1px solid #eef2f8;padding-top:3mm}
.doc-sign{display:flex;justify-content:space-between;align-items:flex-end;gap:10mm;margin-top:5mm}
.doc-sign .s-company{font-size:9pt;font-weight:700;letter-spacing:-.01em}
.doc-sign .s-company span{display:block;font-size:7.5pt;font-weight:500;color:#7b8899;letter-spacing:.1em;margin-top:.8mm}
.doc-stamp{
  width:17mm;height:17mm;border:1.6px solid rgba(217,45,32,.55);border-radius:50%;
  display:flex;align-items:center;justify-content:center;color:rgba(217,45,32,.8);
  font-size:9pt;font-weight:800;letter-spacing:.08em;transform:rotate(-8deg);
}
/* 업로드한 직인 이미지는 테두리 없이 찍힌 모양 그대로 */
.doc-stamp-img{border:0;border-radius:0;width:26mm;height:26mm;transform:none}
.doc-stamp-img img{width:100%;height:100%;object-fit:contain;display:block}
.doc-brand-mark{font-size:7pt;color:#a9b3c2;text-align:right;margin-top:3mm}

/* print only helpers */
.only-print{display:none}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (min-width:900px){
  .panel{padding:20px 0 32px 20px}
  .panel-inner{max-width:none}
  .app-body{
    display:grid;grid-template-columns:400px minmax(0,1fr);
    align-items:start;gap:0;
    max-width:1600px;margin:0 auto;
  }
  .panel{
    position:sticky;top:var(--header-h);height:calc(100vh - var(--header-h));
    overflow-y:auto;overscroll-behavior:contain;
    scrollbar-width:thin;scrollbar-color:#cdd6e4 transparent;
  }
  .panel::-webkit-scrollbar{width:9px}
  .panel::-webkit-scrollbar-thumb{background:#d5dde9;border-radius:9px;border:3px solid var(--bg)}
  .stage{padding:0 20px 40px}
  .stage-toolbar{position:sticky;top:var(--header-h);z-index:20;background:var(--bg);padding:14px 0 12px}
  .bottom-bar{display:none}
  .panel{padding-bottom:40px}
  .modal{align-items:center}
  .modal-panel{border-radius:18px}
}
@media (max-width:899px){
  .stage{padding-bottom:calc(110px + env(safe-area-inset-bottom))}
  .stage-toolbar .toolbar-actions .btn-ghost{display:none}
}
@media (max-width:420px){
  .doc-title{font-size:20pt}
  .grid-2{gap:8px}
}

@media (prefers-reduced-motion:reduce){
  *{animation-duration:.001s!important;transition-duration:.001s!important}
}

/* ==========================================================================
   PRINT — only the document
   A4 한 장 규칙:
   · 여백은 @page 가 갖고 .doc 은 여백을 갖지 않는다 (2쪽으로 넘어갈 때 위쪽이 잘리지 않도록)
   · .doc 에 min-height/page-break-inside:avoid 를 두지 않는다 (빈 2페이지가 생기는 원인)
   · 표가 길어지면 행 단위로만 나뉘고 머리글이 되되도록
   ========================================================================== */
@media print{
  @page{size:A4;margin:14mm 15mm 12mm}
  html,body{background:#fff!important;margin:0!important;padding:0!important;height:auto!important;overflow:visible!important}
  body{font-size:10pt}
  .app-header,.panel,.stage-toolbar,.bottom-bar,.toast,.modal,.print-hint,.stage-foot,.sr-only,.skip-link{display:none!important}
  .app-body{display:block!important;max-width:none;margin:0}
  .stage{padding:0!important;margin:0!important}
  .preview-stage{
    padding:0!important;margin:0!important;border:0!important;border-radius:0!important;
    background:#fff!important;overflow:visible!important;height:auto!important;display:block!important;
  }
  .doc-scaler{transform:none!important;width:auto!important;height:auto!important;margin:0!important}
  #docMount{display:block!important}
  .doc{
    box-shadow:none!important;border-radius:0!important;margin:0!important;
    width:auto!important;min-width:0!important;max-width:none!important;
    min-height:0!important;height:auto!important;
    padding:0!important;
    page-break-inside:auto!important;break-inside:auto!important;
    display:block!important;
  }
  .doc-head,.doc-meta,.doc-intro,.doc-summary,.doc-foot,.doc-sign{
    page-break-inside:avoid;break-inside:avoid;
  }
  .doc-rule{page-break-after:avoid;break-after:avoid}
  .doc-table{page-break-inside:auto;break-inside:auto}
  .doc-table thead{display:table-header-group}
  .doc-table tr{page-break-inside:avoid;break-inside:avoid}
  .doc-table tr.empty-row td{padding:6mm 2mm}
  .doc-foot{margin-top:8mm}
  .only-print{display:block}
  a{color:inherit;text-decoration:none}
  *{-webkit-print-color-adjust:exact;print-color-adjust:exact}
}

/* Pro·맞춤 세팅 — 24시간 견적·론칭 특가 안내 */
.pro-offer{margin-top:6px;padding:8px 10px;border-radius:8px;background:rgba(43,108,255,.08);
  border:1px solid rgba(43,108,255,.22);color:var(--text,#111);font-weight:600}
