html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Responsive table folding */
/* Usage: add class .table-fold to a table. Optionally set data-fold-visible="3" to control visible columns on small screens. */

/* Base rules (apply to all viewports) */
.table-fold .fold-details-row {
  display: none; /* keep details hidden on desktop by default */
}
.table-fold .fold-toggle {
  display: none; /* show only on small screens */
}

@media (max-width: 576px) {
  .table-fold {
    width: 100%;
    table-layout: fixed;
  }

  /* Default: keep first 3 columns visible on small screens */
  .table-fold.fold-3 th:nth-child(n+4),
  .table-fold.fold-3 td:nth-child(n+4) {
    display: none;
  }

  /* Variants (in case developer sets a class explicitly) */
  .table-fold.fold-2 th:nth-child(n+3),
  .table-fold.fold-2 td:nth-child(n+3) { display: none; }
  .table-fold.fold-4 th:nth-child(n+5),
  .table-fold.fold-4 td:nth-child(n+5) { display: none; }
  .table-fold.fold-5 th:nth-child(n+6),
  .table-fold.fold-5 td:nth-child(n+6) { display: none; }

  /* Toggle button inside first visible cell: green circular + */
  .table-fold .fold-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    background: #28a745; /* Bootstrap success */
    color: #fff;
    border: none;
    cursor: pointer;
  }

  /* Details row container */
  .table-fold .fold-details-row {
    background: var(--bs-tertiary-bg, #f8f9fa);
  }
  .table-fold .fold-details-cell {
    padding: .5rem 1rem;
  }
  .table-fold .fold-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: .25rem .75rem;
    font-size: .9rem;
  }
  .table-fold .fold-item {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    border-bottom: 1px dashed #e2e6ea;
    padding: .125rem 0;
  }
  .table-fold .fold-item .k {
    color: var(--bs-secondary-color, #6c757d);
  }
  .table-fold .fold-item .v {
    font-weight: 500;
  }

  /* When row expanded, show details row */
  .table-fold tr.expanded + tr.fold-details-row {
    display: table-row;
  }
}