#avatar-editor { background: #14263a; color: #e7effa; border: 1px solid #48617b; border-radius: .9rem; padding: 1rem; width: min(24rem, calc(100vw - 2.5rem)); max-height: 92dvh; overflow: auto; }
#avatar-editor::backdrop { background: rgb(0 0 0 / .72); }
#avatar-editor h2 { margin: 0 0 .4rem; }
#avatar-editor p { margin: .45rem 0; }
#avatar-editor canvas { width: min(100%, 15rem, 42vh); height: auto; display: block; margin: .8rem auto; cursor: grab; touch-action: none; border-radius: .35rem; outline: 1px solid #829bbb; }
#avatar-editor canvas:active { cursor: grabbing; }
#avatar-editor canvas:focus-visible { outline: 3px solid #8bbcff; }
#avatar-editor input { width: 100%; }
#avatar-editor footer { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .75rem; }
#avatar-editor [data-apply] { background: #20599b; color: white; }
#employee-profiles .profile-field-error { display: block; color: #ffaaa8; margin: .3rem 0 .6rem; }
#employee-profiles [aria-invalid="true"], #employee-profiles .avatar-frame:has([aria-invalid="true"]) { border-color: #ffaaa8; }
#employee-profiles .residence-address { grid-column: 1 / -1; }
.profile-print-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin: .85rem 0; }
.profile-summary dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: .85rem 1rem; }
.profile-summary .id-photo-pair > div { display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 0; }
.profile-summary dt { font-size: .875rem; }
.profile-summary dd { margin: .25rem 0 0; font-weight: 600; overflow-wrap: anywhere; }
.profile-summary img { max-width: 100%; max-height: 12rem; border-radius: .5rem; }
#profile-paper { display:none; }
@page profile-sheet { size: A4 portrait; margin: 13mm 15mm 12mm; }
@media print {
  html:has(body.printing-employee-profile), body.printing-employee-profile { color-scheme: light; background: white !important; color: #17293a; }
  body.printing-employee-profile { margin: 0; padding: 0; max-width: none; min-height: 0; }
  body.printing-employee-profile > :not(#profile-paper) { display: none !important; }
  body.printing-employee-profile #profile-paper { display: block; page: profile-sheet; font: 10pt/1.26 Arial, "DejaVu Sans", sans-serif; color: #162b3c; }
  #profile-paper .letterhead { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1.1mm solid #233b4d; padding-bottom: 2.7mm; }
  #profile-paper { position: relative; isolation: isolate; }
  #profile-paper .paper-brand { display: block; width: 32mm; height: auto; }
  #profile-paper .letterhead { align-items: center; }
  #profile-paper .paper-watermark { position: absolute; top: 50%; left: 50%; width: 73%; height: auto; transform: translate(-50%, -50%); opacity: .075; z-index: -1; pointer-events: none; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .letterhead span { font-size: 9pt; }
  #profile-paper h1 { font: bold 21pt/1.16 Arial, sans-serif; margin: 6mm 0 4mm; }
  .paper-person { display: grid; grid-template-columns: minmax(0,1fr) 30mm; gap: 8mm; }
  #paper-photo { width: 30mm; height: 40mm; margin: 0; border: .25mm solid #88959c; display: grid; place-items: center; align-self: center; }
  #paper-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
  #paper-photo span { font-size: 9pt; color: #4a5d69; }
  #profile-paper h2 { font: bold 11pt/1.3 Arial, sans-serif; border-bottom: .45mm solid #506979; padding-bottom: 1.2mm; margin: 4.2mm 0 0; break-after: avoid; }
  .paper-person h2 { margin-top: 0 !important; }
  .paper-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 0 6mm; }
  .paper-field { min-width: 0; padding-top: 1.8mm; break-inside: avoid; }
  .paper-field.wide { grid-column: 1/-1; }
  .paper-label { display:block; font-size: 8.5pt; color: #364d5a; }
  .paper-value { display:block; min-height: 5.8mm; padding: .45mm 0 .65mm; border-bottom: .2mm dotted #8997a0; font-weight: 550; overflow-wrap:anywhere; white-space:pre-wrap; }
  .paper-sign { margin-top: 5mm; break-inside: avoid; }
  .paper-date { text-align: right; font-size: 9.5pt; margin-bottom: 3mm; }
  .paper-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 16mm; text-align: center; }
  .paper-signatures strong,.paper-signatures em { display:block; }
  .paper-signatures em { font-size: 8.5pt; font-weight: normal; margin-top: 1mm; }
  .paper-signatures > div { min-height: 23mm; }
  .signer-details { margin-top: 12mm; overflow-wrap: anywhere; }
  .signer-details span { display: block; min-height: 4.5mm; }
  .signer-details span:first-child { font-weight: 700; }
  .signer-details span:empty::before { content: attr(data-placeholder); font-weight: 400; color: #465964; }
}
