/* ===== Printable A4 document (794 x 1123 px = 210 x 297 mm @ 96dpi) ===== */
.page {
  --accent: #E8772E;
  --line: #3b3b3b;
  --blue: #2F6DB5;
  position: relative;
  width: 794px;
  height: 1123px;
  overflow: hidden;
  background: #fff;
  color: #111;
  font-family: Calibri, Carlito, "Segoe UI", Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.25;
  box-sizing: border-box;
}
.page *, .page *::before, .page *::after { box-sizing: border-box; }

/* header */
.page .decor-top { position: absolute; top: 0; left: 0; display: block; }
.page .pg-brand { position: absolute; top: 40px; left: 186px; right: 36px; }
.page .brand-row { display: flex; align-items: center; gap: 14px; height: 80px; }
.page .mark { flex: none; }
.page .mark-img { flex: none; height: 78px; width: auto; max-width: 110px; object-fit: contain; }
.page .brand-text {
  font-family: Quicksand, "Century Gothic", "Avenir Next", Arial, sans-serif;
  font-weight: 500; font-size: 54px; line-height: 1; letter-spacing: 1px;
  color: #E8322B; white-space: nowrap;
}
.page .brand-text .small { font-size: 40px; color: #333; }
.page .brand-text .small .r { color: #E8322B; }
.page .pg-brand.has-img { left: 150px; }
.page .logo-img { display: block; height: 80px; max-width: 560px; object-fit: contain; object-position: left center; }
.page .contact-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin: 2px 0 0 92px; font-size: 14px; line-height: 1.25;
}
.page .has-img .contact-row { margin-left: 36px; }
.page .ct { display: flex; align-items: flex-start; gap: 8px; }
.page .ct .pin { margin-top: 2px; flex: none; }
.page .web { color: #555; font-size: 12px; padding-top: 6px; display: flex; align-items: center; gap: 5px; }
.page .web .sq { width: 7px; height: 7px; background: #F28C28; display: inline-block; }

/* body area */
.page .pg-body { position: absolute; top: 166px; left: 64px; right: 52px; bottom: 90px; overflow: hidden; }
.page .blk { display: flow-root; }

/* footer */
.page .decor-bottom { position: absolute; top: 893px; left: 0; display: block; }
.page .foot-line {
  position: absolute; left: 30px; right: 170px; bottom: 70px;
  font-size: 10.5px; color: #777; text-align: left;
}
.page .pg-num { position: absolute; bottom: 9px; left: 0; right: 0; text-align: center; font-size: 13px; }

/* title row */
.page .d-title { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin: 2px 0 10px; }
.page .d-title h1 { margin: 0 20px; font-size: 27px; font-weight: 700; letter-spacing: .3px; }
.page .d-title .right { display: flex; justify-content: flex-end; }
.page .box { display: inline-block; border: 1.4px solid #222; padding: 6px 14px; font-weight: 700; font-size: 15px; white-space: nowrap; }
.page .paid-tag { display: inline-block; vertical-align: middle; margin-left: 8px; padding: 1px 9px; border: 2px solid #2E9E5B; color: #2E9E5B; border-radius: 4px; font-size: 13px; letter-spacing: 2px; }
.page .intro { margin: 6px 0 10px; }
.page .intro.b { font-weight: 700; }

/* customer table */
.page table { width: 100%; border-collapse: collapse; }
.page .cust td { border: 1px solid var(--line); padding: 5px 9px; vertical-align: top; }
.page .cust .w33 { width: 33.3%; }

/* sections */
.page .sec-h {
  color: var(--accent); font-size: 18px; font-weight: 400; text-decoration: underline;
  text-underline-offset: 3px; margin: 16px 0 8px;
}
.page .order-h { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin: 16px 0 8px; }
.page .order-h .sec-h { margin: 0; }
.page .ctype { font-size: 14.5px; white-space: nowrap; }
.page .ctype-row { margin: 0 0 12px; }
.page .cb {
  display: inline-flex; align-items: center; justify-content: center;
  width: 13px; height: 13px; border: 1.2px solid #222; font-size: 11px; line-height: 1;
  vertical-align: -1px; margin-right: 3px; font-weight: 700;
}
.page .ver td { border: 1px solid var(--line); padding: 10px 9px; font-size: 17px; width: 33.3%; }
.page .ver td:first-child { width: 30%; }

/* items */
.page .items { margin-top: 4px; }
.page .items th, .page .items td { border: 1px solid var(--line); padding: 4px 9px; }
.page .items th { text-align: left; font-weight: 400; font-size: 20px; color: var(--blue); }
.page .doc-invoice .items th, .page.doc-invoice .items th { color: #111; font-weight: 700; font-size: 16px; }
.page .items .amt { width: 170px; text-align: center; white-space: nowrap; }
.page .items tr.sub td { font-size: 14.5px; }
.page .items tr.total td { font-weight: 700; }
.page.doc-quotation .items th, .page.doc-quotation .items td { border-color: #2B4F81; }
.page .words { margin: 6px 0 0; font-size: 13.5px; }
.page .notes { margin-top: 10px; font-size: 14px; }
.page .info { margin-top: 14px; }
.page .info td { border: 1px solid var(--line); padding: 6px 10px; vertical-align: top; font-size: 13.5px; line-height: 1.38; }
.page .info td span { color: #555; }
.page .info .info-h { display: block; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; font-weight: 400; font-size: 16px; margin-bottom: 4px; }
.page .info .info-h.paid { color: #23884a; }
.page .info .info-note { margin-top: 3px; font-style: italic; color: #333; }
.page .info .info-qr { width: 120px; text-align: center; font-size: 11.5px; line-height: 1.25; vertical-align: middle; }
.page .info .qr { width: 72px; height: 72px; display: block; margin: 0 auto 3px; }

/* bullet lists */
.page .bl { position: relative; padding-left: 28px; margin: 0 0 2px; line-height: 1.26; }
.page .bl::before { content: "•"; position: absolute; left: 7px; top: -1px; font-size: 17px; }

/* prepared by / acceptance */
.page .prep { display: flex; gap: 70px; margin-top: 16px; font-size: 15px; }
.page .stamp-wrap { margin-top: 12px; display: inline-block; text-align: center; }
.page .stamp { height: 95px; max-width: 220px; object-fit: contain; display: block; margin: 0 auto; }
.page .stamp-cap { font-size: 12px; color: #444; }
.page .accept { margin-top: 20px; }
.page .accept p { margin: 0; }
.page .sign-space { height: 62px; }
.page .sign-line { display: inline-block; border-top: 1px solid #333; padding-top: 4px; min-width: 220px; font-size: 13px; color: #333; }

/* =====================================================================
   PREMIUM DESIGN
   ===================================================================== */
.page.tpl-premium {
  --navy: #1B2A4A;
  --ink: #2B3445;
  --muted: #7A8397;
  --hair: #E4E8F0;
  --soft: #F6F8FB;
  --orange: #F28C28;
  --blue: #1B75BB;
  font-family: Inter, "Segoe UI", -apple-system, Arial, sans-serif;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink);
}
.tpl-premium .p-strip { position: absolute; left: 0; display: block; }
.tpl-premium .p-strip.top { top: 0; }
.tpl-premium .p-strip.bottom { bottom: 0; }
.tpl-premium .p-wm { position: absolute; right: 0; bottom: 70px; display: block; }

/* header */
.tpl-premium .p-head {
  position: absolute; top: 8px; left: 48px; right: 48px; padding-top: 28px;
  display: flex; justify-content: space-between; align-items: flex-start;
}
.tpl-premium .p-brand { display: flex; align-items: center; gap: 14px; }
.tpl-premium .p-brand .mark, .tpl-premium .p-mark { flex: none; display: block; width: auto; object-fit: contain; }
.tpl-premium .p-name {
  font-family: Poppins, "Segoe UI", Arial, sans-serif; font-weight: 600; font-size: 27px;
  line-height: 1.1; color: var(--navy); letter-spacing: -.2px; white-space: nowrap;
}
.tpl-premium .p-name .acc { color: var(--orange); }
.tpl-premium .p-legal {
  margin-top: 5px; font-size: 10px; font-weight: 600; letter-spacing: 2.2px; text-transform: uppercase; color: var(--muted);
}
.tpl-premium .p-logo-full { display: block; height: 70px; max-width: 360px; object-fit: contain; object-position: left center; }
.tpl-premium .p-logo-full.sm { height: 38px; }
.tpl-premium .p-doc { text-align: right; }
.tpl-premium .p-title {
  font-family: Poppins, "Segoe UI", Arial, sans-serif; font-weight: 700; font-size: 32px; line-height: 1;
  letter-spacing: 6px; text-transform: uppercase; color: var(--navy); margin-right: -6px;
}
.tpl-premium .p-meta {
  display: grid; grid-template-columns: auto auto; justify-content: end; column-gap: 14px; row-gap: 3px;
  margin-top: 12px; font-size: 12px;
}
.tpl-premium .p-meta span { color: var(--muted); text-align: right; }
.tpl-premium .p-meta b { color: var(--navy); font-weight: 600; text-align: right; }
.tpl-premium .p-title-row { display: flex; justify-content: flex-end; align-items: center; gap: 14px; }
.tpl-premium .p-paid {
  flex: none; padding: 3px 11px 3px 13px; border: 2px solid #2E9E5B; color: #2E9E5B; background: #F0FAF4;
  border-radius: 5px; font-family: Poppins, Arial, sans-serif; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; font-size: 12px; line-height: 1.3;
}
.tpl-premium .p-grand.paid { background: linear-gradient(135deg, #34B36A 0%, #2A9A58 55%, #1F8449 100%); }
.tpl-premium .p-contacts {
  position: absolute; top: 136px; left: 48px; right: 48px;
  display: flex; justify-content: space-between; gap: 10px;
  background: var(--soft); border: 1px solid var(--hair); border-radius: 12px; padding: 9px 16px; overflow: hidden;
}
/* too many / too long details for one line: neat 2 x 2 grid, body moves down */
.tpl-premium .p-contacts.two-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; top: 128px; padding: 8px 16px; }
.tpl-premium .p-contacts.two-rows .p-ic { width: 24px; height: 24px; }
.tpl-premium.ct2 .pg-body.first { top: 230px; }
/* the taller two-row bar costs space: tighten a few gaps so a normal quotation still fits one page */
.tpl-premium.ct2 .p-sec { margin: 13px 0 8px; }
.tpl-premium.ct2 .p-items { margin-top: 15px; }
.tpl-premium.ct2 .p-prep { margin-top: 7px; padding: 8px 18px; }
.tpl-premium .p-ct { display: flex; align-items: center; gap: 9px; flex: none; }
.tpl-premium .p-ic { display: block; flex: none; }
.tpl-premium .p-ct small { display: block; font-size: 9.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.tpl-premium .p-ct b { display: block; font-size: var(--ct-fs, 12.5px); color: var(--navy); font-weight: 600; white-space: nowrap; }

.tpl-premium .p-head.small { padding-top: 22px; align-items: center; }
.tpl-premium .p-head.small .p-name { font-size: 19px; }
.tpl-premium .p-doc-s { text-align: right; font-size: 12px; color: var(--muted); }
.tpl-premium .p-doc-s b {
  font-family: Poppins, Arial, sans-serif; color: var(--navy); text-transform: uppercase; letter-spacing: 3px; margin-right: 10px;
}

/* body frame */
.tpl-premium .pg-body { top: 100px; left: 48px; right: 48px; bottom: 56px; }
.tpl-premium .pg-body.first { top: 204px; }

/* footer */
.tpl-premium .p-foot {
  position: absolute; left: 48px; right: 48px; bottom: 18px; padding-top: 9px; border-top: 1px solid var(--hair);
  display: flex; justify-content: space-between; gap: 20px; font-size: 10.5px; color: var(--muted);
}
.tpl-premium .p-foot b { color: var(--navy); }
.tpl-premium i { font-style: normal; color: var(--orange); margin: 0 7px; }

/* parties */
.tpl-premium .p-intro { margin: 0 0 10px; color: var(--muted); font-size: 12px; font-style: italic; }
.tpl-premium .p-parties { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; }
.tpl-premium .p-card { border: 1px solid var(--hair); border-radius: 12px; padding: 12px 18px 13px; background: #fff; }
.tpl-premium .p-card.alt { background: var(--soft); }
.tpl-premium .p-label {
  font-size: 9.5px; font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase; color: var(--orange); margin-bottom: 7px;
}
.tpl-premium .p-label.mt { margin-top: 10px; }
.tpl-premium .p-company {
  font-family: Poppins, "Segoe UI", Arial, sans-serif; font-weight: 600; font-size: 16.5px; line-height: 1.25;
  color: var(--navy); margin-bottom: 6px;
}
.tpl-premium .p-line { margin-top: 2px; color: var(--ink); }
.tpl-premium .p-line span { color: var(--muted); margin-right: 6px; }
.tpl-premium .p-kv { display: grid; grid-template-columns: 92px 1fr; row-gap: 7px; align-items: center; }
.tpl-premium .p-kv > span { color: var(--muted); }
.tpl-premium .p-kv > b { color: var(--navy); font-weight: 600; }
.tpl-premium .p-pill {
  display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
  background: #FFF1E6; color: #C4610F;
}
.tpl-premium .p-pill.blue { background: #E8F2FB; color: #145C94; }

/* items */
.tpl-premium .p-items { margin-top: 20px; border: 1px solid var(--hair); border-radius: 12px; overflow: hidden; }
.tpl-premium .p-items table { width: 100%; border-collapse: collapse; }
.tpl-premium .p-items th {
  background: var(--navy); color: #fff; text-align: left; font-size: 10px; font-weight: 600;
  letter-spacing: 1.4px; text-transform: uppercase; padding: 10px 16px;
}
.tpl-premium .p-items td { padding: 9px 16px; border-top: 1px solid #EEF1F6; font-size: 13px; color: var(--ink); vertical-align: top; }
.tpl-premium .p-items tbody tr:first-child td { border-top: 0; }
.tpl-premium .p-items tbody tr:nth-child(even) td { background: #FAFBFD; }
.tpl-premium .p-items .n { width: 48px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tpl-premium .p-items th.n { color: #AFC0DA; }
.tpl-premium .p-items .a { width: 170px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--navy); }
.tpl-premium .p-items th.a { color: #fff; }

/* totals */
.tpl-premium .p-sum { display: flex; gap: 18px; margin-top: 14px; align-items: flex-start; }
.tpl-premium .p-words { flex: 1; background: var(--soft); border: 1px solid var(--hair); border-radius: 12px; padding: 12px 16px; }
.tpl-premium .p-words.empty { visibility: hidden; }
.tpl-premium .p-words-t { color: var(--navy); font-weight: 500; }
.tpl-premium .p-note { color: var(--ink); }
.tpl-premium .p-totals { width: 292px; flex: none; }
.tpl-premium .p-tr { display: flex; justify-content: space-between; padding: 5px 4px; border-bottom: 1px dashed var(--hair); }
.tpl-premium .p-tr span { color: var(--muted); }
.tpl-premium .p-tr b { color: var(--navy); font-weight: 600; font-variant-numeric: tabular-nums; }
.tpl-premium .p-grand, .tpl-premium .p-balance {
  display: flex; justify-content: space-between; align-items: center; margin-top: 8px;
  padding: 11px 16px; border-radius: 10px; color: #fff;
  background: linear-gradient(135deg, #F7A03C 0%, #EE7A22 55%, #E4641C 100%);
}
.tpl-premium .p-balance { background: var(--navy); }
.tpl-premium .p-grand span, .tpl-premium .p-balance span { font-size: 10.5px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
.tpl-premium .p-grand b, .tpl-premium .p-balance b { font-family: Poppins, Arial, sans-serif; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* sections */
.tpl-premium .p-sec {
  display: flex; align-items: center; gap: 10px; margin: 16px 0 9px;
  font-family: Poppins, "Segoe UI", Arial, sans-serif; font-weight: 600; font-size: 12.5px;
  letter-spacing: 1.6px; text-transform: uppercase; color: var(--navy);
}
.tpl-premium .p-sec::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--orange); }
.tpl-premium .p-sec::after { content: ""; flex: 1; height: 1px; background: var(--hair); }
.tpl-premium .p-hw { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 22px; }
.tpl-premium .p-hw > div { display: flex; align-items: flex-start; gap: 9px; }
.tpl-premium .p-hw.titled { gap: 8px 26px; }
.tpl-premium .p-hw.titled b { display: block; font-family: Poppins, Arial, sans-serif; font-weight: 600; font-size: 12px; color: var(--navy); line-height: 1.3; }
.tpl-premium .p-hw.titled span { font-size: 11.5px; line-height: 1.4; color: #4A5366; }
.tpl-premium .p-hw.titled .p-chk { margin-top: 2px; }
.tpl-premium .p-chk { display: block; flex: none; margin-top: 1px; }
.tpl-premium .p-terms { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 26px; margin-bottom: 5px; }
.tpl-premium .p-term { display: flex; gap: 9px; font-size: 11.5px; line-height: 1.42; color: #3A4254; }
.tpl-premium .p-term > b {
  flex: none; width: 20px; font-family: Poppins, Arial, sans-serif; font-weight: 600; font-size: 11px; color: var(--orange);
}
.tpl-premium .p-term u { text-decoration-color: var(--orange); }

/* signatures: two identical cards so everything lines up */
.tpl-premium .p-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 22px; }
.tpl-premium .p-sigcard {
  display: flex; flex-direction: column; border: 1px solid var(--hair); border-radius: 12px;
  padding: 14px 20px 14px; background: #fff;
}
.tpl-premium .p-sigcard .p-label { margin-bottom: 3px; }
.tpl-premium .p-sigdesc { font-size: 11.5px; color: var(--muted); line-height: 1.4; min-height: 32px; }
.tpl-premium .p-sigbox { height: 96px; display: flex; align-items: center; justify-content: center; }
.tpl-premium .p-stamp-img { height: 92px; max-width: 180px; object-fit: contain; display: block; }
.tpl-premium .p-sigline { border-top: 1.2px solid #9AA3B5; margin: 4px 0 8px; }
.tpl-premium .p-sigcap { text-align: center; }
.tpl-premium .p-sigcap b { display: block; color: var(--navy); font-weight: 600; font-size: 13px; }
.tpl-premium .p-sigcap small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.tpl-premium .p-sigcard.thanks { justify-content: center; text-align: center; background: var(--soft); }
.tpl-premium .p-sigcard.thanks small { color: var(--muted); font-size: 11.5px; }
.tpl-premium .p-thanks { font-family: Poppins, Arial, sans-serif; font-weight: 600; font-size: 15px; color: var(--navy); margin-bottom: 4px; }

.tpl-premium .p-prep {
  display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 10px;
  background: var(--soft); border: 1px solid var(--hair); border-radius: 12px; padding: 10px 18px;
}
.tpl-premium .p-prep .p-label { margin-bottom: 3px; }
.tpl-premium .p-prep b { color: var(--navy); font-weight: 600; font-size: 13.5px; margin-right: 10px; }
.tpl-premium .p-prep span { color: var(--muted); }
.tpl-premium .p-prep .p-thanks { margin: 0; font-size: 14px; }

/* payment received / support / QR code */
.tpl-premium .p-info { display: grid; gap: 12px; margin-top: 14px; grid-template-columns: minmax(0, 1fr); align-items: stretch; }
.tpl-premium .p-info.has-pay.n2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.tpl-premium .p-info.has-qr.n2 { grid-template-columns: minmax(0, 1fr) 150px; }
.tpl-premium .p-info.has-pay.has-qr.n3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr) 132px; }
.tpl-premium .p-icard { border: 1px solid var(--hair); border-radius: 12px; padding: 11px 16px 12px; background: #fff; min-width: 0; }
.tpl-premium .p-icard .p-label { margin-bottom: 8px; }
.tpl-premium .p-icard.pay { background: #F1FAF5; border-color: #CDE9D8; }
.tpl-premium .p-icard.pay .p-label { color: #1F8449; margin: 0; }
.tpl-premium .p-ihead { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.tpl-premium .p-ic.sm { width: 22px; height: 22px; }
.tpl-premium .p-kv2 { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; row-gap: 4px; font-size: 12.5px; }
.tpl-premium .p-kv2 span { color: var(--muted); }
.tpl-premium .p-kv2 b { color: var(--navy); font-weight: 600; overflow-wrap: anywhere; }
.tpl-premium .p-inote { margin-top: 7px; padding-top: 6px; border-top: 1px dashed #BFE0CC; font-size: 11.5px; color: #1F6E40; }
.tpl-premium .p-sups { display: grid; gap: 8px; }
.tpl-premium .p-sups.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 18px; }
.tpl-premium .p-sup { display: flex; align-items: center; gap: 9px; min-width: 0; }
.tpl-premium .p-sup small { display: block; font-size: 9.5px; letter-spacing: 1.1px; text-transform: uppercase; color: var(--muted); font-weight: 600; line-height: 1.3; }
.tpl-premium .p-sup b { display: block; font-size: 12px; color: var(--navy); font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.tpl-premium .p-icard.qr { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: var(--soft); padding: 12px 10px; }
.tpl-premium .p-qr { width: 84px; height: 84px; display: block; border-radius: 6px; border: 1px solid var(--hair); background: #fff; }
.tpl-premium .p-icard.qr b { margin-top: 7px; font-family: Poppins, Arial, sans-serif; font-size: 12px; font-weight: 600; color: var(--navy); }
.tpl-premium .p-icard.qr small { font-size: 10px; color: var(--muted); overflow-wrap: anywhere; }

/* tighter spacing, used only when it lets the page-1 info row stay on page 1 (see renderPages) */
.tpl-premium.fit-tight .p-intro { margin-bottom: 6px; }
.tpl-premium.fit-tight .p-card { padding: 9px 18px 10px; }
.tpl-premium.fit-tight .p-company { margin-bottom: 3px; }
.tpl-premium.fit-tight .p-kv { row-gap: 5px; }
.tpl-premium.fit-tight .p-items { margin-top: 10px; }
.tpl-premium.fit-tight .p-items th { padding: 8px 16px; }
.tpl-premium.fit-tight .p-items td { padding: 7px 16px; }
.tpl-premium.fit-tight .p-sum { margin-top: 10px; }
.tpl-premium.fit-tight .p-words { padding: 9px 16px; }
.tpl-premium.fit-tight .p-tr { padding: 3px 4px; }
.tpl-premium.fit-tight .p-grand, .tpl-premium.fit-tight .p-balance { padding: 8px 16px; margin-top: 6px; }
.tpl-premium.fit-tight .p-sec { margin: 9px 0 6px; }
.tpl-premium.fit-tight .p-hw.titled { gap: 5px 26px; }
.tpl-premium.fit-tight .p-info { margin-top: 10px; gap: 10px; }
.tpl-premium.fit-tight .p-icard { padding: 9px 14px 10px; }
.tpl-premium.fit-tight .p-ihead { margin-bottom: 6px; }
.tpl-premium.fit-tight .p-kv2 { row-gap: 2px; }
.page.fit-tight .info { margin-top: 8px; }
.page.fit-tight .info td { padding: 4px 10px; line-height: 1.3; }
.page.fit-tight .sec-h { margin: 11px 0 6px; }
.page.fit-tight .cust td, .page.fit-tight .items th, .page.fit-tight .items td { padding-top: 3px; padding-bottom: 3px; }

/* classic: versions row + comparison list */
.page .ver.eds td { width: auto; padding: 7px 6px; font-size: 12.5px; text-align: center; white-space: nowrap; }
.page .ver.eds td.prod { text-align: left; font-weight: 700; font-size: 13.5px; padding-left: 9px; }
.page .ver.eds td.on { background: #fff1e6; font-weight: 700; }
.page .comp-title { font-size: 20px; margin: 2px 0 2px; }
.page .comp-sub { margin: 0 0 10px; font-size: 12.5px; color: #444; }
.page .comp { table-layout: fixed; margin-bottom: 10px; font-size: 11.5px; }
.page .comp th, .page .comp td { border: 1px solid #9aa0aa; padding: 2px 4px; text-align: center; line-height: 1.25; }
.page .comp th { background: #eef0f3; font-size: 10px; text-transform: uppercase; word-break: break-word; }
.page .comp .f { text-align: left; width: 36%; }
.page .comp th.f { font-size: 12.5px; text-transform: none; }
.page .comp .n { display: inline-block; width: 20px; color: #666; }
.page .comp .ok { color: #1f7a42; font-weight: 700; }
.page .comp .no { color: #d43c3c; font-weight: 700; }
.page .comp .add { background: #dcdfe4; font-weight: 700; }
.page .comp .na { color: #aaa; }
.page .comp .on { background: #fff1e6; }
.page .comp th.on { background: var(--accent); color: #fff; }

/* premium: software version strip */
.tpl-premium .p-editions { margin-top: 12px; }
.tpl-premium .p-editions .p-label { margin-bottom: 6px; }
.tpl-premium .p-editions .p-label em { font-style: normal; color: var(--muted); letter-spacing: 1px; }
.tpl-premium .p-chips { display: grid; gap: 6px; }
.tpl-premium .p-chip {
  display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 0;
  border: 1px solid var(--hair); border-radius: 8px; padding: 6px 4px; background: #fff;
  font-size: 10px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: #6B7385; white-space: nowrap; overflow: hidden;
}
.tpl-premium .p-chip i { flex: none; width: 12px; height: 12px; border: 1.3px solid #B5BCC9; border-radius: 3px; font-style: normal; font-size: 9px; line-height: 10px; text-align: center; }
.tpl-premium .p-chip.on { background: linear-gradient(135deg, #F7A03C, #E4641C); border-color: #E4641C; color: #fff; }
.tpl-premium .p-chip.on i { border-color: #fff; background: #fff; color: #E4641C; font-weight: 700; }
.tpl-premium.fit-tight .p-editions { margin-top: 8px; }
.tpl-premium.fit-tight .p-chip { padding: 5px 4px; }

/* premium: comparison list */
.tpl-premium .p-comp-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 12px; }
.tpl-premium .p-comp-head h2 { margin: 2px 0 2px; font-family: Poppins, Arial, sans-serif; font-size: 20px; color: var(--navy); }
.tpl-premium .p-comp-head p { margin: 0; color: var(--muted); font-size: 11.5px; }
.tpl-premium .p-comp-head p b { color: var(--navy); }
.tpl-premium .p-comp-legend { display: flex; gap: 12px; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.tpl-premium .p-comp-legend b { display: inline-block; width: 16px; text-align: center; }
.tpl-premium .p-comp { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; margin-bottom: 10px; border: 1px solid var(--hair); border-radius: 10px; overflow: hidden; font-size: 10.5px; }
.tpl-premium .p-comp th, .tpl-premium .p-comp td { padding: 3px 4px; text-align: center; border-top: 1px solid #EEF1F6; line-height: 1.3; }
.tpl-premium .p-comp .f { width: 35%; text-align: left; padding-left: 10px; color: var(--ink); }
.tpl-premium .p-comp tr.gh th { background: var(--navy); color: #fff; border-top: 0; font-size: 8.5px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; padding: 6px 3px; word-break: break-word; }
.tpl-premium .p-comp tr.gh th.f { font-family: Poppins, Arial, sans-serif; font-size: 11px; letter-spacing: .3px; text-transform: none; padding-left: 10px; }
.tpl-premium .p-comp tr.gh th.f em { font-style: normal; font-weight: 400; opacity: .7; }
.tpl-premium .p-comp tr.gh th.on { background: linear-gradient(135deg, #F7A03C, #E4641C); }
.tpl-premium .p-comp tr:nth-child(odd) td { background: #FAFBFD; }
.tpl-premium .p-comp .n { display: inline-block; width: 20px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tpl-premium .p-comp .ok { color: #1F8449; font-weight: 700; font-size: 12px; }
.tpl-premium .p-comp .no { color: #D14343; font-size: 11px; }
.tpl-premium .p-comp .add { color: #5B6478; font-weight: 700; }
.tpl-premium .p-comp td.add { background: #EEF0F4 !important; }
.tpl-premium .p-comp .na { color: #C2C8D2; }
.tpl-premium .p-comp .txt { font-weight: 600; color: var(--navy); font-size: 9.5px; }
.tpl-premium .p-comp td.on { background: #FFF3E8 !important; }
.tpl-premium .p-comp-legend .ok { color: #1F8449; } .tpl-premium .p-comp-legend .no { color: #D14343; } .tpl-premium .p-comp-legend .add { color: #5B6478; }

/* comparison & version strip: never split a version name mid-word; fit the list on fewer pages */
.tpl-premium .p-chips { gap: 5px; }
.tpl-premium .p-chip { font-size: 9px; letter-spacing: .2px; gap: 4px; padding: 6px 3px; text-overflow: ellipsis; }
.tpl-premium .p-chip i { width: 11px; height: 11px; line-height: 9px; font-size: 8.5px; }
.tpl-premium .p-comp { font-size: 10px; margin-bottom: 8px; }
.tpl-premium .p-comp .f { width: 38%; }
.tpl-premium .p-comp th, .tpl-premium .p-comp td { padding: 2px 2px; line-height: 1.22; }
.tpl-premium .p-comp td.f { padding-left: 10px; }
.tpl-premium .p-comp tr.gh th { font-size: 7.6px; letter-spacing: .15px; padding: 6px 1px; word-break: keep-all; overflow-wrap: normal; hyphens: none; }
.tpl-premium .p-comp tr.gh th.f { font-size: 10.5px; padding-left: 10px; }
.tpl-premium .p-comp .ok { font-size: 11px; }
.tpl-premium .p-comp .no { font-size: 10px; }
.tpl-premium .p-comp .txt { font-size: 9px; }
.tpl-premium .p-comp-head { margin-bottom: 10px; }
.tpl-premium .p-comp-head p { max-width: 330px; }
.page .comp th { font-size: 8.5px; word-break: keep-all; overflow-wrap: normal; padding: 3px 1px; }
.page .comp .f { width: 38%; }
.page .comp { font-size: 11px; }
.page .comp th, .page .comp td { line-height: 1.2; }

/* comparison chunks of one group join into one table on the page */
.tpl-premium .p-comp.open { margin-bottom: 0; border-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.tpl-premium .p-comp.join { border-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
.tpl-premium .p-comp.join tr:first-child td { border-top: 1px solid #EEF1F6; }
.page .comp.open { margin-bottom: 0; }
.page .comp.join { margin-top: -1px; }
.tpl-premium .p-chip { font-size: 8.5px; letter-spacing: 0; }

.page .ver.eds.one { margin-top: 14px; }
.page .ver.eds.one td { padding: 5px 4px; font-size: 11.5px; }
.page .ver.eds.one td.prod { font-weight: 400; font-size: 11.5px; line-height: 1.25; white-space: normal; }
.page.fit-tight .ver.eds.one { margin-top: 9px; }
.page.fit-tight .intro { margin: 4px 0 7px; }
.page.fit-tight .d-title { margin-bottom: 6px; }
.page.fit-tight .bl { margin-bottom: 1px; }
.page.fit-tight .prep { margin-top: 12px; }
.tpl-premium .p-chip { padding: 6px 2px; gap: 3px; }
.page .comp { font-size: 10.5px; }
.page .comp th, .page .comp td { padding-top: 1px; padding-bottom: 1px; line-height: 1.18; }
.page .comp th { padding: 2px 1px; }
.page .comp-sub { margin-bottom: 8px; }

/* version strip: boxes size to their name (no clipping); wrap to a second row only when needed */
.tpl-premium .p-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.tpl-premium .p-chip {
  flex: 1 1 auto; min-width: max-content; overflow: visible; text-overflow: clip;
  padding: 6px 9px; gap: 5px; font-size: 9px; letter-spacing: .3px; line-height: 1;
}
.tpl-premium .p-chip i { width: 11px; height: 11px; line-height: 9px; }
