.responsive-table {
  margin-bottom: 1.5rem;
  border-radius: 0.75rem;
  background: #ffffff;
  border: 1px solid #dee2e6;
  overflow: hidden;
}
.responsive-table-header,
.responsive-table-row {
  display: grid;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  align-items: center;
}
.responsive-table-header {
  background: #f8f9fa;
  font-weight: 700;
  color: #212529;
}
.responsive-table-row {
  border-top: 1px solid #dee2e6;
}
.responsive-table-row:first-child {
  border-top: none;
}
.responsive-table-cell {
  padding: 0.5rem 0.75rem;
  word-break: break-word;
}
.responsive-table-cell.header-cell {
  text-transform: uppercase;
  font-size: 0.95rem;
  color: #495057;
}
@media (min-width: 992px) {
  .responsive-table-header,
  .responsive-table-row {
    grid-template-columns: repeat(var(--columns, 1), minmax(0, 1fr));
  }
}
@media (max-width: 991.98px) {
  .responsive-table-header {
    display: none;
  }
  .responsive-table-row {
    grid-template-columns: 1fr;
  }
  .responsive-table-cell {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid #e9ecef;
  }
  .responsive-table-cell:last-child {
    border-bottom: none;
  }
  .responsive-table-cell::before {
    content: attr(data-label);
    font-weight: 700;
    margin-right: 0.75rem;
    color: #495057;
    flex-shrink: 0;
    min-width: 110px;
    white-space: nowrap;
  }
}

/* Keep nested tables from breaking layout when not fully converted */
.responsive-table .responsive-table-cell > .table-responsive {
  width: 100%;
}


/* Global responsiveness for images and embedded content */
img, picture, svg, iframe, embed, object, video {
  max-width: 100%;
  height: auto;
  display: block;
}

body {
  min-width: 0;
  word-wrap: break-word;
}

.container, .row, .col, .card, .content-card, .ui-body-a {
  box-sizing: border-box;
}

/* Ensure mobile buttons and links remain tappable */
a, button, input, textarea, select {
  word-break: break-word;
}

/* ==========================================================================
   Unified typography scale
   - Base body: 1rem (16px)
   - Small/caption: 0.875rem (14px)
   - h2/h3 sizes are declared per-page (1.75rem / 1.3rem) and kept as-is
   Legacy database pages defined .style4–.style9 with 10–12px hard-coded
   sizes; the rules below normalize them to the unified scale. !important
   is required because the legacy <style> blocks are emitted after this
   stylesheet in the document head.
   ========================================================================== */
body {
  font-size: 1rem;
}
.style4,
.style6 {
  font-size: 0.875rem !important;
}
.style5,
.style7,
.style9 {
  font-size: 1rem !important;
  line-height: 1.6 !important;
}
