<style>
  * { box-sizing: border-box; }
  @page { size: A4; margin: 18mm 14mm; }

  body {
    margin: 0;
    background: #f5f7fb;
    color: #111827;
    font-family: "Times New Roman", Times, serif;
    font-size: 10.5pt;
    line-height: 1.48;
  }

  .contract {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    background: #fff;
    padding: 18mm 15mm;
  }

  h1, h2, h3, p { margin-top: 0; }
  h1 {
    color: #0f2742;
    font-size: 18pt;
    line-height: 1.25;
    margin-bottom: 10px;
    text-align: center;
    text-transform: uppercase;
  }
  h2 {
    border-bottom: 1.5px solid #1e3a5f;
    color: #1e3a5f;
    font-size: 12pt;
    letter-spacing: 0.03em;
    margin: 18px 0 10px;
    padding-bottom: 5px;
    text-transform: uppercase;
  }
  h3 {
    color: #0f2742;
    font-size: 10.8pt;
    margin: 12px 0 6px;
  }
  p { margin-bottom: 8px; }
  ol { margin: 6px 0 0; padding-left: 20px; }
  li { margin-bottom: 5px; }

  .page-section,
  .article {
    margin-bottom: 18px;
    page-break-inside: avoid;
  }

  .brand-row {
    align-items: center;
    border-bottom: 3px solid #1e3a5f;
    display: flex;
    gap: 14px;
    padding-bottom: 14px;
  }
  .logo-mark {
    align-items: center;
    background: #1e3a5f;
    border-radius: 8px;
    color: #fff;
    display: flex;
    font-family: Arial, sans-serif;
    font-size: 16pt;
    font-weight: 700;
    height: 52px;
    justify-content: center;
    letter-spacing: 0.08em;
    width: 72px;
  }
  .kicker {
    color: #1e3a5f;
    font-family: Arial, sans-serif;
    font-size: 10pt;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
    text-transform: uppercase;
  }
  .muted {
    color: #6b7280;
    font-family: Arial, sans-serif;
    font-size: 9pt;
    margin: 0;
  }

  .cover {
    min-height: 255mm;
    position: relative;
  }
  .cover-title {
    margin: 54mm 0 34mm;
    text-align: center;
  }
  .document-label {
    color: #6b7280;
    font-family: Arial, sans-serif;
    font-size: 10pt;
    font-weight: 700;
    letter-spacing: 0.12em;
    margin-bottom: 10px;
    text-transform: uppercase;
  }
  .summary-line {
    color: #374151;
    font-family: Arial, sans-serif;
    font-size: 9.5pt;
    margin-top: 12px;
  }

  table {
    border-collapse: collapse;
    width: 100%;
  }
  .meta-grid,
  .details-table,
  .schedule {
    font-size: 9.5pt;
    margin: 10px 0 16px;
  }
  .meta-grid th,
  .meta-grid td,
  .details-table th,
  .details-table td,
  .schedule th,
  .schedule td {
    border: 1px solid #cbd5e1;
    padding: 7px 8px;
    text-align: left;
    vertical-align: top;
  }
  .meta-grid th,
  .details-table th,
  .schedule th {
    background: #eef4fb;
    color: #1e3a5f;
    font-family: Arial, sans-serif;
    font-size: 8.5pt;
    text-transform: uppercase;
  }
  .schedule tbody tr:nth-child(even) td { background: #f8fafc; }
  .total-row td {
    background: #e8f0f8 !important;
    color: #0f2742;
    font-weight: 700;
  }

  .lead {
    color: #374151;
    font-size: 10.5pt;
  }
  .party-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 1fr;
  }
  .party-card {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px;
  }
  .party-card h3 {
    background: #1e3a5f;
    border-radius: 5px;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 9pt;
    margin: 0 0 10px;
    padding: 7px 9px;
    text-transform: uppercase;
  }
  .party-name {
    color: #0f2742;
    font-weight: 700;
    margin-bottom: 8px;
  }
  dl {
    display: grid;
    grid-template-columns: 32% 68%;
    margin: 0;
  }
  dt {
    color: #475569;
    font-family: Arial, sans-serif;
    font-size: 8.5pt;
    font-weight: 700;
    padding: 2px 6px 2px 0;
  }
  dd {
    margin: 0;
    padding: 2px 0;
  }

  .signatures {
    display: grid;
    gap: 18px;
    grid-template-columns: 1fr 1fr;
    margin-top: 24px;
    page-break-inside: avoid;
  }
  .sig-block {
    border: 1.5px solid #1e3a5f;
    border-radius: 8px;
    min-height: 96mm;
    padding: 12px;
  }
  .sig-title {
    color: #1e3a5f;
    font-family: Arial, sans-serif;
    font-size: 9pt;
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: uppercase;
  }
  .sig-image-box {
    align-items: center;
    border: 1px dashed #94a3b8;
    display: flex;
    height: 28mm;
    justify-content: center;
    margin: 14px 0;
  }
  .sig-image-box img {
    display: block;
    max-height: 24mm;
    max-width: 70mm;
  }
  .sig-placeholder {
    color: #94a3b8;
    font-family: Arial, sans-serif;
    font-size: 8.5pt;
  }
  .sig-line {
    border-top: 1px solid #111827;
    margin-top: 16px;
    padding-top: 5px;
  }
  .sig-meta {
    color: #475569;
    font-size: 9pt;
    margin: 4px 0;
  }

  @media print {
    body { background: #fff; }
    .contract {
      margin: 0;
      padding: 0;
      width: auto;
    }
    .cover { page-break-after: always; }
  }
</style>
