@font-face {
  font-family: "Gmarket Sans TTF Medium";
  src: url("GmarketSansTTFMedium.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

#leaveRequestModal {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

#leaveRequestModal[hidden] {
  display: none;
}

#leaveRequestModal .leave-request-modal {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
  align-items: stretch;
  gap: 24px;
  width: min(1600px, 100%);
  height: min(1200px, calc(100dvh - 16px));
  max-height: min(1200px, calc(100dvh - 16px));
  min-height: 0;
  overflow: hidden;
  padding: 16px 20px;
}

.leave-request-editor {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 4px;
}

.leave-request-head {
  flex: 0 0 auto;
}

.leave-request-head .eyebrow {
  margin: 0 0 3px;
}

.leave-request-head h2 {
  margin: 0;
}

.leave-request-meta {
  margin: 4px 0 0;
  color: #526173;
  font-size: 13px;
}

.leave-request-print-status {
  min-height: 1em;
  margin: 3px 0 0;
  color: #667085;
  font-size: 12px;
}

.leave-request-form {
  align-content: start;
  gap: 14px 16px;
  flex: 1 0 auto;
  margin: 20px 0 0;
}

.leave-request-form .leave-field input {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
}

.leave-request-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
}

.leave-request-preview-title {
  flex: 0 0 auto;
  margin: 0;
  color: #526173;
  font-size: 15px;
}

.leave-request-preview-viewport {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 12px;
  background: #e8eef6;
}

.leave-request-preview-frame {
  box-sizing: border-box;
  display: block;
  flex: 0 0 auto;
  width: 210mm;
  height: 297mm;
  border: 0;
  background: #fff;
}

.leave-request-actions {
  flex: 0 0 auto;
  justify-content: flex-start;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
}

.leave-request-actions button {
  min-width: 96px;
  min-height: 48px;
}

.leave-request-print-document,
.leave-request-print-document * {
  box-sizing: border-box;
}

.leave-request-print-document {
  margin: 0;
  padding: 0;
  color: #111;
  background: #e8eef6;
  font-family: "Gmarket Sans TTF Medium", "G마켓 산스 TTF Medium", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  font-size: 12pt;
  font-weight: 500;
  line-height: 1.4;
}

.leave-request-sheet {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 210mm;
  height: 297mm;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 3px 14px rgb(15 23 42 / 18%);
}

.leave-request-form-sheet {
  display: flex;
  flex-direction: column;
  flex: 0 0 237mm;
  width: 190mm;
  height: 237mm;
  margin: auto;
  padding: 10mm 13.3mm 6mm;
  border: .8mm double #111;
  background: #fff;
}

.leave-request-print-title {
  display: grid;
  flex: 0 0 15mm;
  place-items: center;
  margin: 0;
  color: #111;
  font-size: 24pt;
  font-weight: 500;
  letter-spacing: .12em;
  line-height: 1.25;
  text-align: center;
  white-space: pre;
}

.leave-request-approvals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex: 0 0 25.5mm;
  gap: 0;
  width: 54.5mm;
  margin: 10mm 0 5.6mm auto;
  border: .3mm solid #111;
}

.leave-request-approval-box {
  display: grid;
  grid-template-rows: 8mm minmax(0, 1fr);
  min-width: 0;
  text-align: center;
}

.leave-request-approval-box + .leave-request-approval-box {
  border-left: .3mm solid #111;
}

.leave-request-approval-title {
  display: grid;
  place-items: center;
  border-bottom: .3mm solid #111;
  font-size: 12pt;
  font-weight: 500;
  white-space: pre;
}

.leave-request-print-table {
  flex: 0 0 54.5mm;
  width: 100%;
  margin: 0;
  table-layout: fixed;
  border-collapse: collapse;
  color: #111;
}

.leave-request-print-table col:first-child {
  width: 8.3%;
}

.leave-request-print-table col:nth-child(2) {
  width: 16.7%;
}

.leave-request-print-table col:nth-child(3) {
  width: 75%;
}

.leave-request-print-table tr {
  height: 10.9mm;
}

.leave-request-print-table th,
.leave-request-print-table td {
  border: .3mm solid #111;
  padding: 2mm 3mm;
  line-height: 1.25;
}

.leave-request-print-table th {
  font-size: 14pt;
  font-weight: 500;
  text-align: center;
  white-space: pre;
}

.leave-request-print-table .leave-request-vertical-label {
  padding: 0;
  line-height: 1.25;
  white-space: pre-line;
}

.leave-request-print-table td {
  font-size: 12pt;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.leave-request-statement,
.leave-request-application-date,
.leave-request-applicant-line {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  margin: 0;
  text-align: center;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.leave-request-statement {
  min-height: 10mm;
  margin-top: 10.3mm;
  font-size: 14pt;
}

.leave-request-application-date {
  min-height: 10mm;
  margin-top: 2.1mm;
  font-size: 14pt;
}

.leave-request-applicant-line {
  width: 100%;
  min-height: 10mm;
  margin: 2.4mm 0 0;
  padding-right: 25mm;
  justify-items: end;
  font-size: 14pt;
  font-weight: 500;
  text-align: right;
}

.leave-request-company-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 53mm;
  margin-top: auto;
  text-align: center;
}

.leave-request-company-logo {
  display: block;
  flex: 0 0 20mm;
  width: 43mm;
  height: 20mm;
  object-fit: contain;
}

.leave-request-company-address,
.leave-request-recipient {
  margin: 0;
  line-height: 1.4;
  white-space: pre-wrap;
}

.leave-request-company-address {
  flex: 0 0 6mm;
  margin-top: 3mm;
  font-size: 12pt;
}

.leave-request-recipient {
  flex: 0 0 17mm;
  margin-top: 7mm;
  font-size: 16pt;
  font-weight: 500;
}

@media (max-width: 900px) {
  #leaveRequestModal {
    align-items: flex-start;
    padding: 12px;
  }

  #leaveRequestModal .leave-request-modal {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
    width: 100%;
    height: calc(100dvh - 24px);
    max-height: calc(100dvh - 24px);
    padding: 12px;
  }

  .leave-request-editor {
    max-height: 46dvh;
    overflow-y: auto;
    padding-bottom: 4px;
  }

  .leave-request-head .eyebrow,
  .leave-request-head h2 {
    display: none;
  }

  .leave-request-meta {
    font-size: 12px;
  }

  .leave-request-print-status {
    min-height: 0;
    margin-top: 0;
  }

  .leave-request-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
  }

  .leave-request-form .leave-field input {
    min-height: 42px;
  }

  .leave-request-preview {
    min-height: 0;
  }

  .leave-request-preview-viewport {
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 8px;
  }

  .leave-request-actions {
    position: sticky;
    bottom: 0;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    background: #fff;
    z-index: 1;
  }

  .leave-request-actions button {
    min-width: 88px;
    min-height: 48px;
  }

  .leave-request-applicant-line {
    width: 100%;
    padding-right: 25mm;
  }
}

@media print {
  .leave-request-print-document {
    margin: 0;
    padding: 0;
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .leave-request-sheet {
    width: 210mm;
    height: 297mm;
    margin: 0;
    zoom: 1 !important;
    box-shadow: none;
    break-inside: avoid;
    break-after: avoid;
    page-break-after: avoid;
  }
}
