body {
  font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #212529;
}

h1, .h1 { font-size: 1.75rem; font-weight: 600; color: #494949; }
h2, .h2 { font-size: 1.5rem; font-weight: 600; color: #494949; }
h3, .h3 { font-size: 1.25rem; font-weight: 600; color: #494949; }

.error { color: red; display: block; font-size: 12px; margin-top: 4px; }

.status-toggle { position: relative; display: inline-block; width: 44px; height: 24px; margin-bottom: 0; cursor: pointer; }
.status-toggle input { opacity: 0; width: 0; height: 0; }
.status-slider { position: absolute; inset: 0; background-color: #dc3545; border-radius: 24px; transition: .3s; }
.status-slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: #fff; border-radius: 50%; transition: .3s; }
.status-toggle input:checked + .status-slider { background-color: #28a745; }
.status-toggle input:checked + .status-slider:before { transform: translateX(20px); }

.scale-badge { display: inline-block; padding: 3px 8px; font-size: 12px; color: #fff; border-radius: 3px; }
.scale-word { background: #17a2b8; }
.scale-number { background: #28a745; }
.scale-other { background: #6c757d; }
.phase-badge { display: inline-block; padding: 3px 8px; font-size: 12px; background: #17a2b8; color: #fff; border-radius: 3px; }
.type-badge { display: inline-block; padding: 3px 8px; font-size: 12px; background: #6f42c1; color: #fff; border-radius: 3px; }

mark, .mark { background-color: #ffeb00; padding: 0.1em; }

.title-text { max-width: 220px; }
.purpose-text { max-width: 300px; }

.content-header {
  padding: 15px .5rem;
}

.content-header > .container-fluid {
  padding: 0;
}

.content-header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  color: #494949;
  margin: 0;
}

.content-header .breadcrumb {
  background: transparent;
  padding: 0;
  margin: 0;
  font-size: .9rem;
}

.content-header .breadcrumb-item + .breadcrumb-item::before {
  color: #6c757d;
}

.content-header .breadcrumb-item.active {
  color: #6c757d;
}

.content-header .breadcrumb-item a {
  color: #007bff;
  text-decoration: none;
}

.content-header .breadcrumb-item a:hover {
  color: #0056b3;
}

/* The React modal renders its footer inside the padded modal body, so it
   is pulled flush with the sheet edges to match the PHP modal footer. */
.modal-body > .modal-footer {
  margin: 1.5rem -1.5rem -1.5rem;
  border-top: 1px solid #dee2e6;
  border-radius: 0 0 .3rem .3rem;
}

/* Card headers: blue background with white text */
.card-header {
  background-color: #007bff;
  color: #fff;
}

.card-header .card-title,
.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header a:not(.btn) {
  color: #fff;
}

.card-header h3,
.card-header .card-title {
  font-weight: 600;
}

/* The "+" icon in every green Add button renders at one fixed size */
.btn.btn-success.btn-sm i.fas.fa-plus {
  font-size: 0.875rem;
}

/* Responsive footer: two columns on desktop, stacked + centered on mobile */
.main-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .15rem 1rem;
  padding: .55rem 1rem;
  font-size: .875rem;
  color: #6c757d;
}

@media (max-width: 767.98px) {
  .main-footer {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding: .55rem .75rem;
    font-size: .8rem;
    line-height: 1.5;
    gap: .1rem;
  }
}

/* -------------------------------------------------------------------------
   Headings: step down gradually as the viewport shrinks.
   Base sizes (>=1200px): h1 1.75 / h2 1.5 / h3 1.25, h4-h6 keep their
   Bootstrap defaults (1.5 / 1.25 / 1). Each breakpoint below eases them
   down a notch; .content-header h1 follows h1 (it has extra specificity).
   ------------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
  h1, .h1 { font-size: 1.6rem; }
  h2, .h2 { font-size: 1.375rem; }
  h3, .h3 { font-size: 1.175rem; }
  h4, .h4 { font-size: 1.375rem; }
  h5, .h5 { font-size: 1.175rem; }
  h6, .h6 { font-size: .9375rem; }
  .content-header h1, h1.dashboard-heading { font-size: 1.6rem; }
}

@media (max-width: 991.98px) {
  h1, .h1 { font-size: 1.45rem; }
  h2, .h2 { font-size: 1.25rem; }
  h3, .h3 { font-size: 1.1rem; }
  h4, .h4 { font-size: 1.25rem; }
  h5, .h5 { font-size: 1.1rem; }
  h6, .h6 { font-size: .875rem; }
  .content-header h1, h1.dashboard-heading { font-size: 1.45rem; }
}

@media (max-width: 767.98px) {
  h1, .h1 { font-size: 1.3rem; }
  h2, .h2 { font-size: 1.125rem; }
  h3, .h3 { font-size: 1.025rem; }
  h4, .h4 { font-size: 1.125rem; }
  h5, .h5 { font-size: 1.025rem; }
  h6, .h6 { font-size: .8125rem; }
  .content-header h1, h1.dashboard-heading { font-size: 1.3rem; }
}

@media (max-width: 575.98px) {
  h1, .h1 { font-size: 1.2rem; }
  h2, .h2 { font-size: 1.05rem; }
  h3, .h3 { font-size: .95rem; }
  h4, .h4 { font-size: 1.05rem; }
  h5, .h5 { font-size: .95rem; }
  h6, .h6 { font-size: .75rem; }
  .content-header h1, h1.dashboard-heading { font-size: 1.2rem; }
}

/* Small screens (all pages): tighter card chrome and header rows that wrap
   instead of squeezing the title against its action button. */
@media (max-width: 575.98px) {
  .content-header {
    padding: 10px .5rem;
  }

  .card-header {
    padding: .6rem .75rem;
  }

  .card-header.d-flex {
    flex-wrap: wrap;
    gap: .35rem .5rem;
  }

  .card-header.d-flex .card-title {
    flex: 1 1 auto;
    min-width: 0;
  }

  .card-body {
    padding: .875rem;
  }
}
