:root {
  color-scheme: light;
  --bg: #f7f8f5;
  --panel: #ffffff;
  --ink: #17201f;
  --muted: #64706d;
  --line: #dfe6e2;
  --green: #1d5f53;
  --green-2: #2f7d6e;
  --red: #b53d2f;
  --gold: #c7922f;
  --blue: #366a96;
  --shadow: 0 14px 40px rgba(26, 42, 38, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
}

.sidebar {
  background: #182321;
  color: white;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
}

.brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
}

.brand strong {
  display: block;
  font-size: 17px;
}

.brand span {
  display: block;
  color: #b8c5c1;
  font-size: 12px;
  margin-top: 3px;
}

.mode-switch,
.nav,
.side-panel {
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 14px;
}

.mode-switch label,
.side-panel label {
  color: #b8c5c1;
  display: block;
  font-size: 12px;
  margin-bottom: 8px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
}

.segmented button {
  min-height: 36px;
  border-radius: 6px;
  color: #dce5e2;
  background: transparent;
}

.segmented button.active {
  color: #10211e;
  background: white;
}

.account-box {
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255,255,255,.06);
  margin-bottom: 8px;
}

.account-box strong,
.account-box span {
  display: block;
}

.account-box strong {
  font-size: 13px;
}

.account-box span {
  color: #b8c5c1;
  font-size: 12px;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.btn.ghost {
  width: 100%;
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.14);
  color: white;
}

.nav button {
  width: 100%;
  min-height: 42px;
  text-align: left;
  border-radius: 7px;
  color: #dce5e2;
  background: transparent;
  padding: 0 12px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav button.active {
  background: #edf4f1;
  color: #10211e;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green-2);
  flex: 0 0 auto;
}

.side-panel {
  margin-top: auto;
  color: #dce5e2;
  font-size: 13px;
  line-height: 1.45;
}

.main {
  min-width: 0;
}

.topbar {
  min-height: 76px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar h1 {
  font-size: 22px;
  margin: 0 0 3px;
}

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

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

.btn {
  min-height: 38px;
  border-radius: 7px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #edf2ef;
  color: #152522;
  border: 1px solid var(--line);
}

.btn.primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.btn.warn {
  background: #fff4df;
  border-color: #edd6aa;
  color: #5c4216;
}

.btn.danger {
  background: #f9e7e4;
  border-color: #ecc8c2;
  color: #7e2a20;
}

.content {
  padding: 24px 28px 40px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }

.panel,
.card,
.print-sheet {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

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

.panel h2,
.panel h3 {
  margin: 0;
}

.panel h2 {
  font-size: 18px;
}

.panel h3 {
  font-size: 15px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}

.status.pending { background: #fff2d6; color: #704a05; }
.status.review { background: #e7f0ff; color: #174c80; }
.status.corrections { background: #ffe9e4; color: #8b2f20; }
.status.approved { background: #e5f4ec; color: #14533d; }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfa;
}

.metric strong {
  display: block;
  font-size: 22px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 12px;
  font-weight: 700;
  color: #344440;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.field label span {
  color: var(--muted);
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 40px;
  padding: 9px 10px;
  background: white;
  color: var(--ink);
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled,
table input:disabled,
table select:disabled {
  background: #f4f7f5;
  color: #5f6e69;
  cursor: not-allowed;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.table th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.event {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
}

.event::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  margin-top: 4px;
}

.event strong {
  display: block;
  font-size: 13px;
}

.event span {
  color: var(--muted);
  font-size: 12px;
}

.checklist {
  display: grid;
  gap: 8px;
}

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

.check-item input {
  width: 18px;
  height: 18px;
}

.upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, auto);
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
}

.upload-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.upload-controls input[type="file"] {
  max-width: 240px;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(140deg, #eef3ef, #f9faf5);
}

.login-panel {
  width: min(460px, 100%);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.login-brand img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.login-brand h1 {
  margin: 0 0 4px;
  font-size: 22px;
}

.login-brand p {
  margin: 0;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-help {
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 16px;
}

.upload-row strong {
  display: block;
  font-size: 13px;
}

.upload-row span {
  color: var(--muted);
  font-size: 12px;
}

.document-group {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.document-group h3 {
  margin: 0;
}

.document-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 12px;
}

.document-card.internal {
  background: #f8fbff;
  border-color: #cfe0ef;
}

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

.document-main strong,
.document-main span,
.version-row strong,
.version-row span {
  display: block;
}

.document-main span,
.version-row span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.version-list {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
}

.version-row {
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px;
}

.link-button {
  margin-top: 6px;
  padding: 0;
  min-height: 0;
  background: transparent;
  color: var(--green);
  font-weight: 700;
  text-align: left;
}

.timeline.compact {
  gap: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 18, .62);
  display: grid;
  place-items: center;
  padding: 22px;
  z-index: 40;
}

.modal {
  width: min(980px, 100%);
  max-height: min(90vh, 900px);
  overflow: auto;
  background: white;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
  padding: 18px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.modal-header h2,
.modal-header p {
  margin: 0;
}

.modal-header p {
  color: var(--muted);
  margin-top: 4px;
}

.modal-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.modal-meta div {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px;
  background: #fbfcfa;
}

.modal-meta .full {
  grid-column: 1 / -1;
}

.modal-meta strong,
.modal-meta span {
  display: block;
}

.modal-meta span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
  margin-top: 4px;
}

.modal-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin: 14px 0;
}

.modal-file-actions,
.preview-zoom-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.preview-zoom-controls {
  background: #f3f7f5;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
}

.preview-zoom-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 0 5px;
  text-transform: uppercase;
}

.preview-zoom-controls .btn {
  min-height: 34px;
}

.preview-zoom-button {
  font-size: 20px;
  min-width: 36px;
  padding: 3px 10px;
}

.preview-zoom-text {
  padding: 7px 10px;
}

.preview-zoom-value {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  min-width: 84px;
  text-align: center;
}

.upload-preview {
  width: 100%;
  height: min(58vh, 620px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f7f5;
}

.upload-preview-viewport {
  cursor: grab;
  overflow: auto;
  overscroll-behavior: contain;
  position: relative;
  touch-action: none;
}

.upload-preview-viewport:focus-visible {
  outline: 3px solid rgba(27, 105, 88, .22);
  outline-offset: 2px;
}

.upload-preview-viewport.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.upload-preview-canvas {
  align-items: flex-start;
  display: flex;
  justify-content: center;
  min-height: 100%;
  min-width: 100%;
  padding: 12px;
  width: max-content;
}

.upload-preview-image {
  background: white;
  box-shadow: 0 4px 18px rgba(18, 38, 33, .18);
  display: block;
  flex: 0 0 auto;
  height: auto;
  max-width: none;
}

.product-list {
  display: grid;
  gap: 14px;
}

.subform {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 14px;
}

.subform-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.subform-title h3 {
  margin: 0;
}

.subform.locked {
  background: #f8fafc;
  opacity: .92;
}

.product-card {
  box-shadow: 0 1px 3px rgba(16, 42, 38, .06);
}

.product-card .subform-title {
  margin-bottom: 6px;
}

.product-meta {
  margin: 0 0 12px;
  font-size: .82rem;
  color: var(--muted);
}

.official-form-note {
  display: grid;
  gap: 2px;
  border-left: 3px solid var(--green);
  background: #f0f7f4;
  padding: 10px 12px;
  margin: 12px 0 16px;
  font-size: .82rem;
}

.official-form-note span {
  color: var(--muted);
}

.product-section {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.product-section h4 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.struct-block {
  margin: 4px 0 14px;
}

.struct-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #344440;
  margin-bottom: 8px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.struct-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 8px;
}

.struct-table th,
.struct-table td {
  border: 1px solid var(--line);
  padding: 5px 6px;
  text-align: left;
}

.struct-table th {
  background: #f1f4f2;
  font-size: 12px;
  color: var(--muted);
}

.struct-table th.num,
.struct-table td.num {
  width: 120px;
}

.struct-table input,
.struct-table select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  min-height: 32px;
  padding: 4px 7px;
  background: white;
  color: var(--ink);
}

.struct-table input.num {
  text-align: right;
}

.btn-mini {
  min-height: 30px;
  padding: 0 9px;
  font-size: .78rem;
}

.petition {
  font-size: .82rem;
  color: #475569;
  margin: 4px 0 0;
}

.version-tag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  color: #475569;
  background: #e2e8f0;
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 6px;
  vertical-align: middle;
}

.label-upload {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
  background: #fbfcfa;
}

.label-upload strong,
.label-upload span {
  display: block;
}

.label-upload span {
  font-size: .82rem;
  color: #64748b;
  margin-top: 2px;
}

.label-upload.missing {
  background: #fffbeb;
  border-color: #fde68a;
}

.label-upload.missing strong { color: #92400e; }

.label-upload.has-file { border-left: 3px solid var(--green); }

.product-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.roadmap {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.roadmap div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 12px;
}

.roadmap strong,
.roadmap span {
  display: block;
}

.roadmap strong {
  font-size: 13px;
  margin-bottom: 6px;
}

.roadmap span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tabs button {
  border-radius: 7px;
  min-height: 34px;
  padding: 0 11px;
  background: #edf2ef;
  color: #23312f;
  border: 1px solid var(--line);
}

.tabs button.active {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.print-sheet {
  padding: 24px;
  max-width: 820px;
  margin: 0 auto;
}

.print-sheet h2 {
  margin-top: 0;
  text-align: center;
  font-size: 18px;
}

.print-brand {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 14px;
}

.print-brand::after {
  content: "";
}

.print-brand img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.print-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  table-layout: fixed;
}

.print-table td,
.print-table th {
  border: 1px solid #9aa5a1;
  padding: 8px;
  vertical-align: top;
  height: 34px;
  overflow-wrap: anywhere;
}

.print-table th {
  background: #f1f4f2;
  text-align: left;
}

.signature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 36px;
}

.signature div {
  border-top: 1px solid #333;
  padding-top: 8px;
  text-align: center;
  font-size: 12px;
}

.official-form {
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
}

.official-page {
  width: 100%;
  max-width: 210mm;
  min-height: 297mm;
  margin: 0 auto 18px;
  padding: 11mm 12mm;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #c9cfcc;
  box-shadow: 0 10px 28px rgba(24, 35, 33, .12);
}

.official-anexo-i-page {
  page: anexo-i;
  font-size: 10pt;
  line-height: 1.25;
}

.official-form-header {
  margin-bottom: 4mm;
}

.official-service-masthead {
  display: grid;
  grid-template-columns: 20mm minmax(0, 1fr) 56mm;
  align-items: center;
  gap: 3mm;
  padding: 2.5mm 3mm;
  border-top: 1.5px solid #111;
  border-bottom: 1.5px solid #111;
}

.official-service-masthead img {
  display: block;
  width: 19mm;
  height: 19mm;
  object-fit: contain;
  filter: grayscale(1);
}

.official-government-lines {
  display: grid;
  gap: .5mm;
  text-align: left;
}

.official-government-lines strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12pt;
  line-height: 1;
}

.official-government-lines span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 7.5pt;
}

.official-government-lines b {
  font-size: 7.3pt;
}

.official-service-contact {
  display: grid;
  gap: .6mm;
  min-width: 0;
  padding-left: 3mm;
  border-left: 1px solid #111;
  font-size: 6.8pt;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.official-service-contact strong {
  font-size: 7.5pt;
}

.official-form-name {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4mm;
  padding: 2mm 2mm 0;
  text-align: center;
  font-weight: 700;
}

.official-form-name strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11pt;
}

.official-form-name span {
  font-size: 9.5pt;
}

.official-section-title {
  margin: 4mm 0 1.2mm;
  font-size: 11pt;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0;
}

.official-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  border-top: 1.2px solid #111;
  border-left: 1.2px solid #111;
}

.official-span-12 { grid-column: span 12; }
.official-span-8 { grid-column: span 8; }
.official-span-7 { grid-column: span 7; }
.official-span-6 { grid-column: span 6; }
.official-span-5 { grid-column: span 5; }
.official-span-4 { grid-column: span 4; }
.official-span-3 { grid-column: span 3; }
.official-span-1 { grid-column: span 1; }

.official-field {
  min-height: 11mm;
  padding: 1.2mm 1.5mm;
  border-right: 1.2px solid #111;
  border-bottom: 1.2px solid #111;
  overflow-wrap: anywhere;
}

.official-field-tall {
  min-height: 14mm;
}

.official-field-address {
  min-height: 15mm;
}

.official-field span,
.official-field b {
  display: block;
}

.official-field span {
  font-size: 8.5pt;
}

.official-field b {
  margin-top: 1.2mm;
  font-size: 10pt;
  font-weight: 500;
}

.official-fill-input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 5.2mm;
  margin-top: .7mm;
  padding: .6mm 1mm;
  border: 1px solid #c9a74a;
  border-radius: 2px;
  outline: none;
  background: #fffbea;
  color: #111;
  font: 500 10pt/1.25 Arial, Helvetica, sans-serif;
  letter-spacing: 0;
  box-sizing: border-box;
}

.official-fill-input:hover {
  border-color: #9d7823;
}

.official-fill-input:focus {
  border-color: #1d5f53;
  box-shadow: 0 0 0 2px rgba(29, 95, 83, .16);
  background: #fff;
}

.official-fill-input[readonly] {
  border-color: transparent;
  background: transparent;
}

.official-fill-inline {
  display: inline-block;
  width: min(62mm, 62%);
  min-height: 4.5mm;
  margin: 0 0 0 1mm;
  vertical-align: middle;
}

.official-classification {
  border: 1.2px solid #111;
}

.official-classification-group {
  padding: 1.1mm 2mm;
  border-bottom: 1px solid #111;
}

.official-classification-group:last-child {
  border-bottom: 0;
}

.official-option {
  display: flex;
  align-items: flex-start;
  gap: 1.5mm;
  min-height: 4.5mm;
  line-height: 4.2mm;
  cursor: pointer;
}

.official-classification-group .official-option {
  margin-left: 1mm;
}

.official-checkbox {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  flex: 0 0 4mm;
  width: 4mm;
  height: 4mm;
  margin: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid #111;
  border-radius: 0;
  background: #fff;
  font-size: 7pt;
  font-weight: 700;
  line-height: 1;
  box-sizing: border-box;
  cursor: pointer;
}

.official-checkbox:checked::after {
  content: "X";
  display: block;
  width: 100%;
  text-align: center;
  font: 700 7pt/3.6mm Arial, Helvetica, sans-serif;
}

.official-checkbox:focus-visible {
  outline: 2px solid #1d5f53;
  outline-offset: 1px;
}

.official-checkbox:disabled {
  opacity: 1;
  cursor: default;
}

.official-classification-continuation {
  margin-top: 1mm;
}

.official-small-business {
  padding: 1.5mm 2mm;
  line-height: 4.5mm;
}

.official-small-business .official-option {
  display: inline-flex;
  margin-left: 2mm;
  vertical-align: middle;
}

.official-request-box {
  padding: 1.5mm 2mm 2mm;
  border: 1.2px solid #111;
}

.official-request-box .official-option {
  min-height: 5mm;
  line-height: 4mm;
}

.official-alteration-title {
  margin: 3mm 0 1.5mm;
}

.official-commitment {
  padding: 2mm;
  border: 1.2px solid #111;
  font-size: 9pt;
  font-weight: 700;
  line-height: 1.35;
  text-align: justify;
}

.official-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 45mm;
  border: 1.2px solid #111;
}

.official-signature-meta,
.official-signature-people {
  padding: 2mm 3mm;
}

.official-signature-meta {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 1.2mm;
  border-right: 1.2px solid #111;
}

.official-signature-meta > .official-fill-input {
  align-self: stretch;
  margin: 0;
  border-width: 0 0 1px;
  border-color: #111;
  border-radius: 0;
  background: transparent;
}

.official-signature-people {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 5mm;
}

.official-signature-people div {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-align: center;
  font-size: 7.5pt;
}

.official-signature-line {
  display: block;
  min-height: 10mm;
  margin-bottom: 1.5mm;
  border-bottom: 1px solid #111;
}

.official-other-option > span {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: 1mm;
  white-space: nowrap;
}

.official-other-option .official-fill-inline {
  flex: 1;
  width: auto;
  max-width: none;
}

.official-document-page {
  page: official-document;
  position: relative;
  display: block;
  /* Texto de leitura em impressão: não reduzimos conteúdo para caber na folha. */
  font-size: 9pt;
  line-height: 1.25;
}

.official-document-page .official-form-header {
  margin-bottom: 2mm;
}

.official-document-page .official-service-masthead {
  grid-template-columns: 17mm minmax(0, 1fr) 52mm;
  gap: 2.5mm;
  padding: 1.7mm 2mm;
}

.official-document-page .official-service-masthead img {
  width: 16mm;
  height: 16mm;
}

.official-document-page .official-government-lines strong {
  font-size: 10.5pt;
}

.official-document-page .official-government-lines span {
  font-size: 6.8pt;
}

.official-document-page .official-government-lines b,
.official-document-page .official-service-contact {
  font-size: 6.2pt;
}

.official-document-page .official-form-name {
  gap: 3mm;
  padding-top: 1.5mm;
}

.official-document-page .official-form-name strong {
  font-size: 9.5pt;
}

.official-document-page .official-form-name span {
  font-size: 8.3pt;
}

.official-page-body {
  min-height: 0;
  padding-bottom: 6mm;
}

.official-page-index {
  position: absolute;
  right: 12mm;
  bottom: 5mm;
  left: 12mm;
  padding-top: 1mm;
  border-top: 1px solid #777;
  text-align: right;
  font-size: 5.8pt;
  color: #444;
}

.official-document-page .official-section-title {
  margin: 2.2mm 0 .8mm;
  font-size: 10pt;
}

.official-document-page .official-subsection-title {
  margin: 1.8mm 0 .6mm;
  font-size: 8.5pt;
}

.official-document-page .official-field {
  min-height: 10mm;
  padding: .8mm 1mm;
}

.official-document-page .official-field span {
  font-size: 7.5pt;
}

.official-document-page .official-fill-input {
  min-height: 4.8mm;
  margin-top: .4mm;
  padding: .35mm .7mm;
  font-size: 9.5pt;
}

.official-fill-textarea {
  height: var(--official-textarea-height);
  min-height: var(--official-textarea-height);
  resize: vertical;
  overflow: auto;
  white-space: pre-wrap;
}

.official-print-value,
.official-continuation-page {
  display: none;
}

.digital-pdf .official-page {
  border-color: #b9cfcd;
}

.digital-pdf .official-service-masthead {
  border-color: #123d50;
  background: linear-gradient(90deg, #edf7f5, #f8fbf1);
}

.digital-pdf .official-service-masthead img {
  filter: none;
}

.digital-pdf .official-form-name,
.digital-pdf .official-section-title {
  color: #0e5e55;
}

.digital-pdf .official-data-table th,
.digital-pdf .official-fixed-cell {
  background: #e8f1ee;
}

.digital-pdf .official-grid,
.digital-pdf .official-field,
.digital-pdf .official-data-table th,
.digital-pdf .official-data-table td,
.digital-pdf .official-fixed-copy,
.digital-pdf .official-box,
.digital-pdf .official-request-box,
.digital-pdf .official-document-signatures,
.digital-pdf .official-fiscal-signatures,
.digital-pdf .official-witness-grid {
  border-color: #749c96;
}

.official-document-page .official-option {
  min-height: 4mm;
  line-height: 3.7mm;
}

.official-document-page .official-checkbox {
  flex-basis: 3.5mm;
  width: 3.5mm;
  height: 3.5mm;
}

.official-inline-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2mm 5mm;
  padding: .8mm 1mm;
}

.official-box {
  border: 1.2px solid #111;
}

.official-option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5mm 4mm;
  padding: 1.2mm 2mm;
}

.official-two-column-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.official-two-column-options > .official-box {
  min-height: 36mm;
  padding: 1.5mm 2mm;
}

.official-two-column-options > .official-box + .official-box {
  border-left: 0;
}

.official-inline-entry {
  display: flex;
  align-items: center;
  gap: 1mm;
  margin-top: 1mm;
  white-space: nowrap;
}

.official-inline-entry .official-fill-inline {
  flex: 1;
  width: auto;
}

.official-instruction {
  margin: .6mm 0;
  font-size: 8pt;
  line-height: 1.25;
  text-align: justify;
}

.official-petition {
  padding: 2mm;
  border: 1.2px solid #111;
  font-size: 9pt;
  line-height: 1.35;
  text-align: justify;
}

.official-petition p {
  margin: 1.2mm 0 0;
}

.official-table-label {
  margin: 1.2mm 0 .6mm;
  font-size: 8pt;
  font-weight: 700;
}

.official-top-gap {
  margin-top: 1.5mm;
}

.official-continuation-grid {
  margin-top: 1mm;
}

.official-data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 8.5pt;
}

.official-data-table th,
.official-data-table td {
  height: 6.5mm;
  padding: .55mm .8mm;
  border: 1.1px solid #111;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.official-data-table th {
  background: #f1f2f1;
  text-align: center;
  font-size: 7.5pt;
}

.official-data-table .official-fill-input {
  min-height: 4.8mm;
  height: 4.8mm;
  margin: 0;
  padding: .2mm .5mm;
  font-size: 8.5pt;
}

.official-compact-table th,
.official-compact-table td {
  height: 5.5mm;
}

.official-col-number {
  width: 15%;
}

.official-fixed-cell {
  background: #fafafa;
  font-size: 7.5pt;
  font-weight: 700;
}

.official-composition-table th:first-child,
.official-composition-table td:first-child {
  width: 22%;
}

.official-composition-table th:nth-child(3),
.official-composition-table td:nth-child(3),
.official-composition-table th:nth-child(4),
.official-composition-table td:nth-child(4) {
  width: 13%;
}

.official-nutrition-table th:nth-child(2),
.official-nutrition-table td:nth-child(2),
.official-nutrition-table th:nth-child(3),
.official-nutrition-table td:nth-child(3) {
  width: 18%;
}

.official-nutrition-table th,
.official-nutrition-table td {
  height: 5.2mm;
}

.official-plant-list {
  display: grid;
  gap: .7mm;
  margin: 1.5mm 0 2mm;
  padding: 1.2mm 2mm;
  border: 1.2px solid #111;
  font-size: 8pt;
}

.official-document-signatures {
  display: grid;
  grid-template-columns: .8fr 1.1fr 1.1fr;
  min-height: 38mm;
  margin-top: 2mm;
  border: 1.2px solid #111;
}

.official-product-page .official-document-signatures {
  min-height: 31mm;
}

.official-document-signatures > div {
  display: flex;
  min-width: 0;
  padding: 1.5mm 2mm;
  flex-direction: column;
  justify-content: flex-end;
  border-left: 1px solid #111;
  text-align: center;
  font-size: 7.5pt;
}

.official-document-signatures > div:first-child {
  border-left: 0;
  justify-content: flex-start;
}

.official-document-signatures > div > span {
  flex: 1;
  min-height: 16mm;
  margin-bottom: 1.2mm;
  border-bottom: 1px solid #111;
}

.official-signature-location .official-fill-input {
  flex: 1;
  border-width: 0 0 1px;
  border-color: #111;
  border-radius: 0;
  background: transparent;
}

.official-fixed-copy {
  padding: 2.5mm;
  border: 1.2px solid #111;
  font-size: 9pt;
  line-height: 1.45;
  text-align: justify;
}

.official-fixed-copy .official-fill-inline {
  width: 22mm;
}

.official-fiscal-signatures,
.official-witness-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1.2px solid #111;
}

.official-fiscal-signatures > div,
.official-witness-grid > div {
  display: grid;
  gap: .7mm;
  min-height: 47mm;
  padding: 1.5mm 2mm;
}

.official-fiscal-signatures > div + div,
.official-witness-grid > div + div {
  border-left: 1px solid #111;
}

.official-fiscal-signatures strong {
  text-align: center;
  font-size: 8pt;
}

.official-fiscal-signatures label,
.official-witness-grid label {
  display: flex;
  align-items: center;
  gap: 1mm;
  font-size: 7.5pt;
}

.official-fiscal-signatures .official-fill-inline,
.official-witness-grid .official-fill-inline {
  flex: 1;
  width: auto;
}

.official-fiscal-science-line {
  min-height: 19mm;
}

.official-witness-grid > div {
  min-height: 30mm;
}

.official-copies-note {
  margin: 2mm 0 0;
  padding: 1.5mm;
  border: 1px solid #111;
  font-size: 7.5pt;
  line-height: 1.25;
}

/* Tela de preenchimento: conforto visual e hierarquia. A folha oficial volta
   integralmente ao preto e branco dentro de @media print, abaixo. */
@media screen {
  .official-form {
    color: #18312f;
  }

  .official-page {
    max-width: 1180px;
    min-height: 0;
    margin: 0 auto 26px;
    padding: 28px;
    border: 1px solid #d8e5e1;
    border-radius: 16px;
    background: linear-gradient(145deg, #ffffff 0%, #f7fbfa 100%);
    box-shadow: 0 16px 38px rgba(18, 61, 80, .10);
  }

  .official-service-masthead {
    padding: 14px 16px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(100deg, #e8f4f1, #f5f8e9);
    box-shadow: inset 0 0 0 1px #c9ddd6;
  }

  .official-service-masthead img {
    filter: none;
  }

  .official-service-contact {
    padding-left: 14px;
    border-color: #9bbab1;
  }

  .official-form-name {
    width: fit-content;
    margin: 14px auto 0;
    padding: 8px 14px;
    border-radius: 999px;
    background: #0e5e55;
    color: #fff;
    box-shadow: 0 6px 16px rgba(14, 94, 85, .18);
  }

  .official-form-name strong,
  .official-form-name span {
    color: inherit;
  }

  .official-section-title {
    margin: 24px 0 10px;
    padding: 9px 12px;
    border-left: 4px solid #d5a725;
    border-radius: 5px;
    background: #edf6f3;
    color: #0e5e55;
    font-size: 10.5pt;
  }

  .official-grid {
    gap: 8px;
    border: 0;
  }

  .official-field {
    min-height: 72px;
    padding: 10px 12px;
    border: 1px solid #c8dbd5;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(18, 61, 80, .04);
  }

  .official-document-page .official-field {
    min-height: 64px;
    padding: 9px 10px;
  }

  .official-field span,
  .official-document-page .official-field span {
    margin-bottom: 4px;
    color: #3e615b;
    font-size: 8pt;
    font-weight: 700;
  }

  .official-fill-input {
    border-color: #b6cec7;
    border-radius: 6px;
    background: #fcfffe;
  }

  .official-fill-input:focus {
    border-color: #0e7d70;
    box-shadow: 0 0 0 3px rgba(14, 125, 112, .14);
  }

  .official-data-table {
    overflow: hidden;
    border: 1px solid #c8dbd5;
    border-radius: 10px;
    background: #fff;
  }

  .official-data-table th,
  .official-data-table td {
    border-color: #c8dbd5;
  }

  .official-data-table th,
  .official-fixed-cell {
    background: #eaf4f1;
    color: #24554d;
  }

  .official-fixed-copy,
  .official-box,
  .official-request-box,
  .official-commitment,
  .official-document-signatures,
  .official-fiscal-signatures,
  .official-witness-grid,
  .official-copies-note {
    border-color: #b8d0ca;
    border-radius: 10px;
    background: #fff;
  }

  .official-page-index {
    margin-top: 18px;
    color: #5f7e78;
    font-weight: 700;
  }
}

.official-signature-page .official-document-signatures {
  min-height: 85mm;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: #182321;
  color: white;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  transform: translateY(90px);
  opacity: 0;
  transition: .2s ease;
  z-index: 20;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.empty {
  border: 1px dashed #b9c5c1;
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: #fbfcfa;
}

@media (max-width: 960px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .metrics,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .span-8,
  .span-7,
  .span-6,
  .span-5,
  .span-4,
  .span-3 {
    grid-column: span 12;
  }

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

  .content {
    padding: 18px;
  }

  .print-sheet {
    max-width: 100%;
    padding: 16px;
    overflow-x: hidden;
  }

  .print-sheet h2 {
    font-size: 14px;
    line-height: 1.25;
  }

  .print-table {
    font-size: 12px;
  }

  .print-table th,
  .print-table td {
    display: block;
    width: 100%;
    min-height: 30px;
  }

  .signature {
    grid-template-columns: 1fr;
  }

  .upload-row {
    grid-template-columns: 1fr;
  }

  .upload-controls {
    justify-content: flex-start;
  }

  .document-main,
  .version-row,
  .modal-header {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .modal-meta {
    grid-template-columns: 1fr;
  }

  .roadmap {
    grid-template-columns: 1fr;
  }

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

  .print-brand {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .print-brand::after {
    display: none;
  }

  .print-brand img {
    width: 54px;
    height: 54px;
  }
}

@media screen and (max-width: 600px) {
  .official-page {
    padding: 8mm 6mm;
  }

  .official-service-masthead {
    grid-template-columns: 17mm minmax(0, 1fr);
    gap: 2mm;
  }

  .official-service-masthead img {
    width: 16mm;
    height: 16mm;
  }

  .official-government-lines strong {
    font-size: 8.5pt;
  }

  .official-government-lines b,
  .official-government-lines span {
    font-size: 6.2pt;
  }

  .official-service-contact {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
    padding: 1.5mm 0 0;
    border-top: 1px solid #111;
    border-left: 0;
  }

  .official-form-name {
    align-items: center;
    flex-direction: column;
    gap: .8mm;
  }

  .official-fill-input {
    font-size: 7pt;
  }

  .official-document-page .official-service-masthead {
    grid-template-columns: 15mm minmax(0, 1fr);
    gap: 2mm;
  }

  .official-document-page .official-service-masthead img {
    width: 14mm;
    height: 14mm;
  }

  .official-document-page .official-government-lines strong {
    font-size: 8.2pt;
  }

  .official-document-page .official-government-lines span,
  .official-document-page .official-government-lines b {
    font-size: 5.8pt;
  }

  .official-document-page .official-service-contact {
    grid-column: 1 / -1;
    padding: 1.2mm 0 0;
    border-top: 1px solid #111;
    border-left: 0;
  }
}

@media print {
  @page anexo-i {
    size: A4 portrait;
    margin: 8mm;
  }

  @page official-document {
    size: A4 portrait;
    margin: 8mm;
  }

  body {
    background: white;
  }

  .sidebar,
  .topbar,
  .tabs,
  .actions,
  .no-print {
    display: none !important;
  }

  .app,
  .main,
  .content {
    display: block;
    padding: 0;
  }

  .panel,
  .print-sheet {
    box-shadow: none;
    border: 0;
  }

  .print-sheet {
    max-width: none;
  }

  .official-form {
    margin: 0;
  }

  .official-page {
    width: auto;
    max-width: none;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    break-after: page;
    page-break-after: always;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

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

  .official-document-page {
    height: 281mm;
  }

  .official-document-page + .official-document-page {
    break-before: page;
    page-break-before: always;
  }

  .official-document-page .official-form-header {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .official-document-page .official-page-index {
    right: 0;
    bottom: 0;
    left: 0;
  }

  .official-fill-input,
  .official-fill-input:hover,
  .official-fill-input:focus,
  .official-fill-input[readonly] {
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
    color: #111;
  }

  .official-fill-inline {
    border-bottom: 1px solid #111;
  }

  .official-fill-textarea {
    display: none;
  }

  .official-print-value {
    display: block;
    min-height: var(--official-textarea-height);
    padding: .8mm;
    border: 1.1px solid #111;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 9.5pt;
    line-height: 1.3;
  }

  .official-continuation-page {
    display: block;
  }

  .official-continuation-body {
    display: grid;
    gap: 3mm;
  }

  .official-continuation-description {
    margin: 0;
    color: #444;
    font-size: 9pt;
    font-weight: 700;
  }

  .official-continuation-text {
    min-height: 220mm;
    padding: 3mm;
    border: 1.1px solid #111;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 10pt;
    line-height: 1.45;
  }

  .official-service-masthead img {
    filter: grayscale(1);
  }

  body.digital-pdf .official-service-masthead img {
    filter: none;
  }

  body.digital-pdf .official-service-masthead {
    border-color: #123d50;
    background: #edf7f5;
  }

  body.digital-pdf .official-form-name,
  body.digital-pdf .official-section-title {
    color: #0e5e55;
  }

  body.digital-pdf .official-data-table th,
  body.digital-pdf .official-fixed-cell {
    background: #e8f1ee;
  }

  body.digital-pdf .official-grid,
  body.digital-pdf .official-field,
  body.digital-pdf .official-data-table th,
  body.digital-pdf .official-data-table td,
  body.digital-pdf .official-print-value,
  body.digital-pdf .official-continuation-text,
  body.digital-pdf .official-fixed-copy,
  body.digital-pdf .official-box,
  body.digital-pdf .official-request-box,
  body.digital-pdf .official-document-signatures,
  body.digital-pdf .official-fiscal-signatures,
  body.digital-pdf .official-witness-grid {
    border-color: #749c96;
  }

  .official-section-title,
  .official-grid,
  .official-classification,
  .official-request-box,
  .official-commitment,
  .official-signatures,
  .official-data-table,
  .official-document-signatures,
  .official-fiscal-signatures,
  .official-witness-grid {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* --- Jornada guiada do estabelecimento --- */
.journey-score {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--green);
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin: 6px 0 14px;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--green-2));
  transition: width .4s ease;
}

.next-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: 12px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  margin-bottom: 14px;
}

.next-action strong { display: block; }
.next-action span { color: #4b5563; font-size: .85rem; }
.next-action.done { background: #f0fdf4; }

.journey-steps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.journey-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  font: inherit;
  transition: border-color .15s, box-shadow .15s;
}

.journey-step:hover { border-color: var(--green-2); box-shadow: 0 4px 14px rgba(29,95,83,.12); }
.journey-step.done { background: #f0fdf4; border-color: #bbf7d0; }
.journey-step.current { border-color: var(--green); box-shadow: 0 0 0 2px rgba(29,95,83,.15); }

.step-badge {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8rem;
  background: #e2e8f0;
  color: #334155;
}

.journey-step.done .step-badge { background: var(--green); color: #fff; }
.journey-step.current .step-badge { background: #fff; border: 2px solid var(--green); color: var(--green); }

.step-text strong { display: block; font-size: .88rem; line-height: 1.3; }
.step-text span { font-size: .76rem; color: #64748b; line-height: 1.4; display: block; margin-top: 2px; }

.banner-warn {
  padding: 14px 16px;
  border-radius: 12px;
  background: #fefce8;
  border: 1px solid #fde68a;
  color: #713f12;
  font-size: .9rem;
  line-height: 1.5;
}

.banner-warn strong { display: block; }

.banner-warn.legal-why {
  background: #eef7f4;
  border-color: #b7d9d0;
  color: #17463d;
}

.doc-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #334155;
  font-size: .75rem;
  font-weight: 700;
  margin-right: 8px;
  vertical-align: middle;
}

.doc-number.ok { background: var(--green); color: #fff; }

.document-card.received { border-left: 3px solid var(--green); }

.doc-hint {
  display: block;
  font-size: .78rem;
  color: #64748b;
  margin: 3px 0;
  line-height: 1.45;
}

.doc-hint a { color: var(--green); font-weight: 600; }

.doc-source {
  display: block;
  margin: 6px 0;
  padding: 7px 9px;
  border-left: 3px solid var(--green);
  background: #eef7f4;
  color: #31524b;
  font-size: .76rem;
  line-height: 1.45;
}

.doc-source strong {
  display: inline;
  font-size: inherit;
}

.doc-source a {
  color: var(--green);
  font-weight: 700;
  text-decoration: none;
}

.doc-source a:hover {
  text-decoration: underline;
}

.doc-guidance {
  display: block;
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid #d8e6e1;
  border-radius: 8px;
  background: #fbfdfc;
  color: #2f4742;
  font-size: .78rem;
  line-height: 1.45;
}

.doc-guidance strong {
  display: block;
  margin-bottom: 6px;
  font-size: .82rem;
}

.doc-guidance ol {
  margin: 0 0 8px 18px;
  padding: 0;
}

.doc-guidance li {
  margin-bottom: 4px;
}

.doc-guidance p {
  margin: 8px 0 0;
}

.doc-guidance-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.doc-guidance-links a {
  color: var(--green);
  font-weight: 700;
}

.doc-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.doc-quick-actions .btn {
  min-height: 32px;
  padding: 0 10px;
  font-size: .8rem;
}

.official-annex-section {
  display: grid;
  gap: 12px;
}

.official-annex-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 2px;
}

.official-annex-header h2,
.official-annex-header p {
  margin: 0;
}

.official-annex-header p {
  max-width: 780px;
  margin-top: 4px;
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.45;
}

.annex-law {
  flex: 0 0 auto;
  color: #475569;
  font-size: .75rem;
  font-weight: 700;
}

.official-annex-list {
  display: grid;
  gap: 16px;
}

.document-card.official-annex {
  padding: 0;
  overflow: hidden;
  background: white;
  border: 1px solid #d9e3df;
  border-top: 4px solid var(--green);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(23, 49, 45, .06);
}

.document-card.official-annex.received {
  border-color: #bcd8ce;
  border-top-color: #19745e;
}

.document-card.registry-document {
  padding: 0;
  overflow: hidden;
  border: 1px solid #dce5e2;
  border-top: 3px solid #b8c9c4;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(23, 49, 45, .045);
}

.document-card.registry-document.required {
  border-top-color: #397d6e;
}

.document-card.registry-document.received {
  border-color: #bdd8cf;
  border-top-color: #19745e;
}

.document-card.registry-document.internal {
  border-color: #cfe0ef;
  border-top-color: #5c83a5;
  background: #fbfdff;
}

.registry-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 16px 11px;
}

.registry-card-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.registry-card-identity h3 {
  margin: 2px 0 0;
  color: #203a35;
  font-size: .94rem;
  line-height: 1.35;
}

.registry-card-kicker {
  display: block;
  color: #6c7e79;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.registry-document-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #edf4f1;
  color: #236555;
  font-size: .78rem;
  font-weight: 800;
}

.registry-document-number svg {
  width: 18px;
  height: 18px;
}

.registry-card-intro {
  margin: 0;
  padding: 0 16px 14px 68px;
  color: #687773;
  font-size: .78rem;
  line-height: 1.45;
}

.registry-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid #e4ebe8;
  border-bottom: 1px solid #e4ebe8;
  background: #fbfcfb;
}

.registry-flow .annex-flow-step {
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: minmax(92px, 1fr) auto;
  gap: 9px 8px;
  padding: 14px;
}

.registry-flow .annex-step-number {
  width: 25px;
  height: 25px;
  font-size: .7rem;
}

.registry-flow .annex-step-copy strong {
  font-size: .84rem;
}

.registry-flow .annex-step-copy p {
  margin-top: 5px;
  font-size: .72rem;
}

.registry-flow .annex-step-actions {
  gap: 7px;
}

.registry-flow .annex-step-actions .btn {
  min-height: 34px;
  padding: 0 10px;
  font-size: .76rem;
}

.registry-file-summary {
  max-height: 3.1em;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.registry-document .annex-card-details-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: #fff;
}

.annex-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px 14px;
}

.annex-card-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.annex-card-identity h3 {
  margin: 2px 0 0;
  color: #18312f;
  font-size: 1.08rem;
  line-height: 1.3;
}

.annex-card-kicker {
  display: block;
  color: #58706a;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.official-annex-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin: 0;
  border-radius: 12px;
  background: #e7f3ef;
  color: #145b4c;
  font-size: 1rem;
  font-weight: 800;
}

.official-annex-number svg {
  width: 20px;
  height: 20px;
}

.annex-card-status {
  flex: 0 0 auto;
}

.annex-card-status label {
  display: grid;
  gap: 4px;
}

.annex-card-status label > span {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 700;
}

.annex-card-status select {
  min-width: 150px;
}

.annex-card-intro {
  max-width: 920px;
  margin: 0;
  padding: 0 20px 18px 78px;
  color: #5d6d69;
  font-size: .86rem;
  line-height: 1.5;
}

.annex-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid #e1e9e6;
  border-bottom: 1px solid #e1e9e6;
  background: #fbfcfb;
}

.annex-flow-step {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  grid-template-rows: minmax(116px, 1fr) auto;
  gap: 12px 10px;
  min-width: 0;
  padding: 18px;
  border-right: 1px solid #e1e9e6;
}

.annex-flow-step:last-child {
  border-right: 0;
}

.annex-flow-step.is-complete {
  background: #f1f8f5;
}

.annex-step-number {
  display: inline-flex;
  grid-row: 1 / span 2;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid #b5ccc5;
  border-radius: 999px;
  background: #fff;
  color: #1f6255;
  font-size: .78rem;
  font-weight: 800;
}

.annex-flow-step.is-complete .annex-step-number {
  border-color: #1d745f;
  background: #1d745f;
  color: #fff;
}

.annex-step-number svg {
  width: 15px;
  height: 15px;
}

.annex-step-copy {
  min-width: 0;
}

.annex-step-kicker {
  display: block;
  margin-bottom: 5px;
  color: #68807a;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.annex-step-copy strong {
  display: block;
  color: #203b36;
  font-size: .94rem;
  line-height: 1.35;
}

.annex-step-copy p {
  margin: 7px 0 0;
  color: #687773;
  font-size: .8rem;
  line-height: 1.45;
}

.annex-step-actions {
  display: flex;
  grid-column: 2;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.annex-step-actions .btn {
  min-height: 38px;
  padding: 0 12px;
}

.annex-text-link {
  color: #27685b;
  font-size: .76rem;
  font-weight: 700;
  text-decoration: none;
}

.annex-text-link:hover {
  text-decoration: underline;
}

.annex-upload-button {
  position: relative;
  cursor: pointer;
}

.annex-upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.annex-upload-button:focus-within {
  outline: 3px solid rgba(29, 116, 95, .2);
  outline-offset: 2px;
}

.annex-current-file {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 16px 20px;
  padding: 13px 14px;
  border: 1px solid #dce7e3;
  border-radius: 10px;
  background: #f8fbfa;
}

.annex-current-file.empty-state {
  grid-template-columns: 38px minmax(0, 1fr);
  border-style: dashed;
  background: #fcfdfc;
}

.annex-current-file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #e6f2ee;
  color: #1d6959;
}

.annex-current-file > div:nth-child(2) {
  min-width: 0;
}

.annex-current-file span,
.annex-current-file strong,
.annex-current-file small {
  display: block;
}

.annex-current-file span {
  color: #70807c;
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.annex-current-file strong {
  margin-top: 2px;
  overflow: hidden;
  color: #263e39;
  font-size: .86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.annex-current-file small {
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: #788681;
  font-size: .72rem;
}

.annex-file-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.annex-file-actions .btn {
  min-height: 34px;
  padding: 0 11px;
}

.annex-card-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  border-top: 1px solid #e7ecea;
}

.annex-details {
  min-width: 0;
  border-right: 1px solid #e7ecea;
}

.annex-details:last-child {
  border-right: 0;
}

.annex-details summary {
  display: flex;
  min-height: 46px;
  padding: 0 20px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #435c56;
  font-size: .78rem;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}

.annex-details summary::-webkit-details-marker {
  display: none;
}

.annex-details summary::after {
  content: "+";
  margin-left: auto;
  color: #1d6959;
  font-size: 1.05rem;
  font-weight: 500;
}

.annex-details[open] summary::after {
  content: "−";
}

.annex-details-count {
  margin-left: auto;
  color: #7b8985;
  font-size: .68rem;
  font-weight: 700;
}

.annex-details-count {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #edf3f1;
}

.annex-details-content,
.annex-history {
  padding: 0 20px 16px;
}

.annex-details-content p {
  margin: 0 0 9px;
  color: #5d6d69;
  font-size: .78rem;
  line-height: 1.5;
}

.annex-details-content .doc-source {
  margin: 0;
}

.annex-history {
  display: grid;
  gap: 8px;
}

.annex-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #e1e8e5;
  border-radius: 8px;
  background: #fbfcfc;
}

.annex-history-row strong,
.annex-history-row span {
  display: block;
}

.annex-history-row strong {
  color: #304943;
  font-size: .78rem;
}

.annex-history-row span {
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: #7a8783;
  font-size: .7rem;
}

.annex-focus-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 15px;
  border: 1px solid #b7d9d0;
  border-left: 4px solid var(--green);
  background: #eef7f4;
}

.annex-focus-banner strong,
.annex-focus-banner span {
  display: block;
}

.annex-focus-banner span {
  margin-top: 3px;
  color: #47615b;
  font-size: .8rem;
}

.form-anchor {
  scroll-margin-top: 96px;
}

.document-support-panel {
  display: grid;
  grid-template-columns: 1.1fr .85fr 1fr;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.document-support-block {
  min-width: 0;
  padding: 18px 20px;
}

.document-support-block + .document-support-block {
  border-left: 1px solid var(--line);
}

.document-support-block .panel-header {
  margin-bottom: 10px;
}

.document-support-block .panel-header h2 {
  font-size: .95rem;
}

.document-support-check {
  margin-top: 12px;
}

.support-feature {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 11px;
  border-radius: 9px;
  background: #f0f7f4;
  color: #2d5e53;
}

.support-feature svg {
  flex: 0 0 auto;
  margin-top: 2px;
}

.support-feature span,
.support-feature strong {
  display: block;
}

.support-feature span {
  font-size: .75rem;
  line-height: 1.4;
}

.support-feature strong {
  margin-bottom: 2px;
}

.signer-steps {
  margin: 0 0 12px 18px;
  padding: 0;
  font-size: .85rem;
  color: #475569;
  line-height: 1.6;
}

.signer-steps li { margin-bottom: 6px; }

@media (max-width: 960px) {
  .official-annex-header,
  .annex-card-head,
  .registry-card-head,
  .annex-focus-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .annex-card-intro,
  .registry-card-intro {
    padding-left: 20px;
  }

  .annex-card-status,
  .annex-card-status label,
  .annex-card-status select {
    width: 100%;
  }

  .annex-flow,
  .registry-flow {
    grid-template-columns: 1fr;
  }

  .annex-flow .annex-flow-step,
  .registry-flow .annex-flow-step {
    grid-template-rows: auto auto;
    border-right: 0;
    border-bottom: 1px solid #e1e9e6;
  }

  .annex-flow-step:last-child {
    border-bottom: 0;
  }

  .annex-current-file,
  .annex-history-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .annex-current-file .annex-file-actions,
  .annex-history-row .annex-file-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .annex-details {
    border-right: 0;
    border-bottom: 1px solid #e7ecea;
  }

  .document-support-panel {
    grid-template-columns: 1fr;
  }

  .document-support-block + .document-support-block {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .form-anchor {
    scroll-margin-top: 190px;
  }
}

@media (max-width: 600px) {
  .registry-document .annex-card-details-grid {
    grid-template-columns: 1fr;
  }
}
