:root {
  color-scheme: light;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: #172b48;
  background: #f3f6fa;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { min-width: 280px; }
a { color: #174ea6; text-underline-offset: 0.18em; }

.print-toolbar {
  padding: 22px 24px 18px;
  background: #fff;
  border-bottom: 1px solid #c4cedb;
}
.toolbar-inner, .print-status { width: min(100%, 1120px); margin-inline: auto; }
.toolbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.toolbar-heading h1 { margin: 0; font-size: clamp(20px, 3vw, 26px); letter-spacing: -0.04em; line-height: 1.4; }
.toolbar-heading p { margin: 4px 0 0; font-size: 14px; line-height: 1.6; color: #24364b; }
.toolbar-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.toolbar-actions > * {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid #8b9bb0;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  color: #172b48;
  background: #fff;
}
.toolbar-actions button { color: #fff; background: #174ea6; border-color: #174ea6; cursor: pointer; }
.toolbar-actions button:disabled { color: #5e6c7f; background: #e7ecf3; border-color: #c4cedb; cursor: wait; }
.toolbar-actions a:hover { background: #edf3fb; }
.toolbar-actions button:not(:disabled):hover { background: #123d82; }
.toolbar-actions > *:focus-visible { outline: 3px solid #12a7b3; outline-offset: 3px; }
.print-status { margin-top: 16px; font-size: 14px; line-height: 1.6; }
.print-status p { margin: 6px 0; }
.print-help { color: #24364b; font-size: 13px; }
.print-error { color: #9c2525; font-weight: 700; }
progress { width: min(100%, 320px); height: 8px; accent-color: #174ea6; }
progress[hidden] { display: none; }
.print-document { width: min(1120px, calc(100% - 32px)); margin: 28px auto 44px; }
.print-page {
  width: 100%;
  aspect-ratio: 297 / 210;
  margin: 0 0 22px;
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #c4cedb;
  box-shadow: 0 3px 12px rgb(23 43 72 / 7%);
}
.print-page img { display: block; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.print-fallback { display: none; }

@media (max-width: 640px) {
  .print-toolbar { padding: 18px 16px; }
  .toolbar-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions > * { flex: 1; padding-inline: 10px; }
  .print-document { width: calc(100% - 16px); margin-block: 16px 24px; }
  .print-page { margin-bottom: 12px; }
}

@page { size: A4 landscape; margin: 0; }

@media print {
  :root, html, body {
    width: 297mm;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    color: #000;
    background: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .print-toolbar { display: none !important; }
  .print-document { width: 297mm; max-width: none; margin: 0; padding: 0; }
  .print-page {
    display: block;
    width: 297mm;
    height: 210mm;
    aspect-ratio: auto;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    overflow: hidden;
    break-inside: avoid;
    break-after: page;
    page-break-inside: avoid;
    page-break-after: always;
  }
  .print-page:last-child { break-after: auto; page-break-after: auto; }
  .print-page img { display: block; width: 100%; height: 100%; object-fit: contain; }
  body:not([data-print-state="ready"]) .print-document { display: none; }
  body:not([data-print-state="ready"]) .print-fallback { display: block; padding: 20mm; }
}
