.kh { padding-bottom: 60px; }
.kh-intro { padding: 28px 0 8px; }
.kh-intro h1 { font-size: 32px; color: var(--pine-d); }
.kh-privacy { display: inline-block; background: var(--mint); color: var(--pine-d); border-radius: 10px; padding: 8px 14px; font-size: 14px; margin-top: 6px; }
.kh-layout { display: grid; grid-template-columns: 360px 1fr; gap: 20px; align-items: start; }
.kh-form { position: sticky; top: 76px; display: grid; gap: 12px; }
.kh-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 14px; display: grid; gap: 9px; }
.kh-lbl { font-size: 13px; font-weight: 600; color: var(--slate); }
.kh-card input, .kh-card textarea { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; width: 100%; }
.kh-card textarea { resize: vertical; line-height: 1.8; }
.kh-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.kh-tpls { display: flex; flex-wrap: wrap; gap: 6px; }
.kh-tpl { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 7px 13px; font: 500 13.5px var(--body); cursor: pointer; }
.kh-tpl.on { background: var(--pine); color: #fff; border-color: var(--pine); }
.kh-logo-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kh-sm { padding: 7px 12px; font-size: 13px; }
.kh-danger { color: #b42318; border-color: #e7b6b1; }
.kh-logo-prev { height: 34px; border: 1px solid var(--line); border-radius: 6px; }
.kh-exp { display: flex; flex-wrap: wrap; gap: 8px; }

/* ورقة A4 */
.kh-preview-wrap { display: flex; justify-content: center; }
.kh-paper { background: #fff; width: 210mm; min-height: 297mm; padding: 22mm 20mm; box-shadow: 0 10px 40px rgba(0,0,0,.14); border: 1px solid var(--line); font-family: "Amiri", "IBM Plex Sans Arabic", serif; color: #111; line-height: 1.9; }
.kh-head { display: grid; grid-template-columns: 1fr 2fr 1fr; align-items: center; text-align: center; gap: 10px; }
.kh-hlines b { display: block; font-size: 17px; font-weight: 700; }
.kh-hlines span { display: block; font-size: 14px; }
.kh-hlogo { width: 72px; height: 72px; object-fit: contain; justify-self: center; }
.kh-hlogo.kh-ph { border: 1px dashed #ccc; border-radius: 8px; }
.kh-rule { height: 2px; background: var(--pine); margin: 10px 0 14px; }
.kh-meta { display: flex; justify-content: space-between; font-size: 14px; color: #333; margin-bottom: 14px; }
.kh-title { text-align: center; font-size: 22px; font-weight: 700; margin: 6px 0 16px; color: var(--pine-d); }
.kh-to { font-weight: 700; margin: 0 0 12px; white-space: pre-wrap; }
.kh-body { font-size: 16.5px; white-space: pre-wrap; min-height: 120px; }
.kh-sign { margin-top: 46px; text-align: left; line-height: 2; }
.kh-sign .kh-sname { font-weight: 700; }
.kh-sign .kh-sline { color: #333; font-size: 14px; }

@media (max-width: 900px) {
  .kh-layout { grid-template-columns: 1fr; }
  .kh-form { position: static; }
  .kh-paper { width: 100%; min-height: auto; padding: 24px 18px; }
}
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .kh-layout { display: block; }
  .kh-paper { width: auto; min-height: auto; box-shadow: none; border: 0; padding: 0; margin: 0; }
  .kh-rule, .kh-title { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { size: A4; margin: 18mm; }
}
