:root {
  --red: #d90816;
  --red-dark: #ac0711;
  --red-soft: #fff0f1;
  --ink: #20242a;
  --muted: #68717d;
  --line: #dfe4ea;
  --line-dark: #cbd2da;
  --surface: #ffffff;
  --surface-soft: #f5f7f9;
  --surface-blue: #edf7fb;
  --green: #168353;
  --amber: #a96300;
  --shadow: 0 18px 50px rgba(24, 31, 40, .08);
  --radius: 18px;
  --doc-red: #cf0912;
  --doc-red-dark: #8c060b;
  --doc-graphite: #333b40;
  --doc-ink: #1f2429;
  --doc-muted: #646e75;
  --doc-line: #cfd4d9;
  --doc-soft: #f2f5f6;
  --document-font: Helvetica, Arial, sans-serif;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: #eef1f4;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: #eef1f4; color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(217, 8, 22, .28);
  outline-offset: 2px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 76px;
  padding: 12px clamp(18px, 3.5vw, 54px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand { display: flex; align-items: center; gap: 15px; }
.brand img { width: 122px; height: 46px; object-fit: contain; }
.brand-divider { width: 1px; height: 36px; background: var(--line-dark); }
.brand div { display: grid; gap: 2px; }
.brand strong { font-size: 15px; }
.brand div span { color: var(--muted); font-size: 12px; }
.environment-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 999px;
  background: #f1f4f6;
  color: #59616b;
  font-size: 12px;
  font-weight: 750;
}
.environment-pill span { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px #dff3e9; }

.shell { width: min(1540px, calc(100% - 40px)); margin: 30px auto 60px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-heading h1 { margin: 5px 0 6px; font-size: clamp(30px, 3vw, 44px); letter-spacing: -.035em; }
.page-heading p { margin: 0; max-width: 760px; color: var(--muted); line-height: 1.55; }
.eyebrow { color: var(--red); font-size: 10px; font-weight: 850; letter-spacing: .14em; }

.button {
  min-height: 45px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 800;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--red); box-shadow: 0 9px 24px rgba(217, 8, 22, .22); }
.button.primary:hover { background: var(--red-dark); }
.button.secondary { color: white; background: #2c3239; }
.button.ghost { color: var(--ink); background: white; border-color: var(--line-dark); }
.button:disabled { cursor: not-allowed; opacity: .48; transform: none; box-shadow: none; }

.steps {
  margin-bottom: 22px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 15px;
}
.step { flex: 0 1 260px; border: 0; background: transparent; display: flex; align-items: center; gap: 11px; padding: 4px; text-align: left; color: var(--muted); }
.step > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #edf0f3; color: #6b737d; font-weight: 850; }
.step div { display: grid; gap: 1px; }
.step b { color: #545c66; font-size: 14px; }
.step small { font-size: 11px; }
.step.active > span { background: var(--red); color: white; }
.step.active b { color: var(--ink); }
.step-line { width: clamp(30px, 10vw, 150px); height: 2px; margin: 0 18px; background: #e2e6ea; }

.template-section { padding: 22px; margin-bottom: 22px; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 7px 25px rgba(30, 37, 44, .04); }
.section-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.section-title-row h2 { margin: 5px 0 0; font-size: 21px; }
.template-count { padding: 7px 10px; border-radius: 999px; color: #59616b; background: #f1f3f5; font-size: 11px; font-weight: 750; }
.template-grid { display: grid; grid-template-columns: repeat(6, minmax(140px, 1fr)); gap: 10px; }
.template-card {
  min-width: 0;
  min-height: 82px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  text-align: left;
  transition: border .16s ease, background .16s ease, transform .16s ease;
}
.template-card:hover { transform: translateY(-1px); border-color: #bec6cf; }
.template-card.active { border: 2px solid var(--red); background: var(--red-soft); padding: 12px; }
.template-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: #4a535d; background: #eef1f4; font-size: 11px; font-weight: 900; }
.template-card.active .template-icon { color: white; background: var(--red); }
.template-card > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.template-card b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.template-card small { color: var(--muted); font-size: 10px; line-height: 1.3; }
.template-card i { align-self: start; color: #9299a2; font-size: 9px; font-style: normal; }

.workspace { display: grid; grid-template-columns: minmax(560px, 1.15fr) minmax(420px, .85fr); gap: 22px; align-items: start; }
.editor-panel, .preview-panel { background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel-heading, .preview-toolbar { min-height: 78px; padding: 17px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 4px 0 0; font-size: 21px; }
.status-badge { display: inline-flex; align-items: center; gap: 7px; color: var(--green); background: #eaf7f1; border-radius: 999px; padding: 7px 10px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status-badge span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

.form-section { margin: 18px 20px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.form-section-heading { margin-bottom: 17px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.form-section-heading > div { display: flex; align-items: flex-start; gap: 11px; }
.form-section-heading h3 { margin: 1px 0 3px; font-size: 15px; }
.form-section-heading p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.form-section-heading.compact { margin-bottom: 13px; }
.section-number { flex: 0 0 auto; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: white; background: #333940; font-size: 11px; font-weight: 900; }
.data-chip, .template-version { padding: 6px 8px; border-radius: 999px; color: #2c6d54; background: #e9f7f0; font-size: 9px; font-weight: 800; white-space: nowrap; }
.template-version { color: #646d77; background: #eef1f4; }

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.field { min-width: 0; display: grid; gap: 6px; }
.field.span-2 { grid-column: 1 / -1; }
.field > span, .override-reason > span { color: #464e57; font-size: 10px; font-weight: 800; }
.field input, .field select, .field textarea, .override-reason input {
  width: 100%;
  min-height: 43px;
  border: 1px solid #cfd6dd;
  border-radius: 10px;
  padding: 9px 11px;
  background: #fff;
  color: var(--ink);
  outline: 0;
  transition: border .15s ease, box-shadow .15s ease, background .15s ease;
}
.field textarea { min-height: 94px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus, .override-reason input:focus { border-color: #7e8791; box-shadow: 0 0 0 3px rgba(35, 43, 51, .08); }
.field input[readonly] { color: #656d77; background: #f3f5f7; }
.field small, .override-reason small { color: #7a838e; font-size: 9px; line-height: 1.35; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--red); background: #fff7f8; box-shadow: 0 0 0 3px rgba(217, 8, 22, .08); }
.override-reason.invalid input { border-color: var(--red); background: #fff7f8; box-shadow: 0 0 0 3px rgba(217, 8, 22, .08); }
.field.invalid small { color: var(--red-dark); font-weight: 700; }
.override-reason { margin-top: 13px; display: grid; gap: 6px; padding: 13px; border-radius: 11px; background: #fff8eb; border: 1px solid #f2d7a9; }
.hidden { display: none !important; }

.specific-note { margin-bottom: 13px; padding: 11px 12px; display: flex; align-items: flex-start; gap: 9px; color: #4d5863; background: var(--surface-blue); border: 1px solid #cce4ee; border-radius: 11px; font-size: 10px; line-height: 1.45; }
.specific-note strong { color: #15627e; }
.subsection-heading { margin: 17px 0 10px; padding-bottom: 7px; border-bottom: 1px solid var(--line); color: #343c45; font-size: 11px; letter-spacing: .025em; }
.source-audit { margin-top: 15px; padding: 13px 14px; border: 1px solid #efd7a7; border-radius: 11px; background: #fff9ed; color: #665022; font-size: 10px; line-height: 1.45; }
.source-audit ul { margin: 7px 0 0 17px; padding: 0; }
.source-audit li + li { margin-top: 4px; }
.clause-comparison { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.clause-comparison > div { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #f8f9fa; }
.clause-comparison > div:last-child { border-color: #efb6bb; background: #fff8f8; }
.clause-comparison > div > span { display: block; margin-bottom: 8px; color: #6c7580; font-size: 9px; font-weight: 850; letter-spacing: .08em; }
.clause-comparison p { margin: 0; color: #444d56; font-size: 10px; line-height: 1.55; }
.clause-comparison .field { display: grid; }
.annex-builder { margin-top: 14px; display: grid; gap: 12px; }
.annex-builder-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #f7f9fa; }
.annex-count-control { display: flex; align-items: flex-end; gap: 8px; }
.annex-count-control .field { width: 170px; }
.annex-count-control .button, .annex-builder-toolbar .button { min-height: 39px; font-size: 10px; }
.annex-counter { color: var(--muted); font-size: 10px; font-weight: 800; }
.annex-change-list { display: grid; gap: 12px; }
.annex-change-card { border: 1px solid var(--line-dark); border-radius: 13px; background: #fff; overflow: hidden; }
.annex-change-card.invalid { border-color: var(--red); box-shadow: 0 0 0 3px rgba(217, 8, 22, .08); }
.annex-change-head { padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #fff; background: var(--doc-graphite); }
.annex-change-head > div:first-child { display: flex; align-items: center; gap: 9px; }
.annex-ordinal { min-width: 34px; padding: 6px 7px; border-radius: 7px; background: var(--doc-red); text-align: center; font-size: 11px; font-weight: 900; }
.annex-change-head b { font-size: 10px; }
.annex-card-actions { display: flex; gap: 5px; }
.annex-card-actions button { min-width: 31px; height: 29px; padding: 0 8px; border: 1px solid rgba(255,255,255,.22); border-radius: 7px; color: white; background: rgba(255,255,255,.1); font-size: 9px; font-weight: 850; }
.annex-card-actions button:disabled { opacity: .35; cursor: default; }
.annex-card-actions .danger { color: #ffdadd; }
.annex-change-body { padding: 13px; display: grid; gap: 11px; }
.annex-change-body .clause-comparison { margin-top: 0; }
.annex-before-admin { max-height: 170px; overflow: auto; }
.annex-new-note { padding: 10px; border: 1px dashed #c8d0d7; border-radius: 9px; color: #5f6973; background: #fafbfc; font-size: 9px; line-height: 1.45; }
.annex-pdf-rule { padding: 11px 12px; border-left: 4px solid var(--doc-red); border-radius: 8px; color: #565f68; background: #fff5f6; font-size: 9px; line-height: 1.45; }
.cause-card { margin: 13px 0; padding: 13px 14px; border-left: 4px solid var(--red); border-radius: 10px; background: #fff4f5; color: #454d56; }
.cause-card strong { font-size: 11px; }
.cause-card p { margin: 5px 0; font-size: 10px; line-height: 1.45; }
.cause-card span { color: #8c4a50; font-size: 9px; font-weight: 700; }
.simulator-panel { margin: 15px 0; padding: 15px; border: 1px solid #cbd4dc; border-radius: 14px; background: #f7f9fa; }
.simulator-badge { padding: 6px 8px; border-radius: 999px; color: #7b5600; background: #fff0c9; font-size: 9px; font-weight: 850; letter-spacing: .05em; }
.check-field { min-height: 43px; display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid #cfd6dd; border-radius: 10px; background: white; color: #4a535d; font-size: 10px; font-weight: 700; }
.check-field input { width: 17px; height: 17px; accent-color: var(--red); }
.simulator-actions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.simulator-actions .button { min-height: 39px; font-size: 10px; }
.simulation-empty { margin-top: 12px; padding: 12px; display: grid; gap: 3px; border: 1px dashed #bdc6ce; border-radius: 10px; color: #68717b; background: white; }
.simulation-empty strong { font-size: 10px; }
.simulation-empty span { font-size: 9px; }
.simulation-result { margin-top: 12px; border: 1px solid #b9d9ca; border-radius: 11px; overflow: hidden; background: white; }
.simulation-result-head { padding: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; background: #edf8f3; }
.simulation-result-head > div { display: grid; gap: 4px; }
.simulation-result-head > div:last-child { text-align: right; }
.simulation-result-head span { color: #5f6a65; font-size: 8px; font-weight: 850; letter-spacing: .08em; }
.simulation-result-head strong { font-size: 14px; }
.simulation-result-head small { color: #64726b; font-size: 8px; line-height: 1.35; }
.simulation-lines { padding: 5px 12px; }
.simulation-lines > div { padding: 8px 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid #edf0f2; }
.simulation-lines > div:last-child { border-bottom: 0; }
.simulation-lines span { display: grid; gap: 2px; }
.simulation-lines b { font-size: 10px; }
.simulation-lines small { color: #747d87; font-size: 8px; line-height: 1.35; }
.simulation-lines strong { white-space: nowrap; font-size: 11px; font-variant-numeric: tabular-nums; }
.simulation-caution { padding: 10px 12px; color: #775511; background: #fff8e9; font-size: 8px; line-height: 1.45; }
.simulation-caution ul { margin: 5px 0 0 16px; padding: 0; }
.choice-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 13px; }
.choice-row label { display: flex; align-items: center; gap: 7px; min-height: 40px; padding: 9px; border: 1px solid var(--line); border-radius: 10px; color: #59626c; font-size: 10px; font-weight: 750; }
.choice-row label:has(input:checked) { color: var(--red-dark); border-color: #eeaab0; background: var(--red-soft); }
.choice-row input { accent-color: var(--red); }

.money-row { display: grid; grid-template-columns: 1fr 110px 34px; gap: 8px; align-items: center; margin-bottom: 8px; }
.money-row input { min-height: 40px; border: 1px solid #cfd6dd; border-radius: 9px; padding: 8px 10px; }
.money-empty { margin-bottom: 8px; padding: 12px; border: 1px dashed #c7ced5; border-radius: 10px; color: #737c85; background: #fafbfc; font-size: 9px; }
.money-row button, .equipment-row button { width: 34px; height: 34px; border: 0; border-radius: 9px; color: #8b343b; background: #fdebed; font-weight: 900; }
.inline-add { border: 0; color: var(--red); background: transparent; padding: 7px 0; font-size: 10px; font-weight: 850; }

.equipment-list { display: grid; gap: 7px; }
.equipment-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) 64px 34px; align-items: center; gap: 8px; }
.equipment-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--red); }
.equipment-row input[type="text"], .equipment-row input[type="number"] { min-width: 0; min-height: 38px; border: 1px solid #cfd6dd; border-radius: 9px; padding: 7px 9px; }

.signature-section { background: #fafbfc; }
.signature-preview-toggle { grid-column: 1 / -1; }
.validation-summary { margin: 0 20px 20px; padding: 13px 15px; display: flex; align-items: center; gap: 11px; border: 1px solid #bfe5d4; border-radius: 13px; background: #ecf8f2; }
.validation-summary.error { border-color: #f0bec2; background: #fff2f3; }
.validation-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--green); font-weight: 900; }
.validation-summary.error .validation-icon { background: var(--red); }
.validation-summary b { font-size: 12px; }
.validation-summary p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }

.preview-panel { position: sticky; top: 98px; }
.preview-toolbar { min-height: 72px; }
.preview-toolbar > div:first-child { display: grid; gap: 4px; }
.preview-toolbar b { font-size: 14px; }
.page-controls { display: flex; align-items: center; gap: 7px; }
.page-controls button { width: 31px; height: 31px; border: 1px solid var(--line-dark); border-radius: 9px; background: white; font-size: 20px; line-height: 1; }
.page-controls button:disabled { opacity: .35; cursor: default; }
.page-controls span { min-width: 78px; color: var(--muted); text-align: center; font-size: 9px; font-weight: 700; }
.paper-stage { padding: 25px; background: #dfe3e7; max-height: 850px; overflow: auto; }
.paper {
  position: relative;
  width: min(100%, 590px);
  height: 834px;
  min-height: 834px;
  margin: 0 auto;
  padding: 38px 38px 30px;
  display: flex;
  flex-direction: column;
  background: white;
  box-shadow: 0 12px 35px rgba(23, 29, 35, .16);
  overflow: hidden;
  color: var(--doc-ink);
  font-family: var(--document-font);
  font-variant-numeric: tabular-nums;
}
.paper::after { display: none; content: none; }
.doc-brand { position: relative; z-index: 1; display: grid; grid-template-columns: 132px 1fr; align-items: start; gap: 18px; }
.doc-brand img { width: 132px; height: 51px; object-fit: contain; object-position: left center; }
.doc-brand-meta { display: grid; justify-items: end; gap: 3px; color: var(--doc-muted); text-align: right; font: 700 8px/1.35 var(--document-font); }
.doc-brand-meta b { color: var(--doc-ink); font-size: 13px; line-height: 1.2; }
.doc-brand-meta em { color: var(--doc-red-dark); font-size: 7px; font-style: normal; letter-spacing: .08em; }
.doc-red-rule { position: relative; z-index: 1; height: 3px; margin: 9px 0 10px; background: var(--doc-red); }
.doc-company-row { position: relative; z-index: 1; margin-bottom: 13px; display: grid; grid-template-columns: 1fr auto; gap: 16px; color: var(--doc-muted); font: 700 7px/1.35 var(--document-font); }
.doc-company-row > div { display: grid; gap: 2px; }
.doc-company-row > div:last-child { text-align: right; }
.doc-company-row strong { color: var(--doc-ink); font-size: 8px; }
.doc-title { position: relative; z-index: 1; margin: 12px 0 15px; color: var(--doc-ink); text-align: center; font-size: 17px; line-height: 1.2; letter-spacing: .025em; text-decoration: none; }
.doc-subtitle { margin: -10px 0 18px; text-align: center; font: 800 9px/1.3 var(--document-font); letter-spacing: .1em; }
.doc-body { position: relative; z-index: 1; flex: 1 0 auto; font-size: 10px; line-height: 1.48; text-align: justify; }
.doc-body p { margin: 0 0 12px; }
.doc-body strong { font-weight: 800; }
.doc-data-grid { margin: 13px 0 16px; padding: 12px 14px; display: grid; grid-template-columns: 135px 1fr; gap: 5px 10px; border: 1px solid #c5c9cd; border-left: 4px solid var(--red); border-radius: 4px; background: #f8f9fa; font: 600 8px/1.35 var(--document-font); }
.doc-data-grid span:nth-child(odd) { color: #5d6670; }
.doc-facts { margin: 12px 0 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; text-align: left; }
.doc-facts > div { min-height: 43px; padding: 7px; border: 1px solid var(--doc-line); background: var(--doc-soft); }
.doc-facts span { display: block; color: var(--doc-muted); font-size: 6.5px; font-weight: 800; letter-spacing: .04em; }
.doc-facts strong { display: block; margin-top: 4px; color: var(--doc-ink); font-size: 8.2px; line-height: 1.25; }
.doc-clause { margin: 0 0 12px; }
.doc-clause b { font-family: var(--document-font); font-size: 9px; letter-spacing: .03em; }
.doc-table { width: 100%; margin: 12px 0 15px; border-collapse: collapse; font: 600 8px/1.3 var(--document-font); }
.doc-table th, .doc-table td { border: 1px solid #858b91; padding: 7px 8px; }
.doc-table th { border-color: var(--doc-graphite); color: #fff; background: var(--doc-graphite); text-align: left; }
.doc-table td.money, .doc-table th.money { text-align: right; }
.doc-words { padding: 9px 11px; border-radius: 3px; background: #f3f4f5; font: 700 8px/1.4 var(--document-font); }
.doc-warning { margin: 12px 0; padding: 9px 10px; border-left: 3px solid #d18800; color: #61430d; background: #fff7e7; font: 650 8px/1.4 var(--document-font); }
.doc-signatures { position: relative; z-index: 1; margin-top: 27px; display: grid; grid-template-columns: 1fr 1fr; gap: 34px; break-inside: avoid; page-break-inside: avoid; font: 650 8px/1.35 var(--document-font); }
.doc-signatures.single-worker { grid-template-columns: minmax(210px, 280px); justify-content: center; }
.doc-signatures.single-signer { grid-template-columns: minmax(210px, 280px); justify-content: center; }
.doc-signature-line { min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.doc-signature-line strong { display: block; margin-top: 4px; font-size: 10px; }
.signature-safe-zone { width: min(var(--signature-width, 55mm), 100%); height: var(--signature-height, 18mm); margin: 0 auto 5px; display: grid; place-items: end center; border-bottom: 1px solid var(--doc-ink); color: var(--doc-muted); }
.signature-safe-zone.pending { color: #7a8289; }
.signature-safe-zone.pending span { padding-bottom: 5px; font-size: 7px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.signature-safe-zone svg { width: min(100%, var(--signature-width, 55mm)); height: 100%; overflow: visible; }
.signature-safe-zone path { fill: none; stroke: var(--doc-graphite); stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.doc-signature-role { color: var(--doc-muted); font-size: 7px; font-weight: 850; letter-spacing: .05em; }
.doc-signature-evidence { display: block; margin-top: 2px; color: var(--doc-muted); font-size: 6.5px; line-height: 1.25; }
.electronic-signature-stamp { width: min(var(--signature-width, 55mm), 100%); min-height: var(--signature-height, 18mm); display: grid; grid-template-columns: 42% 1fr; align-items: center; gap: 6px; padding: 5px 7px; border: 1px solid #9aa1a8; border-radius: 3px; background: #fff; color: var(--doc-ink); text-align: left; }
.electronic-stamp-visual { min-width: 0; height: calc(var(--signature-height, 18mm) - 10px); display: grid; align-content: center; justify-items: center; border-right: 1px solid var(--doc-line); padding-right: 5px; overflow: hidden; }
.electronic-stamp-visual svg { width: 100%; height: 29px; }
.electronic-stamp-visual path { fill: none; stroke: var(--doc-graphite); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.electronic-stamp-copy { min-width: 0; display: grid; gap: 1px; line-height: 1.08; }
.electronic-stamp-copy > span { color: var(--doc-red-dark); font-size: 5.4px; font-weight: 900; letter-spacing: .07em; }
.electronic-stamp-copy > strong { margin: 0; font-size: 7.3px; line-height: 1.12; }
.electronic-stamp-copy > small { color: #3f464c; font-size: 5.5px; font-weight: 750; line-height: 1.18; }
.electronic-stamp-copy > em { color: var(--doc-muted); font-size: 5px; font-style: normal; font-weight: 650; line-height: 1.15; }
.electronic-signature-placeholder { width: min(var(--signature-width, 55mm), 100%); min-height: var(--signature-height, 18mm); padding: 8px; display: grid; place-content: center; gap: 3px; border: 1px dashed #8e969d; color: var(--doc-muted); text-align: center; }
.electronic-signature-placeholder > span { font-size: 6px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.electronic-signature-placeholder > strong { margin: 0; color: var(--doc-ink); font-size: 8px; }
.electronic-signature-placeholder > small { font-size: 5.8px; line-height: 1.25; }
.doc-footer { position: relative; z-index: 1; margin-top: auto; padding-top: 9px; display: flex; justify-content: space-between; border-top: 1px solid var(--doc-line); color: var(--doc-muted); font: 600 7px var(--document-font); }
.regulation-card { margin: 25px 0 38px; padding: 16px; border: 1px solid #bfc4c9; border-left: 4px solid var(--red); background: #f8f9fa; display: grid; grid-template-columns: 135px 1fr; gap: 12px; font: 700 9px var(--document-font); }
.epp-table td:first-child, .epp-table th:first-child { width: 32px; text-align: center; }
.epp-table td:last-child, .epp-table th:last-child { width: 100px; text-align: center; }
.signature-stamp { display: inline-block; margin-top: 4px; color: #757d85; font: 700 8px/1.35 var(--document-font); }
.contract-document .doc-brand { padding-bottom: 8px; }
.contract-document .doc-brand img { width: 98px; height: 37px; }
.contract-document .doc-title { margin: 13px 0 11px; font-size: 18px; text-decoration: none; }
.contract-document .doc-body { font-size: 10px; line-height: 1.4; }
.contract-document .doc-body p { margin-bottom: 8px; }
.contract-document .doc-clause { margin-bottom: 7px; }
.contract-document .doc-clause b { font-size: 10px; }
.source-worker-grid { margin: 8px 0 10px; display: grid; grid-template-columns: 130px 1fr; gap: 2px 8px; font-size: 9px; line-height: 1.3; }
.source-worker-grid span { font-weight: 700; }
.contract-page-two { padding-top: 2px; }
.contract-page-two .doc-body { font-size: 8px; line-height: 1.24; }
.contract-page-two .doc-clause { margin-bottom: 5px; }
.contract-page-two .doc-signatures { margin-top: 12px; }
.contract-obligations { margin: 5px 0 6px 17px; padding: 0; }
.contract-obligations li { margin: 0 0 1px; padding-left: 2px; }
.contract-final-clause { margin-top: 6px !important; }
.source-contract-signatures { margin-top: 18px; }
.annex-page-body { min-height: 0; overflow: visible; }
.annex-facts { margin-bottom: 12px; }
.doc-modifications { margin: 0; padding: 0; list-style: none; }
.doc-change { margin: 0 0 11px; break-inside: avoid; page-break-inside: avoid; }
.doc-change:last-child { margin-bottom: 0; }
.doc-change > p { margin-bottom: 7px; }
.doc-change-title { margin: 0 0 6px; display: flex; align-items: center; gap: 8px; font-size: 9px; line-height: 1.3; }
.doc-change-title .doc-ordinal { min-width: 30px; padding: 5px 7px; border-radius: 3px; color: #fff; background: var(--doc-graphite); text-align: center; font-weight: 900; }
.doc-final-clause { padding: 9px 11px; border: 1px solid var(--doc-line); border-left: 4px solid var(--doc-red); background: var(--doc-soft); font-size: 9px; line-height: 1.45; }
.doc-final-clause p { margin: 5px 0 0; white-space: pre-wrap; }
.doc-continuation { margin: 2px 0 13px; color: var(--doc-muted); font-size: 8px; font-weight: 800; letter-spacing: .06em; }
.annex-ending { margin-top: 18px; break-inside: avoid; page-break-inside: avoid; }
.annex-ending > p { margin-bottom: 8px; }
.annex-preservation { padding-top: 10px; border-top: 1px solid var(--doc-line); }
.settlement-document { font-size: 9.6px; line-height: 1.52; }
.settlement-document .doc-title { margin: 8px 0 18px; }
.settlement-payment-detail { margin: 12px 0; padding: 7px 12px; border-top: 1px solid #666; border-bottom: 1px solid #666; }
.settlement-payment-detail > div { padding: 6px 0; display: flex; justify-content: space-between; gap: 18px; border-bottom: 1px dotted #b8bdc1; }
.settlement-payment-detail > div:last-child { border-bottom: 0; }
.settlement-payment-detail span { flex: 1; }
.settlement-payment-detail strong { white-space: nowrap; }
.settlement-payment-detail .settlement-payment-total { margin-top: 3px; padding-top: 9px; border-top: 1.5px solid var(--doc-ink); border-bottom: 0; font-size: 10px; }
.settlement-amount-words { padding: 9px 0; border-bottom: 1px solid var(--doc-line); }
.settlement-reservation { padding: 9px 11px; border: 1px solid var(--doc-line); background: #f7f8f9; }
.settlement-signature-page { display: flex; flex-direction: column; }
.settlement-signature-spacer { flex: 1; min-height: 32px; }
.settlement-signature-page .doc-signatures { margin-top: 18px; }
.ppe-document { font-size: 8.3px; line-height: 1.32; }
.paper:has(.ppe-document) { padding-top: 30px; padding-bottom: 24px; }
.paper:has(.ppe-document) > .doc-title { margin: 5px 0 8px; font-size: 15px; }
.ppe-document > p { margin-bottom: 7px; }
.ppe-document .doc-data-grid { margin: 5px 0 7px; padding: 5px 10px; gap: 2px 8px; font-size: 7.5px; }
.ppe-document .doc-table { margin: 6px 0 8px; font-size: 7px; line-height: 1.15; }
.ppe-document .doc-table th, .ppe-document .doc-table td { padding: 4px 5px; }
.ppe-document .signature-stamp { margin-top: 0; font-size: 6.5px; }
.ppe-document .doc-signatures { margin-top: 9px; }
.ppe-document .doc-signature-evidence { display: none; }
.doc-clause, .doc-change, .doc-final-clause, .annex-ending, .doc-signatures, .doc-signature-line, .doc-table tr, .doc-data-grid, .doc-facts { break-inside: avoid; page-break-inside: avoid; }
.annex-overflow-probe { position: fixed; top: 0; left: -20000px; width: 590px; visibility: hidden; pointer-events: none; }
.annex-overflow-probe .paper { width: 590px !important; height: 834px !important; min-height: 834px !important; box-shadow: none; }

.preview-foot { padding: 12px 18px; display: flex; justify-content: space-between; gap: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.preview-foot span { display: flex; align-items: center; gap: 7px; }
.preview-foot i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.text-button { border: 0; background: transparent; color: var(--red); font-weight: 850; font-size: 9px; }
.signature-mode-note { padding: 10px 12px; display: flex; align-items: flex-start; gap: 9px; border: 1px solid #bddfd0; border-radius: 10px; background: #f1faf6; }
.signature-mode-note > span { width: 20px; height: 20px; flex: 0 0 20px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--green); font-size: 11px; font-weight: 900; }
.signature-mode-note div { display: grid; gap: 2px; }
.signature-mode-note b { color: #165c42; font-size: 10px; }
.signature-mode-note small { color: #47675c; font-size: 9px; line-height: 1.4; }

.locked-copy-note { margin: 22px 0 0; padding: 16px 19px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; border: 1px solid #cfe0e7; border-radius: 14px; background: #f5fbfd; }
.lock-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: white; background: #3b7b90; font-weight: 900; }
.locked-copy-note b { font-size: 12px; }
.locked-copy-note p { margin: 3px 0 0; color: #65717b; font-size: 10px; }
.locked-copy-note > span { color: #32708a; background: #e0f1f7; padding: 7px 9px; border-radius: 999px; font-size: 9px; font-weight: 800; }

.action-bar { position: sticky; bottom: 16px; z-index: 10; margin-top: 22px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid #cfd5dc; border-radius: 16px; background: rgba(255, 255, 255, .96); box-shadow: 0 15px 45px rgba(25, 31, 38, .16); backdrop-filter: blur(12px); }
.action-status { display: flex; align-items: center; gap: 10px; }
.action-status > span { width: 10px; height: 10px; border-radius: 50%; background: #aeb5bd; box-shadow: 0 0 0 4px #eef0f2; }
.action-status.saved > span { background: var(--green); box-shadow: 0 0 0 4px #e6f5ee; }
.action-status div { display: grid; gap: 2px; }
.action-status b { font-size: 11px; }
.action-status small { color: var(--muted); font-size: 9px; }
.actions { display: flex; gap: 8px; }

.toast { position: fixed; z-index: 60; right: 24px; bottom: 24px; max-width: 360px; padding: 13px 16px; border-radius: 12px; color: white; background: #272d33; box-shadow: 0 14px 40px rgba(0, 0, 0, .25); font-size: 11px; font-weight: 750; opacity: 0; transform: translateY(16px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.modal-backdrop { position: fixed; z-index: 50; inset: 0; padding: 20px; display: grid; place-items: center; background: rgba(22, 27, 32, .72); backdrop-filter: blur(7px); }
.modal { width: min(1050px, 100%); max-height: calc(100vh - 40px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; border-radius: 18px; background: white; box-shadow: 0 30px 90px rgba(0, 0, 0, .36); overflow: hidden; }
.modal-head, .modal-actions { padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 3px 0 0; font-size: 20px; }
.modal-head button { width: 38px; height: 38px; border: 0; border-radius: 10px; background: #eff1f3; font-size: 24px; }
.modal-paper-wrap { padding: 28px; overflow: auto; background: #dfe3e7; }
.modal-pages { display: grid; gap: 24px; }
.modal-paper { width: 680px; height: 962px; min-height: 962px; }
.canonical-pdf-frame { width: min(900px, 100%); height: min(1100px, 76vh); margin: 0 auto; border: 0; border-radius: 8px; background: white; box-shadow: 0 12px 35px rgba(23, 29, 35, .16); }
.canonical-pdf-access { width: min(900px, 100%); margin: 0 auto 12px; text-align: right; }
.canonical-pdf-access a { color: var(--red-dark); font-size: 12px; font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
.modal-actions { justify-content: flex-end; border-top: 1px solid var(--line); border-bottom: 0; }

.worker-source-control { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 16px; padding: 0; border: 0; }
.worker-source-control legend { margin-bottom: 8px; font-size: 11px; font-weight: 800; }
.worker-source-control label { display: flex; align-items: center; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.worker-source-control label:has(input:checked) { border-color: var(--red); background: #fff5f5; }
.worker-source-control input { accent-color: var(--red); }
.worker-source-control span { display: grid; gap: 3px; }
.worker-source-control b { font-size: 11px; }
.worker-source-control small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.manual-document-note { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.generation-feedback { margin: 0 auto 18px; max-width: 850px; padding: 13px 16px; border: 1px solid #bddfd0; border-radius: 10px; background: #f1faf6; color: #165c42; font-size: 12px; line-height: 1.5; }
.generation-feedback.error { border-color: #e8b1b1; background: #fff3f3; color: #8c2323; }
.generation-feedback button { margin-top: 8px; display: block; }

@media (max-width: 1180px) {
  .template-grid { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
  .workspace { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
  .paper-stage { max-height: 780px; }
}

@media (max-width: 760px) {
  .topbar { position: static; padding: 10px 14px; }
  .brand img { width: 96px; }
  .brand-divider, .brand div { display: none; }
  .environment-pill { padding: 6px 8px; font-size: 0; }
  .environment-pill::after { content: "ERP CENTRAL"; font-size: 9px; letter-spacing: .06em; }
  .shell { width: min(100% - 20px, 1540px); margin-top: 18px; }
  .page-heading { align-items: flex-start; }
  .page-heading .button { display: none; }
  .page-heading h1 { font-size: 30px; }
  .steps { padding: 11px; }
  .step { flex: 1; }
  .step small { display: none; }
  .step-line { margin: 0 7px; }
  .template-section { padding: 16px; }
  .template-grid { grid-template-columns: 1fr; }
  .template-card { min-height: 68px; }
  .template-count { display: none; }
  .workspace { gap: 14px; }
  .panel-heading { padding: 15px; }
  .status-badge { display: none; }
  .form-section { margin: 14px; padding: 14px; }
  .field-grid { grid-template-columns: 1fr; }
  .worker-source-control { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: auto; }
  .form-section-heading { display: block; }
  .form-section-heading > span { display: inline-block; margin: 10px 0 0 38px; }
  .choice-row { grid-template-columns: 1fr; }
  .clause-comparison { grid-template-columns: 1fr; }
  .simulation-result-head { grid-template-columns: 1fr; }
  .simulation-result-head > div:last-child { text-align: left; }
  .simulator-actions { display: grid; grid-template-columns: 1fr; }
  .paper-stage { padding: 12px; overflow: auto; }
  .paper { width: 590px; height: 834px; min-height: 834px; padding: 38px 38px 30px; }
  .doc-data-grid { grid-template-columns: 135px 1fr; }
  .doc-signatures { gap: 24px; }
  .locked-copy-note { grid-template-columns: auto 1fr; }
  .locked-copy-note > span { grid-column: 2; justify-self: start; }
  .action-bar { bottom: 8px; align-items: stretch; flex-direction: column; }
  .actions { display: grid; grid-template-columns: 1fr 1fr; }
  .actions .button.primary { grid-column: 1 / -1; }
  .modal-backdrop { padding: 0; }
  .modal { max-height: 100vh; height: 100vh; border-radius: 0; }
  .modal-paper-wrap { padding: 12px; }
  .modal-paper { width: 680px; height: 962px; min-height: 962px; }
  .modal-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .modal-actions .primary { grid-column: 1 / -1; }
}

@media print {
  @page { size: A4; margin: 0; }
  body > *:not(#previewModal) { display: none !important; }
  #previewModal, #previewModal .modal, #previewModal .modal-paper-wrap, #modalPages, #modalPages * { visibility: visible !important; }
  #previewModal { position: static; display: block; padding: 0; background: none; backdrop-filter: none; }
  #previewModal .modal { width: auto; max-height: none; display: block; overflow: visible; border-radius: 0; box-shadow: none; }
  .modal-head, .modal-actions { display: none !important; }
  #previewModal .modal-paper-wrap { padding: 0; overflow: visible; background: white; }
  #modalPages { display: block; }
  .modal-paper { width: 210mm; height: 297mm; min-height: 297mm; padding: 13.4mm 13.4mm 15mm; margin: 0; box-shadow: none; break-after: page; page-break-after: always; overflow: hidden; }
  .modal-paper:last-child { break-after: auto; page-break-after: auto; }
  .modal-paper::after { display: none; }
}

/* Canonical A4 preview. Keep these values synchronized with DOCUMENT_CSS in
   src/labor-document-pdf.cjs; screen zoom changes only presentation size. */
.paper {
  width: 210mm;
  height: 297mm;
  min-height: 297mm;
  padding: 9mm;
  zoom: .743;
}
.doc-brand { grid-template-columns: 35mm 1fr; gap: 5mm; }
.doc-brand img { width: 35mm; height: 13.5mm; }
.doc-brand-meta { gap: .8mm; font: 700 8px/1.35 var(--document-font); }
.doc-brand-meta b { font-size: 13px; line-height: 1.2; }
.doc-red-rule { height: .8mm; margin: 2.4mm 0 2.7mm; }
.doc-company-row { margin-bottom: 3.4mm; gap: 4mm; font: 700 7.4px/1.35 var(--document-font); }
.doc-company-row > div { gap: .5mm; }
.doc-company-row strong { font-size: 8.3px; }
.doc-title { margin: 3.2mm 0 4mm; font-size: 17px; line-height: 1.2; }
.doc-subtitle { margin: -2.6mm 0 4.8mm; font: 800 12.8px/1.3 var(--document-font); }
.doc-body { min-height: 0; flex: 1 1 auto; font-size: 12.8px; line-height: 1.36; }
.doc-body p { margin: 0 0 2.6mm; }
.doc-body strong { font-weight: bolder; }
.doc-clause { margin: 0 0 2.6mm; }
.doc-clause b { font-size: 12.8px; }
.doc-footer { margin-top: auto; padding-top: 2.4mm; font: 600 7.4px var(--document-font); }
.source-worker-grid { margin: 2mm 0 2.6mm; display: block; border: 1px solid var(--doc-line); border-left: .8mm solid var(--doc-red); font-size: 12.8px; line-height: 1.25; text-align: left; }
.source-worker-row { display: grid; grid-template-columns: 58mm minmax(0, 1fr); border-bottom: 1px solid var(--doc-line); break-inside: avoid; page-break-inside: avoid; text-align: left; }
.source-worker-row:last-child { border-bottom: 0; }
.source-worker-row > span, .source-worker-row > b { min-width: 0; padding: .18mm 1.3mm; overflow-wrap: anywhere; }
.source-worker-row > span { background: var(--doc-soft); font-weight: 700; }
.source-worker-row > b { font-weight: 700; }
.contract-document { width: 100%; flex: 0 0 auto; }
.contract-document .doc-brand { padding-bottom: 1.4mm; }
.contract-document .doc-brand img { width: 26mm; height: 9.8mm; }
.contract-document .doc-title { margin: 2.6mm 0 2.2mm; font-size: 18px; }
.contract-document .doc-body { font-size: 12.8px; line-height: 1.3; }
.contract-document .doc-body p { margin-bottom: 1.7mm; }
.contract-document .doc-clause { margin-bottom: 1.55mm; }
.contract-document .doc-clause b { font-size: 12.8px; }
.contract-page-two { padding-top: .3mm; }
.contract-page-two .doc-body { font-size: 12.8px; line-height: 1.23; }
.contract-page-two .doc-clause { margin-bottom: 1.1mm; }
.contract-page-two .doc-signatures { margin-top: 2.2mm; }
.contract-obligations { margin: 1mm 0 1.3mm 4.5mm; padding: 0; }
.contract-obligations li { margin: 0 0 .12mm; padding-left: .5mm; }
.contract-final-clause { margin-top: 1.3mm !important; }
.doc-facts { margin: 1.5mm 0 2mm; gap: 1mm; }
.doc-facts > div { min-height: 10.5mm; padding: 1mm; }
.doc-facts span { font-size: 9.5px; letter-spacing: normal; }
.doc-facts strong { margin-top: .5mm; font-size: 12.8px; line-height: 1.2; }
.annex-page .doc-body { font-size: 12.8px; line-height: 1.25; }
.annex-page .doc-body > p { margin-bottom: 1.5mm; }
.doc-change { margin: 0 0 1.4mm; }
.doc-change > p { margin-bottom: .8mm; }
.doc-change-title { margin: 0 0 .8mm; gap: 1.4mm; font-size: 12.8px; line-height: 1.22; }
.doc-change-title .doc-ordinal { min-width: 7mm; padding: .75mm 1.2mm; border-radius: .8mm; }
.doc-final-clause { padding: 1mm 1.5mm; border-left: 1mm solid var(--doc-red); font-size: 12.8px; line-height: 1.25; }
.doc-final-clause p { margin: .55mm 0 0; }
.doc-continuation { margin: .2mm 0 1mm; font-size: 10px; }
.annex-ending { margin-top: 2mm; }
.annex-ending > p { margin-bottom: 1mm; }
.annex-preservation { padding-top: 1.2mm; }
.annex-ending .doc-signatures { margin-top: 57.5mm; }
.settlement-document { font-size: 12.8px; line-height: 1.4; }
.settlement-document .doc-title { margin: 2mm 0 4.8mm; }
.settlement-payment-detail { margin: 3.2mm 0; padding: 1.85mm 3.2mm; }
.settlement-payment-detail > div { padding: 1.6mm 0; gap: 4.8mm; }
.settlement-payment-detail .settlement-payment-total { margin-top: .8mm; padding-top: 2.4mm; font-size: 12.8px; }
.settlement-amount-words { padding: 2.4mm 0; }
.settlement-reservation { padding: 2.4mm 2.9mm; }
.settlement-signature-spacer { min-height: 8.5mm; }
.doc-data-grid { margin: 3.4mm 0 4.2mm; padding: 3.2mm 3.7mm; grid-template-columns: 40mm 1fr; gap: 1.3mm 2.6mm; border-left: 1mm solid var(--doc-red); border-radius: 0; font: 600 12.8px/1.35 var(--document-font); }
.regulation-card { margin: 6.6mm 0 10mm; padding: 4.2mm; grid-template-columns: 40mm 1fr; gap: 3.2mm; border-left: 1mm solid var(--doc-red); font: 700 12.8px var(--document-font); text-align: left; }
.doc-table { margin: 3.2mm 0 4mm; font: 600 12.8px/1.3 var(--document-font); }
.doc-table th, .doc-table td { padding: 1.85mm 2mm; }
.epp-table td:first-child, .epp-table th:first-child { width: 8.5mm; }
.epp-table td:last-child, .epp-table th:last-child { width: 34mm; }
.signature-stamp { margin-top: 0; font: 700 12.8px/1.25 var(--document-font); }
.paper:has(.ppe-document) { padding-top: 9mm; padding-bottom: 9mm; }
.paper:has(.ppe-document) > .doc-title { margin: 1.3mm 0 2.1mm; font-size: 17px; }
.ppe-document { font-size: 12.8px; line-height: 1.36; }
.ppe-document > p { margin-bottom: 1.85mm; }
.ppe-document .doc-data-grid { margin: 1.3mm 0 1.85mm; padding: 1.6mm 2.6mm; gap: .7mm 2mm; font-size: 12.8px; }
.ppe-document .doc-table { margin: 1.6mm 0 2mm; font-size: 12.8px; line-height: 1.25; }
.ppe-document .doc-table th, .ppe-document .doc-table td { padding: 1.1mm 1.3mm; }
.ppe-document .signature-stamp { margin-top: 0; font: 700 12.8px/1.25 var(--document-font); }
.ppe-document .doc-signatures { margin-top: 2.4mm; }
.doc-signatures { margin-top: 7mm; gap: 9mm; font: 650 12.8px/1.3 var(--document-font); }
.doc-signatures.single-worker, .doc-signatures.single-signer { grid-template-columns: minmax(55mm, 74mm); }
.doc-signature-line strong { margin-top: 1mm; font-size: 12.8px; }
.doc-signature-role { font-size: 10px; }
.signature-safe-zone { width: min(var(--signature-width, 55mm), 100%); height: var(--signature-height, 18mm); margin: 0 auto 1.3mm; }
.electronic-signature-placeholder { width: min(var(--signature-width, 55mm), 100%); height: var(--signature-height, 18mm); min-height: 0; padding: 2mm; gap: .8mm; }
.electronic-signature-placeholder > strong { margin: 0; font-size: 12.8px; }
.electronic-signature-placeholder > small { font-size: 9.5px; line-height: 1.25; }
.annex-overflow-probe { width: 590px; }
.annex-overflow-probe .paper { width: 210mm !important; height: 297mm !important; min-height: 297mm !important; }
.modal-paper { width: 210mm; height: 297mm; min-height: 297mm; zoom: .857; }

@media (max-width: 760px) {
  .paper { width: 210mm; height: 297mm; min-height: 297mm; padding: 9mm; zoom: .743; }
  .doc-data-grid { grid-template-columns: 40mm 1fr; }
  .modal-paper { width: 210mm; height: 297mm; min-height: 297mm; zoom: .857; }
}

@media print {
  .modal-paper { width: 210mm; height: 297mm; min-height: 297mm; padding: 9mm; zoom: 1; }
  .generation-feedback, .canonical-pdf-access { display: none !important; }
}

/* 3.8.6 · comprobante de feriado */
.vacation-balance { margin: 0 0 13px; padding: 9px 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; border: 1px solid var(--doc-line); border-left: 4px solid var(--doc-red); background: #f8f9fa; text-align: left; }
.vacation-balance span { display: block; color: var(--doc-muted); font-size: 6.5px; font-weight: 800; letter-spacing: .04em; }
.vacation-balance strong { display: block; margin-top: 3px; font-size: 9px; }
.vacation-balance-total strong { color: var(--doc-red-dark); }
.vacation-balance small { grid-column: 1 / -1; color: var(--doc-muted); font-size: 6.5px; line-height: 1.3; }
.vacation-summary strong { display: block; }
