@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700;800&family=Noto+Serif+KR:wght@500;700;900&display=swap");

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef2f1;
  --ink: #18191c;
  --muted: #626771;
  --line: #d8dde4;
  --line-strong: #9da5b1;
  --primary: #165d48;
  --primary-strong: #0e4635;
  --accent: #8d2732;
  --accent-soft: #f7e9eb;
  --gold: #a06b12;
  --focus: rgba(22, 93, 72, 0.2);
  --shadow: 0 16px 45px rgba(24, 25, 28, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  letter-spacing: 0;
  background: linear-gradient(180deg, #f7f8fa 0%, #eef1f4 100%);
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  border: 0;
}

a {
  color: inherit;
}

.app-loading {
  display: grid;
  min-height: 100vh;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: var(--muted);
}

.loader-mark {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 999px;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.app-shell {
  width: min(1480px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 0 2px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  font-weight: 800;
  background: var(--primary);
  border-radius: 7px;
  box-shadow: 0 10px 24px rgba(22, 93, 72, 0.25);
}

.brand h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.user-chip {
  display: inline-flex;
  min-height: 42px;
  max-width: 240px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  color: #30343a;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
}

.user-chip span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-avatar {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 999px;
  object-fit: cover;
  background: var(--surface-2);
}

.user-avatar.text {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--primary);
  font-size: 12px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(360px, 460px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.workspace {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.dashboard,
.auth-page {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.login-panel {
  width: 100%;
  max-width: 520px;
  justify-self: center;
  margin: 12vh auto 0;
}

.panel {
  min-width: 0;
  max-width: 100%;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel.login-panel {
  max-width: 520px;
}

.panel.flat {
  box-shadow: none;
}

.panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.panel-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.panel-subtitle {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field.two {
  grid-template-columns: 1fr 1fr;
}

.field.inline {
  grid-template-columns: 1fr auto;
  align-items: end;
}

.slider-field output {
  display: inline-flex;
  min-width: 58px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  color: var(--primary-strong);
  background: #eef6f3;
  border: 1px solid #c7ddd5;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 800;
}

label {
  color: #32363d;
  font-size: 13px;
  font-weight: 700;
}

.optional {
  color: var(--muted);
  font-weight: 500;
}

input,
textarea {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input {
  height: 42px;
  padding: 0 12px;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--primary);
}

textarea {
  min-height: 126px;
  padding: 11px 12px;
  line-height: 1.65;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--focus);
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.divider {
  height: 1px;
  margin: 4px 0;
  background: var(--line);
}

.btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 0.12s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.btn:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn.primary {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.btn.primary:hover {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
}

.btn.accent {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.btn.ghost {
  background: transparent;
}

.btn.icon {
  width: 42px;
  padding: 0;
}

.btn:disabled {
  color: #9aa1aa;
  background: #eef0f3;
  border-color: #e0e4e9;
  cursor: not-allowed;
  transform: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions.stretch .btn {
  flex: 1 1 180px;
}

.download-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  color: var(--primary-strong);
  background: #e8f1ee;
  border: 1px solid #c7ddd5;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  max-width: 100%;
}

.status-pill.waiting {
  color: #755006;
  background: #fff3d7;
  border-color: #ecd49b;
}

.status-pill.signed {
  color: #7b1d28;
  background: var(--accent-soft);
  border-color: #e6c3c8;
}

.notice {
  display: flex;
  gap: 10px;
  padding: 12px;
  color: #2c3137;
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 13px;
  line-height: 1.55;
}

.notice > div {
  min-width: 0;
}

.notice svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--primary);
}

.notice.warn {
  background: #fff8e7;
  border-color: #ead79f;
}

.notice.error {
  background: #fff0f1;
  border-color: #e2b8be;
}

.link-box {
  display: grid;
  gap: 8px;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.copy-row input {
  color: #313840;
  background: #f8fafb;
  font-size: 12px;
}

.recent-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.document-list {
  display: grid;
  gap: 8px;
}

.document-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px;
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.document-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.document-link {
  color: inherit;
  text-decoration: none;
}

.document-link:hover strong {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.document-main strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-main span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.recent-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.recent-item strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-item span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.preview-wrap {
  position: sticky;
  top: 18px;
  min-width: 0;
}

.paper-stage {
  display: grid;
  place-items: start center;
  overflow: auto;
  max-height: calc(100vh - 112px);
  padding: 18px;
  background: #dfe4ea;
  border: 1px solid #cbd2dc;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.pdf-target {
  display: grid;
  width: 100%;
  justify-items: center;
  gap: 18px;
}

.paper {
  width: min(100%, 794px);
  min-height: 1122px;
  padding: 56px 62px 42px;
  color: #111;
  background: #fff;
  border: 1px solid #cfd3d8;
  box-shadow: 0 18px 45px rgba(20, 24, 30, 0.18);
  font-family: "Noto Serif KR", Batang, "Times New Roman", serif;
  break-after: auto;
  page-break-after: auto;
}

.certificate-paper {
  display: flex;
  flex-direction: column;
}

.paper + .paper {
  margin-top: 0;
  break-before: page;
  page-break-before: always;
}

.audit-paper {
  break-before: page;
  page-break-before: always;
}

.paper:last-child {
  break-after: auto;
  page-break-after: auto;
}

.doc-topline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #4d535d;
  font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 12px;
}

.doc-title {
  margin: 48px 0 36px;
  text-align: center;
  font-size: clamp(30px, 5vw, 42px);
  font-weight: 900;
  line-height: 1.25;
}

.doc-title span {
  display: inline-block;
  padding: 0 8px 10px;
  border-bottom: 2px solid #111;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.65;
}

.doc-table th,
.doc-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #b7bcc5;
  vertical-align: top;
}

.doc-table tr:first-child th,
.doc-table tr:first-child td {
  border-top: 2px solid #111;
}

.doc-table tr:last-child th,
.doc-table tr:last-child td {
  border-bottom: 2px solid #111;
}

.doc-table th {
  width: 130px;
  text-align: center;
  font-weight: 800;
  background: #f3f5f7;
}

.doc-body {
  margin: 30px auto 0;
  max-width: 580px;
  font-size: 18px;
  line-height: 1.9;
  text-align: center;
  word-break: keep-all;
}

.doc-flex-spacer {
  flex: 1 1 56px;
  min-height: 22px;
  max-height: 86px;
}

.doc-date {
  margin: 0;
  text-align: center;
  font-size: 19px;
  font-weight: 800;
}

.sign-block {
  display: grid;
  justify-content: end;
  margin-top: 20px;
}

.sign-inner {
  position: relative;
  min-width: min(100%, 420px);
  padding: 22px 24px;
  border: 1px solid #aeb4bd;
  background: #fff;
}

.sign-line {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 8px;
  min-height: 34px;
  align-items: center;
  font-size: 16px;
}

.sign-line b {
  font-weight: 900;
}

.signature-image {
  width: 180px;
  max-width: 100%;
  height: 70px;
  object-fit: contain;
  vertical-align: middle;
  border-bottom: 1px solid #555;
}

.stamp {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  color: var(--accent);
  border: 3px solid var(--accent);
  border-radius: 999px;
  font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  transform: rotate(-8deg);
  opacity: 0.86;
}

.closing-block {
  display: grid;
  gap: 18px;
  justify-items: center;
}

.doc-institution {
  max-width: 100%;
  text-align: center;
  font-size: 31px;
  font-weight: 900;
  line-height: 1.35;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.closing-block.long-institution {
  gap: 15px;
}

.institution-seal-row {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  gap: var(--seal-gap, 24px);
  flex-wrap: wrap;
}

.institution-seal-row .doc-institution {
  flex: 0 1 auto;
}

.seal-beside-institution .seal-area {
  width: var(--seal-box-width, 88px);
  min-height: 64px;
  flex-basis: var(--seal-box-width, 88px);
}

.approval-block {
  display: flex;
  width: 100%;
  justify-content: flex-end;
  min-width: 0;
}

.closing-block.long-institution .approval-block {
  justify-self: end;
}

.approval-line {
  display: inline-flex;
  min-width: min(100%, 310px);
  min-height: 60px;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  padding: 0 4px;
  border-bottom: 1px solid #999;
  font-size: 20px;
  font-weight: 800;
}

.approval-role-name {
  max-width: 250px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  line-height: 1.35;
  text-align: right;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.seal-area {
  position: relative;
  display: grid;
  width: 108px;
  min-height: 60px;
  place-items: center;
  flex: 0 0 108px;
}

.seal-placeholder {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #8d939d;
  font-family: "Noto Serif KR", Batang, serif;
  font-weight: 700;
}

.approval-signature {
  position: absolute;
  top: 50%;
  left: 50%;
  width: auto;
  height: auto;
  max-width: 136px;
  max-height: 76px;
  object-fit: contain;
  opacity: 0.92;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  transform: translate(-50%, -50%);
}

.verification-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 30px 0 20px;
  border: 1px solid #c5cad2;
  font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
}

.verification-strip div {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-right: 1px solid #c5cad2;
}

.verification-strip div:last-child {
  border-right: 0;
}

.verification-strip b {
  color: #4c535d;
  font-size: 11px;
}

.verification-strip span {
  font-size: 12px;
  font-weight: 700;
}

.doc-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
  color: #5a6069;
  border-top: 1px solid #c9cdd4;
  font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 11px;
}

.audit-title {
  margin: 0;
  font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 22px;
  font-weight: 800;
}

.audit-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 14px;
  font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
}

.audit-page-head span {
  color: #5a6069;
  font-size: 12px;
  font-weight: 800;
}

.audit-continuation {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  padding: 7px 10px;
  color: #555d68;
  background: #f5f6f8;
  border: 1px solid #d3d8df;
  font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 11px;
  font-weight: 800;
}

.audit-summary-table {
  margin-bottom: 12px;
}

.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 12px;
  line-height: 1.36;
}

.audit-table th,
.audit-table td {
  padding: 7px 7px;
  border: 1px solid #c6ccd4;
  vertical-align: top;
  break-inside: avoid;
  page-break-inside: avoid;
}

.audit-table th {
  background: #eef1f4;
  font-weight: 800;
  text-align: left;
}

.audit-table code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 10.5px;
  line-height: 1.32;
  word-break: break-all;
}

.audit-events-table th:nth-child(1),
.audit-events-table td:nth-child(1) {
  width: 118px;
  white-space: nowrap;
}

.audit-events-table th:nth-child(2),
.audit-events-table td:nth-child(2) {
  width: 156px;
  white-space: nowrap;
}

.audit-events-table th:nth-child(3),
.audit-events-table td:nth-child(3) {
  width: 38%;
}

.signer-page {
  display: grid;
  grid-template-columns: minmax(320px, 480px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.signature-pad {
  overflow: hidden;
  height: 180px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  overscroll-behavior: contain;
  user-select: none;
  -webkit-user-select: none;
}

.signature-pad canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.signature-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.checkbox-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  color: #30343a;
  font-size: 13px;
  line-height: 1.55;
}

.checkbox-line input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--primary);
}

.empty-state {
  display: grid;
  min-height: 320px;
  place-items: center;
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.empty-state.compact {
  min-height: 180px;
}

.empty-state svg {
  width: 42px;
  height: 42px;
  margin-bottom: 12px;
  color: var(--line-strong);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  color: #fff;
  background: #23272e;
  border-radius: 7px;
  box-shadow: 0 15px 38px rgba(0, 0, 0, 0.22);
  font-size: 13px;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

.pdf-capture .paper {
  width: 794px !important;
  height: 1122px !important;
  min-height: 1122px !important;
  overflow: hidden !important;
  border: 0 !important;
  box-shadow: none !important;
}

@media (min-width: 1081px) {
  .app-shell {
    display: flex;
    height: 100vh;
    flex-direction: column;
    overflow: hidden;
  }

  .topbar {
    flex: 0 0 auto;
  }

  .layout,
  .signer-page,
  .dashboard,
  .auth-page {
    flex: 1 1 auto;
    min-height: 0;
  }

  .layout,
  .signer-page {
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
    overflow: hidden;
  }

  .workspace,
  .dashboard,
  .auth-page {
    min-height: 0;
    max-height: 100%;
    overflow: auto;
    scrollbar-gutter: stable;
  }

  .workspace {
    padding: 0 4px 18px 0;
  }

  .preview-wrap {
    position: static;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    padding-bottom: 18px;
  }

  .paper-stage {
    height: 100%;
    min-height: 100%;
    max-height: none;
    overflow: auto;
  }
}

@media (max-width: 1080px) {
  .layout,
  .signer-page {
    grid-template-columns: 1fr;
  }

  .preview-wrap {
    position: static;
  }

  .paper-stage {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar {
    width: 100%;
    justify-content: flex-start;
  }

  .user-chip {
    max-width: 100%;
  }

  .panel {
    padding: 14px;
  }

  .login-panel {
    width: calc(100vw - 48px);
    max-width: none;
    margin-right: 0;
    margin-left: 0;
  }

  .panel.login-panel {
    max-width: none;
  }

  .panel-header {
    display: grid;
    grid-template-columns: 1fr;
  }

  .status-pill {
    justify-self: start;
  }

  .field.two,
  .field.inline,
  .copy-row,
  .recent-item,
  .document-row,
  .download-group {
    grid-template-columns: 1fr;
  }

  .document-actions {
    justify-content: flex-start;
  }

  .paper-stage {
    padding: 8px;
  }

  .paper {
    min-height: auto;
    padding: 36px 24px 32px;
  }

  .doc-topline,
  .doc-footer {
    flex-direction: column;
  }

  .doc-title {
    margin: 36px 0 32px;
  }

  .doc-table {
    font-size: 14px;
  }

  .doc-table th,
  .doc-table td {
    display: block;
    width: 100%;
    padding: 10px 12px;
    text-align: left;
  }

  .doc-body {
    max-width: none;
    font-size: 17px;
    text-align: left;
  }

  .sign-inner {
    min-width: 0;
  }

  .sign-line {
    grid-template-columns: 84px minmax(0, 1fr);
    font-size: 14px;
  }

  .doc-institution {
    font-size: 25px;
  }

  .doc-flex-spacer {
    min-height: 18px;
    max-height: 42px;
  }

  .approval-block {
    width: 100%;
    justify-content: flex-end;
  }

  .approval-line {
    min-width: 210px;
    gap: 14px;
    font-size: 16px;
  }

  .institution-seal-row {
    gap: var(--seal-gap, 20px);
  }

  .seal-area {
    width: 92px;
    flex-basis: 92px;
  }

  .approval-signature {
    max-width: 126px;
    max-height: 68px;
  }

  .verification-strip {
    grid-template-columns: 1fr;
  }

  .verification-strip div {
    border-right: 0;
    border-bottom: 1px solid #c5cad2;
  }

  .verification-strip div:last-child {
    border-bottom: 0;
  }

  .stamp {
    width: 64px;
    height: 64px;
    font-size: 11px;
  }
}

@page {
  size: A4 portrait;
  margin: 0;
}

@media print {
  html,
  body {
    width: 210mm;
    min-height: 297mm;
    margin: 0;
    background: #fff;
    overflow: visible;
  }

  .topbar,
  .workspace,
  .panel:not(.print-panel),
  .toast {
    display: none !important;
  }

  .app-shell,
  .layout,
  .signer-page {
    display: block;
    width: auto;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  .preview-wrap,
  .paper-stage {
    display: block;
    height: auto;
    min-height: 0;
    overflow: visible;
    max-height: none;
    padding: 0;
    background: #fff;
    border: 0;
    box-shadow: none;
  }

  .pdf-target {
    display: block;
    width: auto;
  }

  .paper {
    width: 210mm;
    height: 297mm;
    min-height: 0;
    max-height: 297mm;
    overflow: hidden;
    padding: 14mm 17mm 10mm;
    border: 0;
    box-shadow: none;
    page-break-inside: avoid;
    break-inside: avoid;
    page-break-after: auto;
    break-after: auto;
  }

  .paper + .paper {
    page-break-before: always;
    break-before: page;
  }

  .paper:last-child {
    page-break-after: auto;
    break-after: auto;
  }
}
