/* =========================================================
   Chemistry@BGS — central A Level checklist
   ========================================================= */

html {
  scroll-behavior: smooth;
}

.alevel-checklist-page {
  --checklist-red: #c7222a;
  --checklist-red-dark: #a91d24;
  --checklist-gold: #d4a823;
  --checklist-text: #30343a;
  --checklist-muted: #6f7781;
  --checklist-border: #dfe4e9;
  --checklist-soft: #f7f8fa;
  --checklist-complete: #53745f;

  background:
    linear-gradient(
      180deg,
      #f8f9fb 0,
      #ffffff 360px
    );
}

.checklist-shell {
  width: min(1320px, calc(100% - 56px));
  margin: 0 auto;
  padding: 30px 0 80px;
}

.checklist-breadcrumb {
  margin-bottom: 18px;
}

.checklist-breadcrumb a,
.checklist-breadcrumb a:visited {
  color: #6d7580;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
}

.checklist-breadcrumb a:hover {
  color: var(--checklist-red-dark);
}

.checklist-intro {
  margin-bottom: 24px;
}

.checklist-eyebrow {
  margin: 0 0 8px;
  color: var(--checklist-red);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.checklist-intro h2 {
  margin: 0;
  color: #292c31;
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.checklist-intro > p:last-child {
  max-width: 880px;
  margin: 16px 0 0;
  color: var(--checklist-muted);
  font-size: 1rem;
  line-height: 1.55;
}

.checklist-panel {
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--checklist-border);
  border-radius: 20px;
  box-shadow: 0 9px 28px rgba(38, 44, 52, 0.055);
}

.checklist-panel__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
  border-bottom: 1px solid #e6e9ed;
}

.checklist-panel__top h3 {
  margin: 0;
  color: var(--checklist-text);
  font-size: 1.45rem;
}

.checklist-panel__top p {
  margin: 5px 0 0;
  color: var(--checklist-muted);
  font-size: 0.9rem;
}

.checklist-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.checklist-action {
  min-height: 42px;
  padding: 9px 15px;
  color: var(--checklist-red);
  background: #ffffff;
  border: 2px solid var(--checklist-red);
  border-radius: 999px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 850;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.checklist-action:hover:not(:disabled) {
  color: #ffffff;
  background: var(--checklist-red);
  transform: translateY(-1px);
}

.checklist-action:disabled {
  opacity: 0.45;
  cursor: wait;
}

.checklist-action--danger {
  color: #7c3135;
  border-color: #d9a9ac;
}

.checklist-action--danger:hover:not(:disabled) {
  color: #ffffff;
  background: #9f3037;
  border-color: #9f3037;
}

.clear-confirmation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 28px;
  background: #fff6f6;
  border-bottom: 1px solid #edc9cb;
}

.clear-confirmation[hidden] {
  display: none;
}

.clear-confirmation p {
  margin: 0;
  color: #73383b;
  font-size: 0.9rem;
  line-height: 1.45;
}

.clear-confirmation__actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.clear-confirmation__confirm,
.clear-confirmation__cancel {
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 10px;
  font: inherit;
  font-size: 0.83rem;
  font-weight: 800;
  cursor: pointer;
}

.clear-confirmation__confirm {
  color: #ffffff;
  background: #9f3037;
  border: 1px solid #9f3037;
}

.clear-confirmation__cancel {
  color: #555d66;
  background: #ffffff;
  border: 1px solid #cfd5db;
}

.checklist-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.checklist-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.checklist-table thead th {
  padding: 14px 20px;
  color: #69717a;
  background: #f6f7f9;
  border-bottom: 1px solid #dde2e7;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.checklist-table thead th:first-child {
  width: auto;
}

.checklist-table thead th:nth-child(2) {
  width: 150px;
}

.checklist-table thead th:last-child {
  width: 150px;
}

.progress-heading {
  text-align: right !important;
}

.checklist-group-row th {
  padding: 12px 20px;
  color: #5e6670;
  background: #eef1f4;
  border-top: 1px solid #dfe3e7;
  border-bottom: 1px solid #dfe3e7;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.checklist-topic-row th,
.checklist-topic-row td {
  padding: 16px 20px;
  background: #ffffff;
  border-bottom: 1px solid #eceff2;
  vertical-align: middle;
}

.checklist-topic-row:hover th,
.checklist-topic-row:hover td {
  background: #fcfcfd;
}

.checklist-topic-row th {
  color: var(--checklist-text);
  font-size: 0.97rem;
  font-weight: 800;
  line-height: 1.35;
  text-align: left;
}

.topic-subtitle {
  display: block;
  margin-top: 3px;
  color: #8a9199;
  font-size: 0.73rem;
  font-weight: 700;
}

.topic-toggle-cell {
  text-align: center;
}

.topic-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 12px;
  color: var(--checklist-red);
  background: #ffffff;
  border: 1px solid #dfb5b8;
  border-radius: 999px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 850;
  cursor: pointer;
  white-space: nowrap;
}

.topic-toggle:hover:not(:disabled) {
  background: #fff5f5;
  border-color: var(--checklist-red);
}

.topic-toggle:disabled {
  color: #969da5;
  border-color: #d9dde1;
  cursor: wait;
}

.topic-toggle__arrow {
  font-size: 0.72em;
}

.topic-progress-cell {
  text-align: right;
}

.topic-progress-value {
  display: block;
  color: var(--checklist-text);
  font-size: 1rem;
  font-weight: 900;
}

.topic-progress-value.is-complete {
  color: var(--checklist-complete);
}

.topic-progress-track {
  overflow: hidden;
  width: 100%;
  max-width: 112px;
  height: 5px;
  margin: 6px 0 0 auto;
  background: #e9edf0;
  border-radius: 999px;
}

.topic-progress-fill {
  width: 0;
  height: 100%;
  background: var(--checklist-red);
  border-radius: inherit;
  transition: width 0.2s ease;
}

.topic-progress-fill.is-complete {
  background: var(--checklist-complete);
}

.checklist-detail-row td {
  padding: 0;
  background: #f8f9fa;
  border-bottom: 1px solid #e2e6ea;
}

.checklist-detail-row[hidden] {
  display: none;
}

.topic-detail {
  padding: 18px 22px 22px;
}

.topic-detail__status {
  margin: 0;
  color: var(--checklist-muted);
  font-size: 0.88rem;
}

.central-spec-list {
  display: grid;
  gap: 9px;
}

.central-spec-item {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px 15px;
  background: #ffffff;
  border: 1px solid #e0e4e8;
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.central-spec-item:hover {
  background: #fdfdfd;
  border-color: #d1d6dc;
}

.central-spec-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.central-spec-check {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: transparent;
  background: #ffffff;
  border: 2px solid #cbd1d8;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 900;
}

.central-spec-item input:focus-visible + .central-spec-check {
  outline: 3px solid rgba(199, 34, 42, 0.18);
  outline-offset: 3px;
}

.central-spec-item input:checked + .central-spec-check {
  color: #ffffff;
  background: var(--checklist-red);
  border-color: var(--checklist-red);
}

.central-spec-item:has(input:checked) {
  background: #fff8f8;
  border-color: #e3bec1;
}

.central-spec-body {
  min-width: 0;
}

.central-spec-code {
  display: block;
  margin-bottom: 4px;
  color: #8b3035;
  font-size: 0.75rem;
  font-weight: 900;
}

.central-spec-text {
  display: block;
  color: #3b4046;
  font-size: 0.91rem;
  line-height: 1.48;
}

.topic-load-error {
  color: #8b3035;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 800px) {
  .checklist-shell {
    width: min(100% - 24px, 720px);
  }

  .checklist-panel__top,
  .clear-confirmation {
    align-items: flex-start;
    flex-direction: column;
  }

  .checklist-table thead th:nth-child(2) {
    width: 125px;
  }

  .checklist-table thead th:last-child {
    width: 105px;
  }

  .checklist-topic-row th,
  .checklist-topic-row td,
  .checklist-table thead th,
  .checklist-group-row th {
    padding-left: 14px;
    padding-right: 14px;
  }
}

@media (max-width: 560px) {
  .checklist-shell {
    width: calc(100% - 18px);
    padding-top: 22px;
  }

  .checklist-panel {
    border-radius: 15px;
  }

  .checklist-panel__top {
    padding: 20px;
  }

  .checklist-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .checklist-action {
    flex: 1 1 auto;
  }

  .clear-confirmation {
    padding: 14px 20px;
  }

  .clear-confirmation__actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .checklist-table {
    min-width: 520px;
  }

  .topic-detail {
    padding: 14px;
  }
}

/* Colour-code the checklist section headers */
.checklist-group-row--inorganic th {
  background: #eaf4f7;
  color: #1f667d;
  border-top: 1px solid #c9dfe6;
  border-bottom: 1px solid #c9dfe6;
}

.checklist-group-row--organic th {
  background: #f3edf8;
  color: #6a4b8a;
  border-top: 1px solid #ddd0ec;
  border-bottom: 1px solid #ddd0ec;
}