.proposal-page { background: #eef1f3; }
.proposal-actions .topbar-secondary { min-height: 40px; color: #fff; background: transparent; border-color: rgb(255 255 255 / 22%); }
.proposal-actions .topbar-secondary:hover { background: rgb(255 255 255 / 10%); border-color: rgb(255 255 255 / 34%); }
.proposal-main { padding-bottom: 56px; }
.proposal-heading { align-items: center; }
.proposal-workspace { display: grid; grid-template-columns: minmax(330px, 400px) minmax(0, 1fr); gap: 22px; align-items: start; }

.proposal-editor { max-height: calc(100vh - 116px); overflow-y: auto; background: var(--white); border: 1px solid var(--line); scrollbar-width: thin; }
.editor-section { padding: 19px; border-bottom: 1px solid var(--line); }
.editor-section:last-child { border-bottom: 0; }
.editor-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.editor-heading > span { color: var(--signal); font: 600 9px "IBM Plex Mono", monospace; }
.editor-heading h2 { margin: 0; font: 650 16px "Onest", sans-serif; }
.editor-fields { display: grid; gap: 12px; }
.editor-fields.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.editor-fields label, .price-stage { display: grid; min-width: 0; gap: 6px; color: #4d5962; font-size: 10px; font-weight: 650; }
.editor-fields input, .editor-fields select, .editor-fields textarea { width: 100%; min-width: 0; padding: 9px 10px; color: var(--ink); background: #fbfcfc; border: 1px solid var(--line); border-radius: 4px; outline: 0; font-size: 12px; font-weight: 450; }
.editor-fields input, .editor-fields select { height: 40px; }
.editor-fields textarea { line-height: 1.45; resize: vertical; }
.editor-fields :is(input, select, textarea):focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(20 92 255 / 9%); }
.price-stage { margin: 0; padding: 0; border: 0; }
.price-stage legend { margin-bottom: 6px; padding: 0; }
.stage-segments { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 3px; background: var(--paper); border: 1px solid var(--line); border-radius: 5px; }
.stage-segments label { display: block; }
.stage-segments input { position: absolute; opacity: 0; pointer-events: none; }
.stage-segments span { display: grid; min-height: 32px; place-items: center; padding: 4px; color: var(--muted); border-radius: 3px; font-size: 9px; text-align: center; cursor: pointer; transition: color 180ms ease, background 180ms ease; }
.stage-segments input:checked + span { color: var(--navy); background: var(--white); box-shadow: 0 1px 4px rgb(8 28 51 / 10%); font-weight: 750; }

.proposal-preview-wrap { min-width: 0; overflow-x: auto; padding: 22px; background: #dfe4e7; border: 1px solid #d2d9dd; scrollbar-width: thin; }
.proposal-sheet { width: min(100%, 794px); min-height: 1060px; margin: 0 auto; padding: 46px 50px 34px; color: #101820; background: #fff; box-shadow: 0 16px 42px rgb(8 28 51 / 12%); }
.sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid #cfd6da; }
.sheet-header > div { display: grid; gap: 3px; }
.sheet-header > div:last-child { justify-items: end; color: #66737e; font: 500 8px "IBM Plex Mono", monospace; text-transform: uppercase; }
.sheet-header > div:last-child strong { color: var(--navy); font-size: 9px; }
.sheet-brand { display: flex !important; align-items: center; gap: 9px; }
.sheet-brand > span { display: grid; width: 29px; height: 29px; place-items: center; color: #fff; background: var(--navy); font: 600 9px "IBM Plex Mono", monospace; }
.sheet-brand strong { font-size: 11px; }
.sheet-intro { padding: 42px 0 33px; }
.sheet-intro > p:first-child { margin-bottom: 13px; color: var(--signal); font: 600 8px "IBM Plex Mono", monospace; text-transform: uppercase; }
.sheet-intro h2 { max-width: 590px; margin-bottom: 12px; color: var(--navy); font: 600 34px/1.08 "Onest", sans-serif; overflow-wrap: anywhere; }
.sheet-lead { margin: 0; color: var(--muted); font-size: 12px; }
.sheet-section { padding: 25px 0; border-top: 1px solid #dfe4e7; }
.sheet-index { display: block; margin-bottom: 12px; color: var(--blue); font: 600 8px "IBM Plex Mono", monospace; text-transform: uppercase; }
.sheet-section h3 { margin-bottom: 9px; color: var(--navy); font: 650 19px/1.2 "Onest", sans-serif; }
.sheet-section > p, .sheet-section > div > p { max-width: 630px; margin-bottom: 0; color: #46525b; font-size: 11px; line-height: 1.65; white-space: pre-line; }
.task-section p { color: var(--navy); font-size: 14px; line-height: 1.55; }
.scope-section { display: grid; grid-template-columns: 1.25fr 1fr; gap: 34px; }
.scope-section ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.scope-section li { position: relative; padding-left: 16px; color: #33414b; font-size: 10px; line-height: 1.45; }
.scope-section li::before { content: "+"; position: absolute; left: 0; color: var(--blue); font: 600 10px "IBM Plex Mono", monospace; }
.scope-section .excluded-list li { color: #707b83; }
.scope-section .excluded-list li::before { content: "−"; color: #9aa4ab; }
.process-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.process-steps > div { padding: 14px; background: #f2f5f6; border-top: 2px solid var(--navy); }
.process-steps span { color: var(--signal); font: 600 8px "IBM Plex Mono", monospace; }
.process-steps strong { display: block; margin: 9px 0 5px; color: var(--navy); font-size: 11px; }
.process-steps p { margin: 0; color: var(--muted); font-size: 8px; line-height: 1.45; }
.commercial-block { display: grid; grid-template-columns: .8fr 1fr 1.2fr; color: #fff; background: var(--navy); }
.commercial-block > div { min-width: 0; padding: 18px; border-right: 1px solid rgb(255 255 255 / 16%); }
.commercial-block > div:last-child { border-right: 0; }
.commercial-block span { display: block; margin-bottom: 7px; color: rgb(255 255 255 / 58%); font: 500 7px "IBM Plex Mono", monospace; text-transform: uppercase; }
.commercial-block strong { display: block; overflow-wrap: anywhere; font: 650 15px/1.25 "Onest", sans-serif; }
.next-step { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.next-step a { flex: 0 0 auto; padding: 10px 13px; color: #fff; background: var(--signal); border-radius: 4px; font-size: 10px; font-weight: 750; }
.sheet-footer { display: flex; justify-content: space-between; gap: 14px; margin-top: 12px; padding-top: 15px; color: #7a858d; border-top: 1px solid #dfe4e7; font: 500 7px "IBM Plex Mono", monospace; text-transform: uppercase; }

@media (max-width: 1180px) {
  .proposal-workspace { grid-template-columns: minmax(310px, 360px) minmax(0, 1fr); }
  .proposal-sheet { min-width: 680px; }
}

@media (max-width: 900px) {
  .proposal-workspace { grid-template-columns: 1fr; }
  .proposal-editor { max-height: none; }
  .proposal-sheet { width: 100%; min-width: 0; }
}

@media (max-width: 680px) {
  .proposal-actions .topbar-secondary span { display: none; }
  .proposal-actions .topbar-secondary { width: 40px; padding: 0; }
  .proposal-preview-wrap { padding: 9px; }
  .proposal-sheet { min-height: 0; padding: 28px 18px 22px; box-shadow: none; }
  .sheet-intro { padding: 31px 0 25px; }
  .sheet-intro h2 { font-size: 27px; }
  .scope-section { grid-template-columns: 1fr; gap: 24px; }
  .process-steps { grid-template-columns: 1fr; }
  .commercial-block { grid-template-columns: 1fr; }
  .commercial-block > div { border-right: 0; border-bottom: 1px solid rgb(255 255 255 / 16%); }
  .commercial-block > div:last-child { border-bottom: 0; }
  .next-step { align-items: start; flex-direction: column; }
  .sheet-footer { flex-direction: column; }
  .editor-fields.two-columns { grid-template-columns: 1fr; }
}

@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  .crm-topbar, .crm-sidebar, .proposal-heading, .proposal-editor, .toast { display: none !important; }
  .crm-layout, .crm-main, .proposal-workspace { display: block; min-height: 0; padding: 0; }
  .proposal-preview-wrap { overflow: visible; padding: 0; background: #fff; border: 0; }
  .proposal-sheet { width: 210mm; min-width: 210mm; min-height: 297mm; margin: 0; padding: 14mm 16mm 10mm; box-shadow: none; print-color-adjust: exact; }
}
