/* Screen dialog and a clean, paginating A4 equipment plan. */
body.csd-plan-open { overflow: hidden; }
.csd-plan-dialog {
  --plan-blue: #156241; --plan-ink: #184532; --plan-muted: #527767; --plan-yellow: #ffda45;
  box-sizing: border-box; width: min(1060px, calc(100vw - 40px)); max-width: none;
  height: min(94dvh, 1120px); max-height: 94dvh; padding: 0; border: 0; border-radius: 18px;
  color: var(--plan-ink); background: #e8f3ee; overflow: hidden; box-shadow: 0 30px 100px #09291b55;
  font-family: 'Manrope', Arial, sans-serif; font-size: 16px; line-height: 1.5;
}
.csd-plan-dialog *, .csd-plan-dialog *::before, .csd-plan-dialog *::after { box-sizing: border-box; }
.csd-plan-dialog::backdrop { background: #092b1cba; backdrop-filter: blur(7px); }
.csd-plan-dialog[open] { display: flex; flex-direction: column; }
.csd-plan-actionbar {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px 24px; background: #ffffff; border-bottom: 1px solid #daebe4; position: sticky; top: 0; z-index: 2;
}
.csd-plan-bar-copy h2 { margin: 0 0 3px; color: var(--plan-blue); font-size: 16px; font-weight: 800; }
.csd-plan-bar-copy p { margin: 0; color: var(--plan-muted); font-size: 14px; }
.csd-plan-actions { display: flex; gap: 9px; align-items: center; flex: 0 0 auto; }
.csd-plan-actions button {
  margin: 0; min-height: 44px; padding: 10px 15px; border-radius: 7px; border: 1px solid #cbe2d8;
  font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; white-space: nowrap;
}
.csd-plan-actions .csd-plan-print { background: var(--plan-blue); color: white; border-color: var(--plan-blue); }
.csd-plan-actions .csd-plan-edit { background: white; color: var(--plan-blue); }
.csd-plan-actions .csd-plan-close { padding: 0; width: 44px; font-size: 25px; color: var(--plan-blue); background: #f1f8f5; border: 0; }
.csd-plan-actions button:disabled { opacity: .5; cursor: wait; }
.csd-plan-dialog :focus-visible { outline: 3px solid #e5ad00; outline-offset: 3px; }
.csd-plan-viewport { min-height: 0; flex: 1 1 auto; overflow: auto; overscroll-behavior: contain; padding: 0 28px 28px; }
.csd-plan-readiness { margin: 12px auto; max-width: 880px; font-size: 12px; color: #416b59; }
.csd-plan-sheet { max-width: 880px; margin: 0 auto; padding: 40px 44px 30px; background: #ffffff; box-shadow: 0 3px 16px #14422e12; }
.csd-plan-header { display: flex; gap: 28px; align-items: flex-start; justify-content: space-between; border-bottom: 4px solid var(--plan-yellow); padding-bottom: 25px; }
.csd-plan-brand { display: flex; flex-direction: column; gap: 10px; }
.csd-plan-logo { width: 148px; height: 74px; object-fit: contain; object-position: left center; }
.csd-plan-brand-name { font-size: 12px; letter-spacing: .03em; font-weight: 800; color: var(--plan-blue); }
.csd-plan-heading { text-align: right; }
.csd-plan-kicker { margin: 4px 0 5px; font-size: 12px; letter-spacing: .08em; font-weight: 800; color: var(--plan-muted); }
.csd-plan-heading h2 { margin: 0; color: var(--plan-blue); font-size: 32px; line-height: 1.15; font-weight: 800; letter-spacing: -.05em; }
.csd-plan-intro { margin: 8px 0 0; font-size: 16px; color: var(--plan-muted); }
.csd-plan-ribbon { display: flex; gap: 32px; margin: 22px 0 17px; padding: 14px 18px; background: #f0f9f5; border-radius: 7px; }
.csd-plan-pair { min-width: 0; }
.csd-plan-pair dt { font-size: 14px; color: var(--plan-muted); }
.csd-plan-pair dd { margin: 3px 0 0; font-weight: 800; color: var(--plan-ink); overflow-wrap: anywhere; }
.csd-plan-scope { margin: 0; font-size: 16px; line-height: 1.7; color: var(--plan-muted); }
.csd-plan-development { margin-top: 18px; padding: 12px 15px; background: #fff9df; border-left: 3px solid #efc630; color: #5e4e10; font-size: 16px; }
.csd-plan-development strong { font-size: 16px; }
.csd-plan-development p { margin: 4px 0 0; }
.csd-plan-section { margin-top: 28px; }
.csd-plan-section-title { margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid #d9ede4; color: var(--plan-blue); font-size: 16px; font-weight: 800; letter-spacing: .015em; }
.csd-plan-items { list-style: none; padding: 0; margin: 0; }
.csd-plan-item { display: grid; grid-template-columns: 100px minmax(0,1fr) 145px; gap: 18px; align-items: start; padding: 18px 0; border-bottom: 1px solid #e0efe9; }
.csd-plan-item:first-child { padding-top: 2px; }
.csd-plan-photo { margin: 0; min-width: 0; text-align: center; }
.csd-plan-photo img { display: block; width: 100%; height: 83px; object-fit: contain; }
.csd-plan-photo img[hidden] { display: none; }
.csd-plan-photo figcaption { margin-top: 7px; font-size: 12px; line-height: 1.5; color: var(--plan-muted); }
.csd-plan-photo-unavailable::before { content: 'Product reference'; display: block; padding: 18px 4px; color: #608f7b; border: 1px solid #d8eee4; background: #f5fbf8; font-size: 12px; }
.csd-plan-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.csd-plan-item-top h4 { margin: 0; font-size: 18px; line-height: 1.3; font-weight: 800; color: var(--plan-blue); }
.csd-plan-quantity { flex: 0 0 auto; background: #eef9f4; border-radius: 4px; padding: 3px 7px; font-size: 12px; font-weight: 800; }
.csd-plan-config { margin: 7px 0 0; font-size: 16px; font-weight: 700; }
.csd-plan-package { margin: 4px 0 0; font-size: 14px; color: var(--plan-muted); }
.csd-plan-volume, .csd-plan-model-note { margin: 5px 0 0; font-size: 14px; line-height: 1.6; color: var(--plan-muted); }
.csd-plan-planned { margin: 6px 0 0; font-size: 12px; font-weight: 800; color: #786116; letter-spacing: .02em; }
.csd-plan-line-cost { text-align: right; overflow-wrap: anywhere; }
.csd-plan-line-cost .csd-plan-unit-price { margin: 2px 0 9px; font-size: 14px; color: var(--plan-muted); }
.csd-plan-line-cost strong { display: block; color: var(--plan-blue); font-size: 16px; font-weight: 800; }
.csd-plan-line-cost > span { display: block; font-size: 12px; color: var(--plan-muted); }
.csd-plan-price-pending { padding-top: 5px; }
.csd-plan-image-note { margin: 11px 0 0; font-size: 14px; line-height: 1.6; color: var(--plan-muted); }
.csd-plan-totals { margin: 0; }
.csd-plan-totals .csd-plan-pair { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 8px 0; }
.csd-plan-totals dt { font-size: 14px; }
.csd-plan-totals dd { margin: 0; flex: 0 0 auto; font-size: 16px; }
.csd-plan-totals .csd-plan-grand { padding: 15px 18px; margin: 5px 0 8px; background: #f0f9f5; border-left: 3px solid var(--plan-blue); }
.csd-plan-grand dt { color: var(--plan-blue); font-weight: 800; }
.csd-plan-grand dd { color: var(--plan-blue); font-size: 22px; }
.csd-plan-installation { margin-top: 13px; padding: 14px 16px; border: 1px solid #d4eae0; border-radius: 5px; font-size: 16px; }
.csd-plan-installation strong { color: var(--plan-blue); font-size: 16px; }
.csd-plan-installation p { margin: 5px 0 0; line-height: 1.7; color: var(--plan-muted); }
.csd-plan-details { display: grid; grid-template-columns: 1fr 1fr; gap: 17px 24px; margin: 0; }
.csd-plan-details dd { font-size: 16px; font-weight: 600; }
.csd-plan-notes { margin-top: 20px; padding: 15px 16px; background: #f7fcfa; border-radius: 5px; }
.csd-plan-notes h4 { margin: 0 0 7px; color: var(--plan-blue); font-size: 14px; }
.csd-plan-notes p { margin: 0; font-size: 16px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.csd-plan-footer { margin-top: 30px; padding: 18px 0 0 !important; border-top: 2px solid var(--plan-blue); display: flex; gap: 8px 20px; flex-wrap: wrap; justify-content: space-between; font-size: 14px; }
.csd-plan-footer strong { color: var(--plan-blue); }
.csd-plan-footer-contacts { display: flex; flex-wrap: wrap; gap: 4px 17px; }
.csd-plan-footer a { color: var(--plan-blue); text-decoration: none; overflow-wrap: anywhere; }
.csd-plan-footer > p { flex-basis: 100%; margin: 1px 0 0; color: var(--plan-muted); font-size: 14px; }
@media (max-width: 700px) {
  .csd-plan-dialog { width: calc(100vw - 16px); height: 96dvh; max-height: 96dvh; border-radius: 12px; }
  .csd-plan-actionbar { padding: 14px; flex-wrap: wrap; gap: 12px; }
  .csd-plan-bar-copy { width: 100%; padding-right: 36px; }
  .csd-plan-actions { width: 100%; }
  .csd-plan-actions .csd-plan-print { flex: 1; }
  .csd-plan-actions .csd-plan-close { position: absolute; top: 10px; right: 10px; width: 38px; min-height: 38px; }
  .csd-plan-viewport { padding: 0 10px 12px; }
  .csd-plan-readiness { font-size: 12px; margin: 10px 4px; }
  .csd-plan-sheet { padding: 25px 20px; }
  .csd-plan-header { flex-direction: column; gap: 22px; padding-bottom: 20px; }
  .csd-plan-logo { width: 122px; height: 61px; }
  .csd-plan-heading { text-align: left; }
  .csd-plan-heading h2 { font-size: 31px; }
  .csd-plan-ribbon { flex-wrap: wrap; gap: 15px 25px; padding: 13px; }
  .csd-plan-ribbon .csd-plan-pair:first-child { flex-basis: 100%; }
  .csd-plan-item { grid-template-columns: 76px minmax(0,1fr); gap: 12px; }
  .csd-plan-photo img { height: 74px; }
  .csd-plan-item-top { flex-wrap: wrap; justify-content: flex-start; }
  .csd-plan-line-cost { grid-column: 2; text-align: left; padding-top: 2px; }
  .csd-plan-line-cost .csd-plan-unit-price { margin-bottom: 4px; }
  .csd-plan-line-cost strong { font-size: 16px; }
  .csd-plan-totals .csd-plan-grand { flex-direction: column; gap: 4px; padding: 13px; }
  .csd-plan-details { grid-template-columns: 1fr; gap: 14px; }
  .csd-plan-footer { flex-direction: column; }
  .csd-plan-footer-contacts { flex-direction: column; }
}
@page { size: A4; margin: 15mm; }
@media screen and (max-width:600px) {
  .csd-plan-item { display:flow-root; }
  .csd-plan-photo { float:left; width:70px; margin:0 15px 12px 0; }
  .csd-plan-photo img { height:70px; }
  .csd-plan-photo figcaption { display:none; }
  .csd-plan-item-top { gap:8px; padding-top:2px; }
  .csd-plan-item-copy .csd-plan-package { clear:both; padding-top:10px; }
  .csd-plan-line-cost { margin-top:14px; }
}
@media print {
  body.csd-plan-open { margin: 0 !important; padding: 0 !important; overflow: visible !important; background: white !important; }
  body.csd-plan-open > :not(#equipment-plan-dialog) { display: none !important; }
  body.csd-plan-open #equipment-plan-dialog {
    display: block !important; position: static !important; inset: auto !important; transform: none !important;
    width: 100% !important; max-width: none !important; height: auto !important; max-height: none !important;
    margin: 0 !important; padding: 0 !important; overflow: visible !important; border: 0 !important;
    border-radius: 0 !important; box-shadow: none !important; background: #ffffff !important;
    color: #184532 !important; font-size: 10pt; print-color-adjust: exact; -webkit-print-color-adjust: exact;
  }
  #equipment-plan-dialog::backdrop { display: none; }
  .csd-plan-actionbar, .csd-plan-readiness { display: none !important; }
  .csd-plan-viewport { display: block; padding: 0; overflow: visible; height: auto; max-height: none; }
  .csd-plan-sheet { width: 100%; max-width: none; margin: 0; padding: 0; box-shadow: none; }
  .csd-plan-header { flex-direction: row; gap: 20px; break-inside: avoid; padding-bottom: 18px; }
  .csd-plan-heading { text-align: right; }
  .csd-plan-heading h2 { font-size: 27pt; }
  .csd-plan-logo { width: 130px; height: 65px; }
  .csd-plan-ribbon { flex-wrap: nowrap; gap: 28px; break-inside: avoid; }
  .csd-plan-ribbon .csd-plan-pair:first-child { flex-basis: auto; }
  .csd-plan-section { margin-top: 23px; }
  .csd-plan-section-title { break-after: avoid; page-break-after: avoid; }
  .csd-plan-item { display: grid; grid-template-columns: 95px minmax(0,1fr) 140px; gap: 14px; break-inside: avoid; page-break-inside: avoid; }
  .csd-plan-line-cost { grid-column: auto; text-align: right; }
  .csd-plan-item-top { flex-wrap: nowrap; justify-content: space-between; }
  .csd-plan-totals { break-inside: avoid; }
  .csd-plan-totals .csd-plan-grand { flex-direction: row; }
  .csd-plan-installation, .csd-plan-development, .csd-plan-details, .csd-plan-footer { break-inside: avoid; page-break-inside: avoid; }
  .csd-plan-details { grid-template-columns: 1fr 1fr; }
  .csd-plan-notes { break-inside: auto; }
  .csd-plan-notes h4 { break-after: avoid; }
  .csd-plan-notes p { orphans: 3; widows: 3; }
  .csd-plan-footer { flex-direction: row; }
  .csd-plan-footer-contacts { flex-direction: row; }
  .csd-plan-footer a::after { content: none !important; }
  .csd-plan-scope, .csd-plan-development, .csd-plan-config, .csd-plan-installation,
  .csd-plan-details dd, .csd-plan-notes p, .csd-plan-intro { font-size: 10pt; }
  .csd-plan-development strong, .csd-plan-installation strong { font-size: 10pt; }
  .csd-plan-section-title { font-size: 11pt; }
  .csd-plan-package, .csd-plan-volume, .csd-plan-model-note, .csd-plan-image-note,
  .csd-plan-line-cost .csd-plan-unit-price, .csd-plan-totals dt,
  .csd-plan-pair dt, .csd-plan-notes h4 { font-size: 9pt; }
  .csd-plan-pair dd { font-size: 10pt; }
  .csd-plan-totals dd { font-size: 11pt; }
  .csd-plan-totals .csd-plan-grand dd { font-size: 17pt; }
  .csd-plan-photo figcaption, .csd-plan-quantity, .csd-plan-planned,
  .csd-plan-line-cost > span, .csd-plan-brand-name, .csd-plan-kicker { font-size: 8pt; }
  .csd-plan-item-top h4 { font-size: 12pt; }
  .csd-plan-footer { padding: 12px 0 0 !important; font-size: 9pt; }
  .csd-plan-footer > p { font-size: 8pt; }
}
