body {
  font-family: 'Inter', sans-serif;
  background: #f8f9fa;
  margin: 0;
  padding: 0;
}

/* Base styles */
.document-header {
  font-size: 0.95rem;
  background-color: #e9ecef;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  display: flex;
  flex-wrap: wrap;
}

.header-description {
  flex: 1;
  min-width: 200px;
}

.header-buttons {
  min-width: 180px;
  text-align: right;
}

.document-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.25rem;
  margin-bottom: 0.2rem;
  flex-wrap: wrap;
}

.document-description {
  flex: 1;
  font-size: 0.95rem;
  color: #333;
  min-width: 200px;
}

.download-buttons {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  width: 100%;
}

/* Default button style */
.btn-download {
  background-color: #007bff;
  color: white;
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
  text-decoration: none;
  flex: 1; /* allow buttons to grow and fill space */
  text-align: center;
  transition: background-color 0.3s ease;
}

.btn-download:hover {
  background-color: #0056b3;
}

hr {
  margin: 0.2rem 0;
}

/* 📱 Mobile (up to 576px) */
@media (max-width: 576px) {
  .document-header {
    flex-direction: column;
    text-align: center;
  }

  .header-buttons {
    text-align: center;
    margin-top: 0.5rem;
    min-width: auto;
  }

  .document-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .document-description {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }

  .btn-download {
    width: 100%;
  }
}

/* 📲 Tablets (577px–768px) */
@media (min-width: 577px) and (max-width: 768px) {
  .document-header {
    font-size: 1rem;
  }

  .document-description {
    font-size: 1rem;
  }

  .btn-download {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
  }
}

/* 💻 Larger screens (769px+) */
@media (min-width: 769px) {
  .document-header {
    font-size: 1.05rem;
  }

  .document-description {
    font-size: 1rem;
  }

  .btn-download {
    font-size: 0.9rem;
  }
}

/* ✅ Special case: fewer than 3 buttons */
/* Single button → full width */
.download-buttons:has(.btn-download:nth-child(1):nth-last-child(1)) .btn-download {
  width: 100%;
}

/* Two buttons → split evenly */
.download-buttons:has(.btn-download:nth-child(1):nth-last-child(2)) .btn-download {
  width: 50%;
}