/*
 * EAF Country review form: additions to styles.css / themes.css.
 * Only the form's own elements (review-*) are styled here; buttons, eyebrows, the page shell
 * and the colour tokens come from the EAF core. The label badges use the same colours as the
 * Country Regulations map. Load after themes.css.
 */

:root {
  --eaf-review-surface: var(--white);
  --eaf-review-panel: #f4f7fb;
  --eaf-review-line: #d5deea;
  --eaf-review-field-line: #bdc9d9;
  --eaf-review-ink: var(--navy-deep);
  --eaf-review-accent: var(--blue);
  --eaf-review-chip-active: var(--soft-blue);
  --eaf-review-ask-bg: #fff7dc;
  --eaf-review-ask-line: #e6bd3e;
  --eaf-review-ask-icon: #9a6700;
  --eaf-review-progress-track: rgba(0, 43, 111, 0.12);
  --eaf-review-progress-fill: var(--navy);
  --eaf-review-status-empty: #6b7a90;
  --eaf-review-status-correct: #2f6b4f;
  --eaf-review-status-corrected: var(--blue);
  --eaf-review-status-unknown: #9a6700;
  --eaf-review-status-incomplete: #b42318;
  --eaf-review-shadow: 0 10px 28px rgba(0, 27, 77, 0.07);
}

.review-page {
  padding: 48px 0 84px;
}

/* styles.css sets overflow-x: hidden on body, which makes body a scroll container and stops
   position: sticky (the progress panel). clip keeps the horizontal clipping without that. */
body.has-country-review {
  overflow-x: clip;
}

.review-page [hidden] {
  display: none !important;
}

.review-loading {
  max-width: 760px;
  margin: 0;
  padding: 22px 24px;
  color: var(--eaf-review-ink);
  background: var(--eaf-review-surface);
  border: 1px solid var(--eaf-review-line);
  border-radius: var(--radius-sm);
  font-weight: 700;
}

/* ---------- Preview bar ---------- */

.review-demo-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin: 0 0 24px;
  padding: 12px 18px;
  color: var(--eaf-review-ink);
  background: rgba(255, 255, 255, 0.8);
  border: 1px dashed var(--gold-deep);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
}

.review-demo-bar strong {
  padding: 4px 10px;
  color: var(--navy-deep);
  background: var(--gold);
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.review-demo-bar label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.review-demo-bar select {
  min-height: 40px;
  padding: 0 10px;
  color: var(--eaf-review-ink);
  background: var(--white);
  border: 1px solid var(--eaf-review-field-line);
  border-radius: 7px;
  font-weight: 750;
}

.review-demo-bar span:last-child {
  color: var(--muted);
  font-weight: 600;
}

/* ---------- Head ---------- */

.review-head {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 28px 40px;
  align-items: start;
  margin-bottom: 34px;
}

.review-head h2 {
  margin: 0 0 10px;
  font-size: clamp(34px, 4.4vw, 54px);
  line-height: 1;
}

.review-head h2:focus { outline: none; }
.review-head h2:focus-visible { outline: 3px solid var(--eaf-review-accent); outline-offset: 4px; }

.review-federation {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 15px;
}

.review-federation strong { color: var(--eaf-review-ink); }

.review-intro {
  margin: 0 0 10px;
  color: var(--eaf-review-ink);
  font-size: 17px;
  font-weight: 650;
  line-height: 1.55;
}

.review-how {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.review-labels {
  padding: 14px 18px;
  background: var(--eaf-review-panel);
  border: 1px solid var(--eaf-review-line);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.review-labels summary {
  color: var(--eaf-review-accent);
  font-weight: 800;
  cursor: pointer;
}

.review-labels dl {
  display: grid;
  gap: 8px;
  margin: 12px 0 2px;
}

.review-labels dl > div {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.review-labels dd {
  margin: 0;
  color: var(--eaf-review-ink);
  line-height: 1.45;
}

/* Reliability labels: same badges and colours as the map (.regulations-reliability). */
.review-badge {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.6;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: help;
}

.review-badge.is-statute { color: #2f6b4f; background: #e8f5ee; border-color: #9fcfb5; }
.review-badge.is-interpretation { color: #8a5a00; background: #fff4d6; border-color: #e8c46a; }
.review-badge.is-not-regulated { color: #6941c6; background: #f1ecfd; border-color: #c8b6f4; }
.review-badge.is-unverified { color: #b42318; background: #fff0ee; border-color: #f2b2a9; }
.review-badge.is-federation-rule, .review-badge.is-federation { color: var(--blue); background: #eaf1fb; border-color: #aac3e6; }
.review-badge.is-for-federation { color: #475467; background: #f2f4f7; border-color: #c4ccd8; border-style: dashed; }

/* ---------- Layout and sidebar ---------- */

.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
}

.review-sidebar {
  display: grid;
  gap: 14px;
}

.review-progress {
  padding: 18px;
  background: var(--eaf-review-surface);
  border: 1px solid var(--eaf-review-line);
  border-radius: var(--radius-sm);
  box-shadow: var(--eaf-review-shadow);
}

.review-progress-title {
  margin: 0 0 10px;
  color: var(--eaf-review-accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.review-progress-bar {
  height: 8px;
  overflow: hidden;
  background: var(--eaf-review-progress-track);
  border-radius: 999px;
}

.review-progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--eaf-review-progress-fill);
  border-radius: inherit;
  transition: width 300ms ease;
}

.review-progress-text {
  margin: 10px 0 0;
  color: var(--eaf-review-ink);
  font-size: 15px;
  font-weight: 850;
}

.review-progress-annex,
.review-save-status {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.review-save-status.is-warning {
  color: var(--eaf-review-status-incomplete);
  font-weight: 750;
}

.review-next {
  width: 100%;
  min-height: 42px;
  margin-top: 14px;
  padding: 0 14px;
  font-size: 13px;
  cursor: pointer;
}

.review-sections {
  padding: 12px 14px;
  background: var(--eaf-review-surface);
  border: 1px solid var(--eaf-review-line);
  border-radius: var(--radius-sm);
}

.review-sections summary {
  color: var(--eaf-review-accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.review-sections ol {
  display: grid;
  gap: 0;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.review-sections a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 31px;
  padding: 4px 8px;
  color: var(--eaf-review-ink);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
}

.review-sections li.is-sub a { padding-left: 18px; }

.review-sections a:hover,
.review-sections a:focus-visible {
  color: var(--eaf-review-accent);
  background: var(--eaf-review-chip-active);
}

.review-sections b {
  flex: 0 0 auto;
  min-width: 38px;
  padding: 1px 7px;
  color: var(--eaf-review-status-empty);
  background: var(--eaf-review-panel);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  text-align: center;
}

.review-sections b.is-done {
  color: var(--white);
  background: var(--eaf-review-status-correct);
}

@media (min-width: 1080px) {
  .review-layout {
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 36px;
    align-items: start;
  }

  .review-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 18px);
    max-height: calc(100vh - var(--header-height) - 36px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* ---------- Sections and cards ---------- */

.review-main {
  display: grid;
  gap: 0;
  min-width: 0;
}

.review-part {
  margin: 34px 0 4px;
  color: var(--eaf-review-accent);
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.review-section {
  display: grid;
  gap: 16px;
  margin: 0 0 30px;
}

.review-section-title {
  margin: 18px 0 2px;
  color: var(--eaf-review-ink);
  font-family: var(--display);
  font-size: 24px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.review-section-title:focus { outline: none; }
.review-section-title:focus-visible { outline: 3px solid var(--eaf-review-accent); outline-offset: 4px; }

.review-part + .review-section .review-section-title { margin-top: 6px; }

.review-card {
  position: relative;
  scroll-margin-top: calc(var(--header-height) + 18px);
  background: var(--eaf-review-surface);
  border: 1px solid var(--eaf-review-line);
  border-left: 5px solid var(--eaf-review-status-empty);
  border-radius: var(--radius-sm);
  box-shadow: var(--eaf-review-shadow);
}

.review-card[data-review-status="correct"],
.review-card[data-review-status="complete"] { border-left-color: var(--eaf-review-status-correct); }
.review-card[data-review-status="corrected"] { border-left-color: var(--eaf-review-status-corrected); }
.review-card[data-review-status="unknown"] { border-left-color: var(--eaf-review-status-unknown); }
.review-card[data-review-status="incomplete"] { border-left-color: var(--eaf-review-status-incomplete); }

.review-card-body {
  display: grid;
  gap: 14px;
  min-width: 0;
  margin: 0;
  padding: 14px 22px 22px;
  border: 0;
}

/* The legend sits on the fieldset's top edge, so its own padding makes the top spacing. */
.review-card-title {
  display: flex;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 20px 130px 0 0;
  color: var(--eaf-review-ink);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.4;
}

.review-qid {
  flex: 0 0 auto;
  min-width: 44px;
  height: fit-content;
  padding: 2px 8px;
  color: var(--navy-deep);
  background: var(--gold);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.review-pill {
  position: absolute;
  top: 20px;
  right: 20px;
  margin: 0;
  padding: 3px 10px;
  color: var(--eaf-review-status-empty);
  background: var(--eaf-review-panel);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.review-pill.is-correct, .review-pill.is-complete { color: var(--white); background: var(--eaf-review-status-correct); }
.review-pill.is-corrected { color: var(--white); background: var(--eaf-review-status-corrected); }
.review-pill.is-unknown { color: #4d3400; background: #ffe7a3; }
.review-pill.is-incomplete { color: var(--white); background: var(--eaf-review-status-incomplete); }

.review-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.review-ask {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 16px;
  color: var(--eaf-review-ink);
  background: var(--eaf-review-ask-bg);
  border: 1px solid var(--eaf-review-ask-line);
  border-left-width: 4px;
  border-radius: 8px;
}

.review-ask svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--eaf-review-ask-icon);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.review-ask strong {
  display: block;
  margin-bottom: 2px;
  color: var(--eaf-review-ask-icon);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.review-ask p {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
}

.review-prefill {
  padding: 14px 16px;
  background: var(--eaf-review-panel);
  border: 1px solid var(--eaf-review-line);
  border-radius: 8px;
}

.review-prefill-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 8px;
}

.review-prefill-head > span:first-child {
  color: var(--eaf-review-accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.review-prefill-choice {
  display: inline-block;
  margin: 0 0 6px;
  padding: 2px 10px;
  color: var(--eaf-review-ink);
  background: var(--eaf-review-surface);
  border: 1px solid var(--eaf-review-line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 850;
}

.review-prefill-answer {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.review-prefill-source {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.review-prefill-empty {
  margin: 0;
  color: var(--muted);
  font-style: italic;
}

/* Answer marks: native radios in large, clearly labelled chips. */
.review-marks {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.review-marks legend {
  margin: 0 0 8px;
  padding: 0;
  color: var(--eaf-review-ink);
  font-size: 13px;
  font-weight: 850;
}

.review-mark-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-mark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 14px;
  color: var(--eaf-review-ink);
  background: var(--eaf-review-surface);
  border: 1px solid var(--eaf-review-field-line);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.25;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.review-mark input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--eaf-review-accent);
  cursor: inherit;
}

.review-mark input:focus-visible { outline-offset: 3px; }
.review-mark:hover { border-color: var(--eaf-review-accent); }

.review-mark:has(input:checked) {
  color: var(--eaf-review-accent);
  background: var(--eaf-review-chip-active);
  border-color: var(--eaf-review-accent);
  box-shadow: inset 0 0 0 1px var(--eaf-review-accent);
}

.review-mark.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Fields */
.review-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
}

.review-field > span {
  color: var(--eaf-review-ink);
  font-size: 12px;
  font-weight: 850;
}

.review-field input,
.review-field select,
.review-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--eaf-review-field-line);
  border-radius: 7px;
  font-size: 15px;
  line-height: 1.5;
}

.review-field textarea { resize: vertical; }

.review-field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.review-field input:focus-visible,
.review-field select:focus-visible,
.review-field textarea:focus-visible {
  border-color: var(--eaf-review-accent);
  outline: 3px solid rgba(0, 59, 143, 0.28);
  outline-offset: 0;
}

.review-field input[aria-invalid="true"] { border-color: var(--eaf-review-status-incomplete); }

.review-error {
  margin: 0;
  color: var(--eaf-review-status-incomplete);
  font-size: 13px;
  font-weight: 750;
}

.review-edit {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--eaf-review-chip-active);
  border: 1px solid var(--eaf-review-line);
  border-radius: 8px;
}

.review-edit-intro {
  margin: 0;
  color: var(--eaf-review-ink);
  font-size: 14px;
  font-weight: 700;
}

.review-edit-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.review-edit-note {
  margin: 0;
  color: var(--eaf-review-status-unknown);
  font-size: 13px;
  font-weight: 750;
}

.review-card[data-review-status="incomplete"] .review-edit-note { color: var(--eaf-review-status-incomplete); }

.review-practice textarea { min-height: 64px; }

/* General information */
.review-general-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.review-general-country strong {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--eaf-review-ink);
  font-size: 16px;
}

/* Field limits (3.2) */
.review-energy {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 4px 0 0;
  padding: 16px;
  border: 1px solid var(--eaf-review-line);
  border-radius: 8px;
}

.review-energy legend {
  padding: 0 6px;
  color: var(--eaf-review-ink);
  font-size: 13px;
  font-weight: 900;
}

.review-energy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}

.review-energy-note {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

/* Annex */
.review-annex-intro {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.review-card.is-annex { border-left-style: dashed; }

.review-why {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.review-why strong { color: var(--eaf-review-ink); }

.review-proposed {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 7px;
  color: #b54708;
  background: #fef0c7;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: 1px;
}

/* ---------- Submit ---------- */

.review-submit {
  display: grid;
  gap: 16px;
  margin-top: 12px;
  padding: 26px;
  background: var(--eaf-review-surface);
  border: 1px solid var(--eaf-review-line);
  border-top: 4px solid var(--gold);
  border-radius: var(--radius-sm);
  box-shadow: var(--eaf-review-shadow);
  scroll-margin-top: calc(var(--header-height) + 18px);
}

.review-submit h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 28px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.review-submit h3:focus { outline: none; }

.review-validation-summary,
.review-send-help {
  margin: 0;
  color: var(--eaf-review-ink);
  font-size: 15px;
}

.review-validation-done {
  margin: 0;
  padding: 12px 14px;
  color: #235b34;
  background: #f0f8f2;
  border: 1px solid #acd0b5;
  border-radius: 8px;
  font-weight: 750;
}

.review-validation-group {
  margin-top: 12px;
}

.review-validation-title {
  margin: 0 0 6px;
  color: var(--eaf-review-ink);
  font-size: 13px;
  font-weight: 900;
}

.review-validation-group.is-attention .review-validation-title { color: var(--eaf-review-status-incomplete); }

.review-validation ul {
  display: grid;
  gap: 2px;
  max-height: 320px;
  margin: 0;
  padding: 0 4px 0 0;
  overflow-y: auto;
  list-style: none;
}

.review-validation li {
  font-size: 13.5px;
  line-height: 1.4;
}

.review-validation a {
  display: inline-block;
  padding: 4px 2px;
  color: var(--eaf-review-accent);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.review-validation li span {
  color: var(--eaf-review-status-incomplete);
  font-weight: 750;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.review-actions .button { cursor: pointer; }

.review-submit-status:empty { display: none; }

.review-submit-status {
  padding: 12px 14px;
  color: var(--eaf-review-ink);
  background: var(--eaf-review-panel);
  border: 1px solid var(--eaf-review-line);
  border-radius: 8px;
  font-weight: 700;
}

.review-submit-status.is-success { color: #235b34; background: #f0f8f2; border-color: #acd0b5; }
.review-submit-status.is-error { color: #8f1d13; background: #fff0ee; border-color: #f2b2a9; }

.review-clear {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding-top: 16px;
  border-top: 1px solid var(--eaf-review-line);
}

.review-clear .button {
  min-height: 42px;
  font-size: 13px;
  cursor: pointer;
}

.review-clear p {
  flex: 1 1 260px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Print view (filled by the module before printing) ---------- */

.review-print { display: none; }

/* ---------- Phones and tablets ---------- */

.review-next-short { display: none; }

@media (max-width: 1079px) {
  .review-head { grid-template-columns: minmax(0, 1fr); }

  /* One compact bar stays under the site header while scrolling: progress, next, sections. */
  .review-sidebar {
    position: sticky;
    z-index: 20;
    top: var(--header-height);
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px 8px;
    align-items: center;
    margin: 0 -28px;
    padding: 8px 28px 10px;
    background: var(--off-white);
    border-bottom: 1px solid var(--eaf-review-line);
    box-shadow: 0 8px 18px rgba(0, 27, 77, 0.08);
  }

  .review-progress { display: contents; }

  .review-progress-title,
  .review-progress-annex { display: none; }

  .review-progress-bar { grid-column: 1 / -1; grid-row: 1; }
  .review-progress-text { grid-column: 1; grid-row: 2; margin: 0; font-size: 13px; line-height: 1.3; }
  .review-save-status { grid-column: 1 / -1; grid-row: 3; margin: 0; font-size: 11px; }

  .review-next {
    grid-column: 2;
    grid-row: 2;
    width: auto;
    min-height: 40px;
    margin: 0;
    padding: 0 12px;
    font-size: 12px;
  }

  .review-sections {
    grid-column: 3;
    grid-row: 2;
    padding: 0;
    background: none;
    border: 0;
  }

  .review-sections summary {
    display: flex;
    gap: 9px;
    align-items: center;
    min-height: 40px;
    padding: 0 12px;
    background: var(--eaf-review-surface);
    border: 1px solid var(--eaf-review-line);
    border-radius: 8px;
  }

  .review-sections summary::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-top: -4px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
  }

  .review-sections[open] summary::after { margin-top: 4px; transform: rotate(-135deg); }

  .review-sections nav {
    position: absolute;
    z-index: 30;
    top: 100%;
    right: 12px;
    left: 12px;
    max-height: 55vh;
    padding: 8px;
    overflow-y: auto;
    background: var(--eaf-review-surface);
    border: 1px solid var(--eaf-review-line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
  }

  .review-sections ol { margin: 0; }

  .review-card,
  .review-submit { scroll-margin-top: calc(var(--header-height) + 96px); }
}

@media (max-width: 720px) {
  .review-page { padding: 28px 0 60px; }
  .review-sidebar { margin: 0 -15px; padding: 8px 15px 10px; }
  .review-next-long { display: none; }
  .review-next-short { display: inline; }
  /* On phones the save status is announced but not shown, to keep the bar small. */
  .review-save-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .review-card-body { padding: 12px 14px 18px; }
  .review-card-title { padding: 44px 0 0; font-size: 16px; }
  .review-pill { top: 14px; right: auto; left: 14px; }
  .review-mark-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-mark { padding: 8px 10px; font-size: 13px; }
  .review-edit-row,
  .review-general-grid,
  .review-energy-grid { grid-template-columns: minmax(0, 1fr); }
  .review-labels dl > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .review-submit { padding: 20px 16px; }
  .review-actions .button { flex: 1 1 100%; }
}

/* ---------- Theme: institutional ---------- */

html[data-eaf-theme="institutional"] {
  --eaf-review-panel: #f3f8fc;
  --eaf-review-progress-fill: #235b85;
  --eaf-review-ask-bg: #eef6fc;
  --eaf-review-ask-line: #9cc3e2;
  --eaf-review-ask-icon: #235b85;
}

html[data-eaf-theme="institutional"] .review-qid { color: #15324b; background: #cfe3f4; }

/* ---------- Theme: camouflage ---------- */

html[data-eaf-theme="camouflage"] {
  --eaf-review-panel: #f1f3eb;
  --eaf-review-line: #cbd2bf;
  --eaf-review-field-line: #aab59b;
  --eaf-review-progress-track: rgba(36, 51, 31, 0.14);
  --eaf-review-progress-fill: #24331f;
  --eaf-review-ask-bg: #f7f1dc;
  --eaf-review-ask-line: #d7a92d;
  --eaf-review-ask-icon: #7a5a12;
  --eaf-review-shadow: 0 10px 28px rgba(24, 38, 23, 0.08);
}

/* ---------- Night mode ---------- */

html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] {
  --eaf-review-surface: #111923;
  --eaf-review-panel: #0f1721;
  --eaf-review-line: #35485d;
  --eaf-review-field-line: #50677d;
  --eaf-review-ink: #f0f4f8;
  --eaf-review-accent: #91bce8;
  --eaf-review-chip-active: #172a3d;
  --eaf-review-ask-bg: #30250c;
  --eaf-review-ask-line: #9d7412;
  --eaf-review-ask-icon: #ffd23f;
  --eaf-review-progress-track: rgba(255, 255, 255, 0.12);
  --eaf-review-progress-fill: #ffd23f;
  --eaf-review-status-empty: #8fa3b8;
  --eaf-review-status-correct: #3d8c66;
  --eaf-review-status-corrected: #4f87cc;
  --eaf-review-status-unknown: #c99a2e;
  --eaf-review-status-incomplete: #e5655a;
  --eaf-review-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] :is(.review-prefill-answer, .review-labels dd, .review-ask p, .review-edit-intro) { color: #d8e1eb; }
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] :is(.review-federation, .review-how, .review-hint, .review-why, .review-prefill-source, .review-energy-note, .review-annex-intro, .review-clear p, .review-progress-annex, .review-save-status) { color: #b5c1ce; }
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-field :is(input, select, textarea) { color: #e8eef5; background: #101822; border-color: #50677d; }
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-field :is(input, textarea)::placeholder { color: #aab8c6; }
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-mark { color: #dce8f4; background: #14202d; border-color: #526a82; }
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-mark:has(input:checked) { color: #061326; background: #ffd23f; border-color: #ffd23f; box-shadow: none; }
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-mark input { accent-color: #ffd23f; }
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-pill { color: #c5d0db; background: #26384a; }
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-pill.is-correct,
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-pill.is-complete { color: #07150e; background: #a8d4be; }
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-pill.is-corrected { color: #061326; background: #91bce8; }
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-pill.is-unknown { color: #241900; background: #ffd88a; }
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-pill.is-incomplete { color: #2a0603; background: #ffaba0; }
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-sections b { color: #c5d0db; background: #26384a; }
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-sections b.is-done { color: #07150e; background: #a8d4be; }
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-badge { background: transparent; }
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-badge.is-statute { color: #a8d4be; border-color: #4f7f66; }
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-badge.is-interpretation { color: #ffd88a; border-color: #8a6a22; }
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-badge.is-not-regulated { color: #cbb8ff; border-color: #6b55a8; }
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-badge.is-unverified { color: #ffaba0; border-color: #a5463b; }
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-badge:is(.is-federation-rule, .is-federation) { color: #91bce8; border-color: #40566c; }
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-badge.is-for-federation { color: #c7d0dc; border-color: #5a6878; }
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-proposed { color: #ffd88a; background: #3a2a08; }
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-validation-done,
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-submit-status.is-success { color: #a8d4be; background: #10241a; border-color: #3d6b52; }
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-submit-status.is-error { color: #ffaba0; background: #2a1210; border-color: #a5463b; }
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-demo-bar { color: #f0f4f8; background: rgba(17, 25, 35, 0.85); }
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-demo-bar select { color: #f0f4f8; background: #172330; border-color: #40566c; }
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-loading { color: #f0f4f8; }
html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-page .button-ghost { color: #dce8f4; background: #172a3d; border-color: #40566c; }

@media (max-width: 1079px) {
  html[data-eaf-theme-context="public"][data-eaf-night-mode="true"] .review-sidebar { background: #080d14; }
}

/* ---------- Forced colours ---------- */

@media (forced-colors: active) {
  .review-card { border-left-color: CanvasText; }
  .review-progress-bar span { background: Highlight; }
  .review-mark:has(input:checked) { border: 2px solid Highlight; }
  .review-pill, .review-badge, .review-qid { border: 1px solid CanvasText; }
}

/* ---------- Print: a clean copy of the review, nothing of the site around it ---------- */

@media print {
  html, body { background: #fff !important; }
  body { padding-top: 0 !important; color: #000 !important; }

  body > :not(main),
  main > :not(.review-page),
  .review-page .page-shell > :not(.review-print) { display: none !important; }

  .review-page { padding: 0 !important; }
  .review-page .page-shell { width: auto; }
  .review-print { display: block !important; color: #000; font-family: Arial, Helvetica, sans-serif; font-size: 10.5pt; line-height: 1.45; }
  .review-print :is(h1, h2, h3) { color: #000; font-family: Arial, Helvetica, sans-serif; letter-spacing: normal; text-transform: none; }
  .review-print h1 { margin: 0 0 4pt; font-size: 18pt; }
  .review-print h2 { margin: 14pt 0 6pt; padding-bottom: 2pt; border-bottom: 1px solid #999; font-size: 13pt; break-after: avoid; }
  .review-print h3 { margin: 0 0 4pt; font-size: 11pt; line-height: 1.3; break-after: avoid; }
  .review-print-meta { margin: 0 0 8pt; color: #333; font-size: 9pt; }
  .review-print-item { margin: 0 0 10pt; padding: 0 0 8pt; border-bottom: 1px solid #ddd; break-inside: avoid; }
  .review-print dl { margin: 0; }
  .review-print dl > div { display: grid; grid-template-columns: 34mm minmax(0, 1fr); gap: 8pt; padding: 1pt 0; }
  .review-print dt { color: #333; font-weight: 700; }
  .review-print dd { margin: 0; overflow-wrap: anywhere; }
  .review-print table { width: 100%; margin-top: 6pt; border-collapse: collapse; font-size: 9.5pt; }
  .review-print caption { text-align: left; font-weight: 700; }
  .review-print th, .review-print td { padding: 3pt 5pt; border: 1px solid #999; text-align: left; vertical-align: top; }
}
