*{box-sizing:border-box}
:root{
  --bg:#f5f7fb;--card:#fff;--text:#14213d;--muted:#64748b;--border:#d9e2ef;--primary:#1e3a5f;--primary-2:#24466f;--accent:#fbc02d;--success:#16a34a;--danger:#dc2626;--shadow:0 20px 40px rgba(15,23,42,.08);--radius:18px;
}
html,body{margin:0;padding:0;background:var(--bg);color:var(--text);font-family:'Inter',sans-serif;max-width:100%;overflow-x:hidden}
a{text-decoration:none;color:inherit}
button,input,select,textarea{font:inherit}
.page-shell{max-width:1180px;margin:0 auto;padding:28px 20px 56px;width:100%;overflow-x:clip}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:22px}
.eyebrow{margin:0 0 6px;font-size:13px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--primary-2)}
.topbar h1{margin:0;font-size:32px;line-height:1.08}
.pill-badge,.tiny-pill{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;padding:7px 14px;background:#edf2f9;color:var(--muted);font-weight:600;font-size:13px}
.progress-card,.card,.control-panel,.preview-shell,.summary-box,.service-card,.wizard-card{background:var(--card);border:1px solid var(--border);border-radius:24px;box-shadow:var(--shadow)}
.service-card{padding:22px 24px;margin-bottom:18px;overflow:hidden}
.progress-card{padding:20px 28px;margin-bottom:24px}
.stepper{display:flex;align-items:flex-start;justify-content:center;gap:0;overflow:auto;padding-bottom:8px}
.step-item{display:flex;align-items:center;gap:12px;min-width:160px;flex:1}
.step-connector{height:2px;background:#c9d3e0;flex:1;margin:14px 8px 0}
.step-indicator{width:38px;height:38px;border-radius:999px;display:flex;align-items:center;justify-content:center;font-weight:800;background:#c9d3e0;color:#475569;flex:none}
.step-item.active .step-indicator{background:var(--primary);color:#fff;transform:scale(1.08);box-shadow:0 10px 20px rgba(30,58,95,.25)}
.step-item.completed .step-indicator{background:var(--success);color:#fff}
.step-item.completed .step-connector{background:var(--success)}
.step-text strong{display:block;font-size:15px}
.step-text span{display:block;font-size:13px;color:var(--muted);margin-top:2px}
.card{padding:28px 28px 32px}
.section-title{margin-bottom:26px}
.section-title h2{font-size:22px;margin:0 0 6px}
.section-title p{margin:0;color:var(--muted);font-size:16px}
.template-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px}
.template-card{position:relative;border:1.5px solid var(--border);border-radius:22px;padding:22px;background:#fff;cursor:pointer;transition:.25s;display:block}
.template-card:hover,.template-card.selected{transform:translateY(-2px);border-color:var(--primary);box-shadow:0 18px 32px rgba(30,58,95,.12)}
.template-card input{position:absolute;opacity:0;pointer-events:none}
.template-card img{display:block;width:100%;height:180px;object-fit:contain;border-radius:16px;background:#f7f9fc;border:1px solid #eef2f7;padding:16px}
.template-content h3{margin:18px 0 10px;font-size:26px;line-height:1.08}
.template-content p{margin:0 0 14px;color:var(--muted);font-size:16px}
.feature-list{margin:0;padding-left:18px;color:#4b5563;display:grid;gap:6px;font-size:14px}
.form-section{background:#fff;border:1px solid var(--border);border-radius:22px;padding:22px;margin-bottom:18px}
.form-section h3{margin:0 0 18px;font-size:20px}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 16px;width:100%}
.field{display:flex;flex-direction:column;gap:8px}
.field label{font-size:14px;font-weight:700;color:#0f172a}
.field input,.field select,.field textarea{width:100%;max-width:100%;border:1px solid #cfd8e3;border-radius:14px;padding:14px 16px;background:#fbfdff;color:#0f172a;outline:none;transition:border-color .2s,box-shadow .2s}
.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--primary);box-shadow:0 0 0 4px rgba(30,58,95,.08)}
.field textarea{resize:vertical;min-height:110px}
.field-span-2{grid-column:span 2}
.field-span-3{grid-column:span 3}
.helper{font-size:12px;color:var(--muted)}
.logo-uploader{display:grid;grid-template-columns:120px 1fr;gap:18px;align-items:start}
.logo-drop{width:112px;height:112px;border:2px dashed #cfd8e3;border-radius:20px;display:flex;align-items:center;justify-content:center;text-align:center;color:var(--muted);overflow:hidden;background:#fbfdff;padding:12px}
.logo-drop img{max-width:100%;max-height:100%;display:block}
.service-header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:14px;flex-wrap:wrap}
.service-header h3{margin:0;font-size:18px}
.service-tools{display:flex;gap:10px}
.icon-btn{border:1px solid #dbe4ef;background:#fff;border-radius:12px;padding:10px 14px;color:#334155;font-weight:700;cursor:pointer}
.services-toolbar{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:18px}
.empty-state{padding:34px 20px;border:1px dashed #cbd5e1;border-radius:20px;text-align:center;color:var(--muted);background:#fbfdff}
.total-box{margin-top:18px;padding:18px 22px;border-radius:18px;background:#eff4fa;border:1px solid #d7e0eb;display:flex;justify-content:space-between;align-items:center;font-size:18px;font-weight:700}
.checkbox-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.checkbox-item{display:flex;align-items:center;gap:10px;border:1px solid #cfd8e3;border-radius:14px;background:#fbfdff;padding:14px}
.checkbox-item input{margin:0}
.actions{display:flex;gap:12px;align-items:center;justify-content:flex-end;margin-top:24px;flex-wrap:wrap}
.actions.between{justify-content:space-between}.actions.wrap{justify-content:flex-start}
.btn{appearance:none;border:none;border-radius:16px;padding:14px 20px;font-weight:800;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:10px;transition:.22s}
.btn:hover{transform:translateY(-1px)}
.btn-primary{background:var(--primary);color:#fff}.btn-primary:hover{background:var(--primary-2)}
.btn-secondary{background:#fff;color:#243b53;border:1px solid #cfd8e3}.btn-secondary:hover{background:#f8fafc}
.btn-accent{background:var(--accent);color:#1f2937}
.btn-danger{background:#fff;border:1px solid #fecaca;color:#b91c1c}
.alert{padding:14px 18px;border-radius:16px;margin-bottom:18px}.alert-error{background:#fef2f2;border:1px solid #fecaca;color:#991b1b}
.preview-layout{display:grid;gap:18px;max-width:100%;overflow-x:hidden}
.control-panel{padding:22px 24px;max-width:100%;overflow:hidden}
.control-grid{display:grid;grid-template-columns:1.1fr 1.4fr 1fr;gap:18px;align-items:end}
.color-controls{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.color-picker{width:52px;height:52px;border:none;background:transparent;padding:0;cursor:pointer}
.preset-list{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.color-preset{width:28px;height:28px;border-radius:999px;border:3px solid transparent;cursor:pointer;box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}
.color-preset.active{border-color:#0f172a;transform:scale(1.08)}
.intensity-wrap{display:flex;align-items:center;gap:12px;width:100%}
.intensity-wrap input[type=range]{width:100%}
.color-swatch{width:28px;height:28px;border-radius:8px;border:1px solid rgba(0,0,0,.1)}
.preview-shell{padding:28px;background:#fff;max-width:100%;overflow:hidden}
.quote-stage{background:#eef3f8;border-radius:26px;padding:32px 24px;max-width:100%;overflow:hidden}
.quote-sheet{width:100%;max-width:210mm;min-height:297mm;margin:0 auto;background:#fff;border-radius:12px;box-shadow:0 16px 42px rgba(15,23,42,.12);padding:15mm 14mm;color:#1f2937}
.quote-sheet h1,.quote-sheet h2,.quote-sheet h3,.quote-sheet h4,.quote-sheet p{margin-top:0}
.quote-top-line{height:5px;border-radius:99px;margin-bottom:18px}
.quote-header{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:18px}.brand-block{display:flex;gap:14px;align-items:flex-start}.brand-block.inverse{color:#fff}.compact-brand{align-items:center}
.logo-shell{width:56px;height:56px;border-radius:16px;display:flex;align-items:center;justify-content:center;overflow:hidden;background:#fff;border:1px solid rgba(255,255,255,.2)}
.clean-logo{background:#f8fafc;border-color:#e2e8f0}.hero-logo{background:rgba(255,255,255,.15);border-color:rgba(255,255,255,.25)}
.logo-shell img{max-width:100%;max-height:100%}
.company-name{margin:0 0 8px;font-size:28px;line-height:1.08;font-weight:800}
.company-meta,.client-lines{display:flex;gap:10px 16px;flex-wrap:wrap;color:#475569;font-size:13px}.light-text,.hero-meta{color:rgba(255,255,255,.9)}
.quote-meta{text-align:right;display:grid;gap:6px;font-size:13px}.quote-tag{font-size:13px;font-weight:800;letter-spacing:.12em;text-transform:uppercase}
.section-caption{text-transform:uppercase;font-size:12px;letter-spacing:.12em;font-weight:800;color:#64748b;margin-bottom:8px}
.client-simple-block,.client-card,.payment-card,.notes-box,.elegant-summary{border:1px solid #dde5ef;border-radius:16px;padding:16px 18px;margin-bottom:18px}
.client-name{font-size:19px;font-weight:800;margin-bottom:8px}.mini-note{font-size:13px;color:#475569;line-height:1.55;margin:10px 0 0}
.client-elegant{border-left:4px solid var(--primary);padding:12px 0 12px 16px;margin:20px 0}
.quote-table{width:100%;border-collapse:separate;border-spacing:0;margin:18px 0 8px;overflow:hidden;border-radius:14px;border:1px solid #dbe3ed}
.quote-table thead th{padding:12px 12px;font-size:13px;text-align:left;font-weight:800}.quote-table tbody td{padding:12px 12px;border-top:1px solid #e5edf5;font-size:13px;vertical-align:top}.quote-table tbody td small{display:block;margin-top:5px;color:#64748b;line-height:1.45}.empty-row{text-align:center;color:#64748b;padding:18px!important}
.quote-total-bar,.commercial-total{margin:8px 0 20px;border-radius:14px;padding:14px 16px;display:flex;align-items:center;justify-content:space-between;font-weight:800;font-size:18px;border:1px solid #dce5ef}
.payment-grid{display:grid;gap:12px 16px;grid-template-columns:repeat(2,minmax(0,1fr));margin-top:12px}.payment-grid.compact{grid-template-columns:repeat(2,minmax(0,1fr))}.payment-grid div,.summary-col p{display:flex;justify-content:space-between;gap:12px;border-bottom:1px dashed rgba(15,23,42,.12);padding-bottom:8px;margin:0}.payment-grid div span,.summary-col p span{color:#64748b;font-size:13px}.payment-grid div strong,.summary-col p strong{font-size:14px;text-align:right;white-space:normal;word-break:break-word}
.meta-footer-line{margin-top:12px;font-size:13px;color:#475569}
.quote-footer{display:flex;justify-content:flex-start;gap:28px;align-items:center;border-top:1px solid #e5edf5;padding-top:16px;margin-top:18px;color:#64748b;font-size:13px}
.hero-header{border-radius:18px;padding:18px 22px;display:grid;grid-template-columns:1.4fr .7fr;gap:16px;margin-bottom:20px}.hero-number{font-size:28px;font-weight:800;line-height:1}.client-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 18px;font-size:13px;color:#334155}.elegant-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.summary-col{border-left:4px solid var(--primary);padding-left:14px}.summary-col h3{font-size:16px;margin-bottom:10px}.summary-col p{padding:8px 0}.with-top-line{border-top:3px solid var(--primary)}
.commercial-split-header{display:grid;grid-template-columns:1.5fr .7fr;gap:0;border-radius:18px;overflow:hidden;margin-bottom:18px;border:1px solid #dce5ef}.left-pane,.right-pane{padding:18px 20px}.right-pane{text-align:center;display:grid;place-items:center;gap:8px;border-left:1px solid #dce5ef}
.preview-action-row{display:flex;gap:14px;justify-content:space-between;flex-wrap:wrap;margin-top:18px}.preview-action-row .left-actions,.preview-action-row .right-actions{display:flex;gap:12px;flex-wrap:wrap}
.preview-note{font-size:13px;color:#64748b;margin-top:8px}
.badge{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;padding:8px 14px;background:#eef4fb;color:var(--primary);font-size:13px;font-weight:800;margin-bottom:14px}.hero-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:22px 0}.hero-feature{padding:14px 16px;border-radius:16px;background:#f8fafc;border:1px solid #dbe5ef;font-weight:700;color:#334155}.btn-lg{padding:16px 24px;font-size:16px}
.landing-body{display:grid;place-items:center;min-height:100vh;padding:26px;background:var(--bg)}.landing-container{max-width:860px;width:100%}.hero-card{padding:34px;border-radius:24px;background:#fff;border:1px solid var(--border);box-shadow:var(--shadow)}.hero-text{color:var(--muted);font-size:17px;line-height:1.6}.info-box{margin-top:20px;padding:18px;border-radius:18px;background:#f8fafc;border:1px solid #dbe5ef}.hero-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:22px}
.print-only{display:none}

@media (max-width:980px){
  .template-grid,.control-grid,.checkbox-grid,.elegant-summary,.hero-header,.commercial-split-header{grid-template-columns:1fr}
  .step-item{min-width:120px}.form-grid{grid-template-columns:1fr}.field-span-2,.field-span-3{grid-column:auto}.logo-uploader{grid-template-columns:1fr}.services-toolbar,.topbar,.quote-header,.preview-action-row{flex-direction:column;align-items:stretch}.quote-meta{text-align:left}.quote-sheet{padding:10mm 8mm}.payment-grid.compact,.client-card-grid{grid-template-columns:1fr}.preview-action-row .left-actions,.preview-action-row .right-actions{width:100%}.preview-action-row .btn{flex:1}
}
@media (max-width:640px){
  .page-shell{padding:18px 14px 42px}.topbar h1{font-size:26px}.progress-card{padding:16px 14px}.step-text span{display:none}.template-content h3{font-size:22px}.card,.control-panel,.preview-shell{padding:18px}.quote-sheet{box-shadow:none;border-radius:8px}.quote-table thead th,.quote-table tbody td{font-size:12px;padding:9px}.company-name{font-size:24px}
}

@page{size:A4;margin:8mm}
@media print{
  html,body{background:#fff!important;margin:0!important;padding:0!important}
  body *{visibility:hidden!important}
  .print-scope,.print-scope *{visibility:visible!important}
  .print-scope{position:absolute;left:0;top:0;width:100%;margin:0!important;max-width:none!important;min-height:auto!important;box-shadow:none!important;border:none!important;border-radius:0!important;padding:6mm!important;background:#fff!important;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
  .preview-shell,.quote-stage{padding:0!important;background:#fff!important;border:none!important;box-shadow:none!important}
  .quote-sheet{box-shadow:none!important;border:none!important;border-radius:0!important;padding:6mm!important;min-height:auto!important}
  .quote-table{border:1px solid #d8dee8!important}
  .quote-table thead th,.quote-table tbody td{font-size:10.5px!important;padding:7px 8px!important}
  .company-name{font-size:22px!important}.quote-meta,.company-meta,.client-lines,.mini-note,.payment-grid div strong,.payment-grid div span,.summary-col p strong,.summary-col p span,.quote-footer,.notes-box p{font-size:10.5px!important}
  .quote-tag{font-size:10px!important}.section-caption{font-size:9px!important}.quote-total-bar,.commercial-total{font-size:16px!important;padding:10px 12px!important}.logo-shell{width:42px!important;height:42px!important}
}

.form-grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.hidden-color-picker{position:absolute;opacity:0;pointer-events:none;width:1px;height:1px}
.color-more{background:#fff;color:#0f172a;border:1px dashed #94a3b8;font-size:18px;font-weight:800;display:inline-flex;align-items:center;justify-content:center}
.quote-canvas{width:100%;max-width:100%;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;padding-bottom:6px}
.quote-sheet{width:210mm;max-width:none;min-width:210mm}
#preview_model{cursor:pointer;-webkit-appearance:menulist;appearance:auto;touch-action:manipulation}
@media (max-width:980px){
  .form-grid-3{grid-template-columns:1fr!important}
}
@media (max-width:640px){
  .stepper{justify-content:space-between;gap:6px;padding-bottom:0;overflow:visible}
  .step-item{min-width:0;flex:1 1 0;gap:6px;align-items:center}
  .step-connector{display:none}
  .step-indicator{width:34px;height:34px;font-size:13px}
  .step-text strong{font-size:11px;line-height:1.05}
  .step-text span{display:none}
  .services-toolbar .btn,.actions .btn,.preview-action-row .btn,.control-panel .btn{width:100%}
  .preview-shell{padding:14px}
  .quote-stage{padding:16px 8px}
  .topbar{margin-bottom:14px}
  .topbar h1{font-size:24px;word-break:break-word}
  .field input,.field select,.field textarea{padding:12px 14px}
  .control-grid{grid-template-columns:1fr;gap:14px}
  .color-controls{align-items:flex-start}
  .preset-list{gap:6px}
  .control-panel .actions{justify-content:stretch}
}

.hero-number{font-size:22px;line-height:1.1;word-break:break-word;max-width:100%}
.quote-table th:nth-child(2),.quote-table td:nth-child(2),.quote-table th:nth-child(3),.quote-table td:nth-child(3),.quote-table th:nth-child(4),.quote-table td:nth-child(4){white-space:nowrap}
@media (max-width:640px){
  .quote-table{font-size:12px}
  .quote-footer{gap:14px;flex-wrap:wrap}
  .company-name{font-size:22px}
  .hero-number{font-size:18px}
}

@media (max-width:640px){
  .quote-canvas{margin-inline:-2px}
  .company-name{font-size:20px}
  .quote-meta{font-size:12px}
  .preview-action-row .left-actions,.preview-action-row .right-actions{width:100%}
  .preview-action-row .left-actions .btn,.preview-action-row .right-actions .btn{flex:1 1 100%}
}

@media (max-width:640px){
  .service-card{padding:16px 14px}
  .service-tools{width:100%;justify-content:flex-end}
  .service-tools .icon-btn{padding:9px 12px}
}
