/* EnergyCircle Roadmap Tool — application stylesheet
   Direction: "workbench" (docs/concept.md §6.1).
   Light ground, hairline structure, no shadows, figures in mono.
   No external requests: all fonts are self-hosted in /public/fonts. */

/* ---------------------------------------------------------------
   1. Tokens
   --------------------------------------------------------------- */

:root {
  --ground: #F7F6F3;
  --surface: #FFFFFF;
  --ink: #14202A;
  --muted: #5C6B76;
  --line: #E2E0DA;
  --line-soft: #EDEBE5;
  --primary: #0E5A6B;
  --primary-dark: #0B4653;
  --accent: #C2703A;
  /* accent as text: #C2703A is 3.4:1 on the ground; #9A5527 is 5.3:1 (rule 9) */
  --accent-text: #9A5527;
  --positive: #3F7A52;
  --danger: #A23B2A;
  --radius: 3px;

  --tint-positive: #EEF5F0;
  --tint-danger: #F9EDEA;
  --tint-primary: #EAF2F4;

  --font-heading: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --rail-width: 264px;
}

/* ---------------------------------------------------------------
   2. Fonts (self-hosted WOFF2)
   --------------------------------------------------------------- */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/archivo-400.woff2") format("woff2");
}

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/archivo-500.woff2") format("woff2");
}

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/archivo-600.woff2") format("woff2");
}

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/archivo-700.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-400.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-400-italic.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-500.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-600.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-400.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2");
}

/* ---------------------------------------------------------------
   3. Base
   --------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* The hidden attribute always wins over component display rules — otherwise
   e.g. .tag { display: inline-block } showed every roadmap "unsaved" marker. */
[hidden] {
  display: none !important;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 360px;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.5em;
  overflow-wrap: anywhere;
}

h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; font-weight: 500; }
h3 { font-size: 1.05rem; font-weight: 500; }
h4 { font-size: 1rem; font-weight: 500; }

p {
  margin: 0 0 1em;
}

a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--primary-dark);
}

:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}

code,
kbd,
pre,
samp,
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

pre {
  overflow-x: auto;
  max-width: 100%;
}

ul,
ol {
  padding-left: 1.4em;
}

figure {
  margin: 0;
}

/* ---------------------------------------------------------------
   4. Utilities
   --------------------------------------------------------------- */

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.875rem;
}

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

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

.empty {
  color: var(--muted);
  padding: 24px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.required {
  color: var(--accent-text);
  font-weight: 600;
  margin-left: 2px;
}

/* ---------------------------------------------------------------
   5. Builder layout — workbench with rail
   --------------------------------------------------------------- */

.workbench {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  background: var(--ink);
  color: #fff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 20px 16px;
  gap: 24px;
}

.rail a {
  color: #fff;
}

.rail__brand {
  display: block;
}

/* The colour lock-up (Interreg BSR + EU emblem + Energy Circle) keeps its official
   colours on a white band flush with the rail edges; stacked variant via <picture>. */
.rail__brand .brand {
  display: block;
  background: #fff;
  margin: -20px -16px 0;
  padding: 14px 18px;
}

.rail__brand .brand-img {
  width: 100%;
  height: auto;
}

.rail__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.rail__nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rail__link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  color: #fff;
  text-decoration: none;
  border-left: 3px solid transparent;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.rail__link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  text-decoration: underline;
}

.rail__link:focus-visible {
  outline-color: #fff;
}

.rail__link--active {
  border-left-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.rail__user {
  margin-top: auto;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.85);
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  overflow-wrap: anywhere;
}

.rail__user p {
  margin: 0 0 4px;
}

.rail__user form {
  margin-top: 12px;
}

.content {
  padding: 32px 40px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.content > .site-footer {
  margin-top: auto;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 24px;
}

.page-header__title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.6rem;
  margin: 0;
}

.page-header__meta {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.875rem;
}

.page-header__actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

@media (max-width: 900px) {
  .workbench {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    min-height: 0;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 24px;
    padding: 12px 20px;
  }

  .rail__brand {
    flex: 1 1 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
  }

  .rail__brand .brand {
    flex: 1 1 100%;
    margin: -12px -20px 0;
    padding: 10px 20px;
  }

  .rail__brand .brand-img {
    width: auto;
    max-width: 100%;
    max-height: 52px;
    height: auto;
  }

  .rail__nav,
  .rail__nav ul {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }

  .rail__link {
    border-left: 0;
    border-bottom: 3px solid transparent;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .rail__link--active {
    border-bottom-color: var(--accent);
  }

  .rail__user {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
    flex: 1 1 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 16px;
  }

  .rail__user form {
    margin: 0 0 0 auto;
  }

  .content {
    padding: 20px;
  }
}

/* ---------------------------------------------------------------
   6. Entity layout
   --------------------------------------------------------------- */

.brand-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 32px;
  padding: 14px 24px;
}

.brand-bar .brand {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
}

.brand-bar img {
  display: block;
  max-height: 64px;
  width: auto;
  height: auto;
  max-width: 100%;
}

@media (max-width: 720px) {
  .brand-bar {
    padding: 12px 16px;
  }

  .brand-bar img {
    max-height: 56px;
  }
}

@media (max-width: 480px) {
  /* stacked lock-up: full width of the narrow screen */
  .brand-bar img {
    max-height: none;
    width: 100%;
    max-width: 320px;
  }
}

.entity-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px;
  width: 100%;
}

.progress-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  list-style: none;
  margin: 0 0 24px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--muted);
}

.progress-strip__step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
}

.progress-strip__step a {
  color: inherit;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.progress-strip__n,
.progress-strip__step::before {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.progress-strip__step--done {
  color: var(--positive);
}

.progress-strip__step--current {
  color: var(--accent-text);
  font-weight: 600;
}

.site-footer {
  background: var(--ink);
  color: #fff;
  font-size: 0.875rem;
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: flex-start;
}

.site-footer a {
  color: #fff;
  text-decoration: underline;
}

.site-footer__statement {
  margin: 0;
  max-width: 60ch;
  flex: 1 1 300px;
}

.site-footer__meta {
  flex: 1 1 100%;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 24px;
}

.site-footer__privacy {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.site-footer__version {
  font-size: 0.8125rem;
  /* Muted, and still 4.5:1 or better on the dark footer (--ink); the light footer uses --muted. */
  color: #A9B4BB;
}

.site-footer--light .site-footer__version {
  color: var(--muted);
}

.site-footer__logos {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  background: #fff;
  padding: 8px;
  border-radius: var(--radius);
}

.site-footer__logos img {
  max-height: 40px;
  width: auto;
}

/* Machine-draft language (Translator::DRAFT_LOCALES): stated in words, never by
   colour alone. Full row so it cannot be missed next to the funding statement. */
.site-footer__draft {
  flex: 1 1 100%;
  order: -1;
  margin: 0;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 10px;
  font-weight: 500;
}

.site-footer__draft-label {
  font-family: var(--font-mono);
  font-weight: 600;
}

.site-footer__draft-en {
  display: block;
  font-weight: 400;
}

.lang-switch {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin-top: 0;
  margin-bottom: 0;
}

.lang-switch a,
.lang-switch span {
  font-family: var(--font-mono);
}

.lang-switch a {
  color: #fff;
  text-decoration: underline;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.lang-switch [aria-current] {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  /* --positive is only 3.3:1 against the dark footer's --ink ground;
     this lightened step of the same green clears 4.5:1 (rule 9). */
  color: #7FBF97;
}

/* Undelivered partner translations: not a link, and not distinguished by
   colour alone — italic plus a "not-allowed" cursor carry the disabled
   state, on top of the dimmed colour. See lang.unavailable / lang.names.*
   in lang/en.json and lang/de.json, and Translator::isAvailable(). */
.lang-switch__item--off {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #8B98A0;
  font-style: italic;
  cursor: not-allowed;
}

.site-footer--light {
  background: var(--surface);
  color: var(--ink);
  border-top: 1px solid var(--line);
  margin-top: 40px;
  margin-left: -40px;
  margin-right: -40px;
  margin-bottom: -32px;
}

.site-footer--light a {
  color: var(--primary);
}

.site-footer--light .lang-switch a {
  color: var(--primary);
}

.site-footer--light .lang-switch [aria-current] {
  color: var(--positive);
}

.site-footer--light .lang-switch__item--off {
  color: var(--muted);
}

.site-footer--light .site-footer__logos {
  padding: 0;
}

@media (max-width: 900px) {
  .site-footer--light {
    margin-left: -20px;
    margin-right: -20px;
    margin-bottom: -20px;
  }
}

/* ---------------------------------------------------------------
   7. Panels and definition lists
   --------------------------------------------------------------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  min-width: 0;
}

.panel__title {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1.1rem;
  margin: 0 0 12px;
}

.panel__note {
  color: var(--muted);
  font-size: 0.875rem;
}

.dl {
  display: grid;
  grid-template-columns: minmax(100px, 38%) minmax(0, 1fr);
  gap: 8px 16px;
  margin: 0;
}

.dl dd .mono,
.table .mono {
  white-space: nowrap;
}

.dl dt {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0;
}

.dl dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 600px) {
  .dl {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px 0;
  }

  .dl dd {
    margin-bottom: 10px;
  }
}

/* ---------------------------------------------------------------
   8. Tables
   --------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  margin-bottom: 24px;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.table th,
.table td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line-soft);
}

.table th {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table td.num,
.table th.num,
.table .num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.table a {
  text-decoration: none;
  /* 44 px hit area (24 px line + 2 × 10 px) without changing the row height */
  display: inline-block;
  padding: 10px 0;
  margin: -10px 0;
}

.table a:hover,
.table a:focus-visible {
  text-decoration: underline;
}

.table--cases tbody tr:hover {
  background: var(--ground);
}

/* ---------------------------------------------------------------
   9. Forms
   --------------------------------------------------------------- */

.form {
  max-width: 720px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 24px;
}

.form-grid .field {
  margin-bottom: 0;
}

.form-grid .field--wide {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 0 0 24px;
  min-width: 0;
}

legend {
  font-family: var(--font-heading);
  font-weight: 500;
  padding: 0 6px;
}

.field {
  display: block;
  margin-bottom: 16px;
  min-width: 0;
}

.field__label {
  display: block;
  font-weight: 500;
  margin-bottom: 4px;
}

.field__hint {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0 0 6px;
}

.field__error {
  color: var(--danger);
  font-size: 0.875rem;
  margin-top: 4px;
}

.field--error input,
.field--error select,
.field--error textarea {
  border-color: var(--danger);
}

.field--personal {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="file"]),
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  line-height: 1.4;
  margin: 0;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="file"]):hover,
select:hover,
textarea:hover {
  border-color: var(--muted);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--ground);
  color: var(--muted);
}

input[type="number"],
input[inputmode="numeric"],
input[inputmode="decimal"] {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

::placeholder {
  color: var(--muted);
  opacity: 1;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2314202A' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

select[multiple] {
  background-image: none;
  padding-right: 12px;
}

input[type="checkbox"],
input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 0 8px 0 0;
  accent-color: var(--primary);
  vertical-align: middle;
  flex: 0 0 auto;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 44px;
  padding: 10px 0;
}

.choice input {
  margin-top: 2px;
}

.field__unit {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  margin-left: 6px;
}

.input-unit {
  display: flex;
  align-items: stretch;
}

.input-unit input {
  border-radius: var(--radius) 0 0 var(--radius);
}

.input-unit__suffix {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--ground);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  white-space: nowrap;
}

/* ---------------------------------------------------------------
   10. Buttons
   --------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  box-shadow: none;
  background: var(--surface);
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

.btn:hover {
  text-decoration: none;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}

.btn--secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.btn--secondary:hover {
  background: var(--ground);
  border-color: var(--muted);
  color: var(--ink);
}

.btn--danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn--danger:hover {
  background: #86301F;
  border-color: #86301F;
  color: #fff;
}

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--primary);
}

.btn--ghost:hover {
  background: var(--ground);
  border-color: var(--muted);
  color: var(--primary-dark);
}

/* on the ink-coloured rail the ghost button is white */
.rail .btn--ghost {
  border-color: #fff;
  color: #fff;
}

.rail .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.rail .btn--ghost:focus-visible {
  outline-color: #fff;
}

.btn--small {
  /* still a 44 px target (rule 9); only padding and type get smaller */
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  font-size: 0.875rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.btn-row--end {
  justify-content: flex-end;
}

/* ---------------------------------------------------------------
   11. Badges and tags
   --------------------------------------------------------------- */

.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  line-height: 1.4;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  white-space: nowrap;
  vertical-align: middle;
}

.badge--contacted {
  color: var(--muted);
  border-color: var(--muted);
}

.badge--data_collected {
  color: var(--primary);
  border-color: var(--primary);
}

.badge--assessed {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.badge--draft_roadmap {
  /* Accent #C2703A on white is ~3.5:1; text uses a darker accent (#9A5527, >4.5:1)
     while the border stays the token colour. */
  border-color: var(--accent);
  color: var(--accent-text);
}

.badge--agreed {
  background: var(--positive);
  border-color: var(--positive);
  color: #fff;
}

.badge--implementing {
  color: var(--positive);
  border-color: var(--positive);
}

/* Test-phase report status. Same shape as the case badges above; the colours
   repeat the token palette so nothing new enters the design. */

.badge--open {
  color: var(--muted);
  border-color: var(--muted);
}

.badge--accepted {
  color: var(--primary);
  border-color: var(--primary);
}

.badge--done {
  background: var(--positive);
  border-color: var(--positive);
  color: #fff;
}

.badge--declined {
  border-color: var(--accent);
  color: var(--accent-text);
}

.tag {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.4;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  vertical-align: middle;
  white-space: nowrap;
}

.rule-pop {
  position: relative;
  display: inline-block;
}

.rule-pop__box {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 30;
  width: max-content;
  max-width: 340px;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(20, 32, 42, 0.15);
  font-size: 0.8rem;
  line-height: 1.45;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  white-space: normal;
}

.rule-pop:hover .rule-pop__box,
.rule-pop:focus .rule-pop__box,
.rule-pop:focus-within .rule-pop__box {
  display: block;
}

.tag--generated {
  border-color: var(--accent);
  color: var(--accent-text);
}

.tag--edited {
  border-color: var(--primary);
  color: var(--primary);
}

.tag--stale {
  border-color: var(--accent-text);
  background: var(--accent-text);
  color: #FFFFFF;
}

.roadmap-stale {
  margin: 8px 0 12px;
  font-size: 0.875rem;
}

.tag--proposed {
  border-color: var(--muted);
  color: var(--muted);
}

/* Excel import (Quick Check): how sure a value read from the workbook is. The word carries the meaning. */
.tag--certain {
  border-color: var(--positive);
  color: var(--positive);
}

.tag--plausible {
  border-style: dashed;
  border-color: var(--accent);
  color: var(--accent-text);
}

/* Hidden test case: the word carries the meaning, the dashed border only repeats it. */
.tag--hidden {
  border-style: dashed;
  border-color: var(--muted);
  color: var(--ink);
}

/* Unsaved text in a roadmap section. Revealed by the editor's guard script only. */
.tag--unsaved {
  border-color: var(--accent);
  color: var(--accent-text);
  background: var(--ground);
}

.generated {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
}

/* ---------------------------------------------------------------
   12. Flash messages
   --------------------------------------------------------------- */

.flash {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  background: var(--surface);
}

.flash p:last-child {
  margin-bottom: 0;
}

.flash--success {
  background: var(--tint-positive);
  border-color: var(--positive);
}

.flash--error {
  background: var(--tint-danger);
  border-color: var(--danger);
}

.flash--info {
  background: var(--tint-primary);
  border-color: var(--primary);
}

/* ---------------------------------------------------------------
   13. Dashboard counts and filters
   --------------------------------------------------------------- */

.counts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.count {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  min-width: 120px;
  color: var(--ink);
  text-decoration: none;
}

a.count:hover {
  border-color: var(--muted);
  color: var(--ink);
  text-decoration: none;
}

.count--active {
  border-color: var(--primary);
  border-width: 2px;
  padding: 11px 15px;
}

.count__n {
  display: block;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.4rem;
  line-height: 1.2;
}

.count__label {
  display: block;
  color: var(--muted);
  font-size: 0.875rem;
}

.filters,
.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 24px;
}

.filters .field,
.form-inline .field {
  margin: 0;
  min-width: 160px;
  flex: 0 1 auto;
}

/* Same row of controls, but sitting inside a table cell: no trailing gap. */

.form-inline {
  margin-bottom: 0;
}

/* ---------------------------------------------------------------
   14. Links, confirmation, error page
   --------------------------------------------------------------- */

.link-box {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  word-break: break-all;
  overflow-wrap: anywhere;
  user-select: all;
  -webkit-user-select: all;
  margin: 0 0 12px;
}

.inline-confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-top: 8px;
}

.inline-confirm[hidden] {
  display: none;
}

.inline-confirm__text {
  flex: 1 1 200px;
  margin: 0;
}

.error-page {
  max-width: 560px;
  margin: 40px auto;
  padding: 0 20px;
}

.error-page pre {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  overflow: auto;
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* -------------------------------------------------------------
   Annex 2 import: review screen and source panel
   ------------------------------------------------------------- */

.import-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--line-soft);
}

.import-section .import-row:first-of-type {
  border-top: 0;
}

.import-row__question {
  font-weight: 600;
  margin: 0 0 6px;
}

.import-response {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0 0 8px;
}

.import-target {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 12px 12px;
  margin-bottom: 12px;
}

/* Not applicable to the chosen entity type: the note says so, the dashed border repeats it. */
.import-target--inapplicable {
  border-style: dashed;
  background: var(--ground);
}

/* Collapsed blocks of the import pages: the summary is a 44 px target (rule 9). */
.import-source summary,
.import-help summary,
.import-v1 summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--primary);
}

.import-v1 summary {
  font-weight: 600;
}

@media (max-width: 720px) {
  .import-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
}

/* Ruling: the file input is an interactive target too (the global input rule excludes it). */
input[type="file"] {
  min-height: 44px;
}

input[type="file"]::file-selector-button {
  min-height: 44px;
  margin-right: 12px;
}

/* ---------------------------------------------------------------
   15. Print
   --------------------------------------------------------------- */

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .rail,
  .btn,
  .btn-row,
  .filters,
  .inline-confirm,
  .lang-switch {
    display: none !important;
  }

  .workbench {
    display: block;
  }

  .content {
    padding: 0;
  }

  .panel,
  .table {
    break-inside: avoid;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  .site-footer {
    background: none;
    color: #000;
    border-top: 1px solid #000;
    padding: 12px 0;
  }

  .site-footer a {
    color: #000;
  }
}

/* ---- layout details used by the WP1 templates ------------------------ */
.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
}
.skip-link:focus {
  left: 8px;
}
.brand-img {
  display: block;
  height: auto;
  max-width: 100%;
}
.rail__app {
  margin: 12px 0 0;
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
}
.rail__user-name {
  margin: 0;
  font-weight: 500;
}
.rail__user-partner {
  margin: 2px 0 10px;
  color: rgba(255, 255, 255, 0.75);
}
.progress-strip-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 20px 0;
}
.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  align-items: start;
}
.panel-grid .panel {
  margin-bottom: 0;
}
/* A panel whose table needs the whole row, e.g. the versions list on the case page. */
.panel-grid .panel--full {
  grid-column: 1 / -1;
}
.panel--personal {
  border-left: 3px solid var(--accent);
}
.panel--login {
  max-width: 480px;
  margin: 32px auto;
}
/* A text link on the sign-in screens with a 44px target (rule 9). */
.auth-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.link-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}
.link-list li {
  border-bottom: 1px solid var(--line-soft);
}
.link-list a {
  display: block;
  min-height: 44px;
  padding: 10px 0;
  text-decoration: none;
  font-weight: 500;
}
.link-list a:hover,
.link-list a:focus {
  text-decoration: underline;
}
.site-footer__project {
  margin: 4px 0 8px;
  opacity: 0.8;
}
.page-header > div {
  min-width: 0;
}
.dl dd + dt {
  margin-top: 0;
}
.page-header__actions .badge {
  align-self: center;
}

/* ---------------------------------------------------------------
   WP3 — assessment form, spider, score bars, action list
   --------------------------------------------------------------- */

.assessment-form {
  max-width: 720px;
}

.assessment-dimension {
  margin: 0 0 28px;
}

.assessment-dimension__title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 500;
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.assessment-question legend {
  font-size: 1rem;
  line-height: 1.4;
}

.assessment-question__suggestion {
  color: var(--muted);
  margin: 0 0 8px;
}

.scale-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.scale-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}

.scale-option:hover {
  border-color: var(--primary);
}

.scale-option:focus-within {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.scale-option:has(input:checked) {
  border-color: var(--primary);
  background: #EAF1F3;
}

.scale-option input {
  flex: 0 0 auto;
  margin: 0;
  width: 18px;
  height: 18px;
}

.scale-option__value {
  color: var(--muted);
  font-size: 0.875rem;
}

.scale-option__label {
  font-size: 0.9375rem;
  line-height: 1.3;
}

@media (max-width: 640px) {
  .scale-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* The entity self-check: one question per card, four large labelled buttons,
   a live answered counter. Scoped to its own component classes — not a
   reuse of .scale-options / .assessment-dimension, which stay the builder's
   field-grid shape via partials/assessment_form.php. */

.selfcheck-counter {
  display: inline-block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--tint-primary);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 6px 14px;
  margin: 0 0 20px;
}

.selfcheck-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0 0 24px;
}

.selfcheck-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin: 0;
  min-width: 0;
}

.selfcheck-card__legend {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0 0 14px;
}

.selfcheck-card__dimension {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.75rem;
  margin: 0 0 6px;
}

.selfcheck-card__question {
  display: block;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
}

.selfcheck-scale {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 640px) {
  .selfcheck-scale {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.selfcheck-scale__option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 64px;
  padding: 13px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-align: center;
  cursor: pointer;
}

.selfcheck-scale__option:hover {
  border-color: var(--primary);
}

/* The native input stays in the accessibility tree and keyboard tab order —
   only its visual box is hidden. The label around it is styled as the button. */
.selfcheck-scale__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.selfcheck-scale__option:has(.selfcheck-scale__input:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Checked state: never colour alone — the border doubles in width (1px to
   2px, compensated in padding above so nothing shifts) on top of the colour
   change, the label gains weight, and a checkmark glyph appears. */
.selfcheck-scale__option:has(.selfcheck-scale__input:checked) {
  border-width: 2px;
  border-color: var(--primary);
  background: var(--tint-primary);
  padding: 12px 10px;
}

.selfcheck-scale__option:has(.selfcheck-scale__input:checked) .selfcheck-scale__label {
  font-weight: 700;
}

.selfcheck-scale__option:has(.selfcheck-scale__input:checked)::after {
  content: "✓";
  position: absolute;
  top: 4px;
  right: 6px;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.8125rem;
}

.selfcheck-scale__value {
  color: var(--muted);
  font-size: 0.8125rem;
}

.selfcheck-scale__label {
  font-size: 0.9375rem;
  line-height: 1.3;
}

/* Spider and score table side by side only where both fit: the score column
   ("2.5 / 4") must never be clipped — the numbers are the accessible carrier of
   the result (rule 9). In the 720px entity column this stacks. */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: 24px 40px;
  align-items: start;
  margin-bottom: 24px;
}

.spider-wrap {
  margin: 0 auto;
  /* The viewBox widens with long dimension labels (SpiderSvg); keep the plot readable. */
  max-width: 560px;
  width: 100%;
}

.spider-wrap svg {
  display: block;
  width: 100%;
  height: auto;
}

.table--scores th.num,
.table--scores td.num {
  text-align: right;
  white-space: nowrap;
}

.score-bar-cell {
  width: 40%;
  min-width: 80px;
}

.score-bar {
  display: block;
  height: 10px;
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.score-bar__fill {
  display: block;
  height: 100%;
  background: var(--primary);
}

.table__total th,
.table__total td {
  border-top: 2px solid var(--line-strong, #C9C6BE);
  font-weight: 600;
}

.dl--band {
  margin-top: 16px;
}

.band {
  display: inline-block;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--primary);
  color: var(--primary);
}

.band--low {
  border-color: var(--accent-text);
  color: var(--accent-text);
}

.band--high {
  border-color: var(--positive);
  color: var(--positive);
}

.panel__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.panel__head .panel__title {
  margin: 0;
}

.actions-group {
  margin: 20px 0 0;
}

.actions-group__title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  margin: 0 0 8px;
}

.actions-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.action-row {
  border-top: 1px solid var(--line-soft);
  padding: 12px 0;
}

.action-row:last-child {
  border-bottom: 1px solid var(--line-soft);
}

.action-row--dropped .action-row__text,
.action-row--dropped .action-edit__text {
  /* struck through and muted (5.5:1) rather than faded below 4.5:1 */
  color: var(--muted);
  text-decoration: line-through;
}

.action-row__text {
  margin: 0 0 6px;
}

.action-row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  color: var(--muted);
}

.tag--annex {
  border-color: var(--positive);
  color: var(--positive);
}

.action-edit .field {
  margin-bottom: 8px;
}

.action-edit__text {
  width: 100%;
}

.action-edit__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 8px 16px;
  align-items: end;
}

.action-edit__buttons {
  margin-bottom: 8px;
}

@media (max-width: 720px) {
  .action-edit__row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.action-add {
  margin-top: 20px;
}

/* Case screen: why the case has its status, and what changes it. */
.status-now {
  margin: 12px 0 4px;
}

.status-help {
  margin-bottom: 12px;
}

.status-help summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--primary);
  font-size: 0.875rem;
}

.status-help__list {
  margin: 0 0 4px;
  padding-left: 1.2em;
}

.status-help__list li {
  margin-bottom: 4px;
}

.action-add summary {
  display: inline-flex;
  list-style: none;
  cursor: pointer;
}

.action-add summary::-webkit-details-marker {
  display: none;
}

.action-add[open] summary {
  margin-bottom: 12px;
}

.profile-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px 16px;
  margin: 0 0 12px;
}

.profile-summary dt {
  color: var(--muted);
  font-size: 0.8125rem;
}

.profile-summary dd {
  margin: 2px 0 0;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------
   WP2 — questionnaire, entity landing, privacy, case-file completeness
   --------------------------------------------------------------- */

.lead {
  font-size: 1.05rem;
  max-width: 62ch;
}

.h2 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.3rem;
  margin: 0 0 8px;
}

.h3 {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1.1rem;
  margin: 24px 0 8px;
}

.h4 {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1rem;
  margin: 20px 0 6px;
}

.section-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 24px;
}

.section-header__kicker {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0 0 4px;
}

.section-header__intro {
  color: var(--muted);
  margin: 8px 0 0;
  max-width: 62ch;
}

.notice {
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px 20px;
  margin: 0 0 24px;
}

.notice__title {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1rem;
  margin: 0 0 6px;
}

.notice p:last-child {
  margin-bottom: 0;
}

.notice--hidden {
  border-left-color: var(--accent);
}

.notice--hidden form {
  margin-top: 12px;
}

.prose {
  max-width: 68ch;
}

.prose p {
  margin: 0 0 12px;
}

.steps-list {
  padding-left: 1.4em;
  max-width: 62ch;
}

.steps-list li {
  margin-bottom: 8px;
}

/* Landing page: the self-check card, the energy-data card and the profile
   link as one row of equal-height cards, so a short bare link never floats
   mid-height next to the two taller heading+subtitle+button cards. */
.landing-next-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 16px;
  margin: 0 0 24px;
}

.landing-next-steps > .panel {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 0;
}

.landing-next-steps > .panel > h3 {
  margin: 0;
}

.landing-next-steps > .panel > .btn {
  margin-top: auto;
  align-self: flex-start;
}

.panel--submit {
  border-left: 3px solid var(--accent);
}

/* The reconciliation block on the entity profile: where an energy-data answer
   contradicts the self-check, one short entry per pair and two buttons. Its own
   scoped classes — it is a list of decisions, not another panel body; the
   buttons compose .btn / .btn-row rather than restating them. The accent
   border comes from .panel--submit in the markup (not restated here), and the
   profile screen keeps it only on this block — it is the one asking a
   question, so the accent reads as "act on this" in one place per screen. */

.reconcile__list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.reconcile__item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  min-width: 0;
}

.reconcile__line {
  margin: 0 0 6px;
  line-height: 1.5;
}

.reconcile__prompt {
  margin: 12px 0 8px;
  font-weight: 600;
}

.reconcile__choice .btn-row {
  margin: 0;
}

.error-list {
  margin: 8px 0 0;
  padding-left: 1.2em;
}

.error-list li {
  margin-bottom: 2px;
}

/* form grid: two columns for short controls, full width for the rest */
.form-grid--questionnaire {
  align-items: start;
}

.field--hidden {
  display: none !important;
}

.field__fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.field__fieldset > legend {
  padding: 0;
  margin-bottom: 4px;
  font-family: var(--font-body);
}

.field__hint-line {
  margin: 0 0 4px;
}

.field__hint-line:last-child {
  margin-bottom: 0;
}

.field__sublabel {
  display: block;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.choice--muted {
  color: var(--muted);
}

.input-unit--narrow {
  max-width: 260px;
}

.input-unit__select {
  width: auto;
  min-width: 90px;
  flex: 0 0 auto;
  border-radius: 0 var(--radius) var(--radius) 0;
  border-left: 0;
  background-color: var(--ground);
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.field__hint--unit {
  margin-top: 4px;
}

.group-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 16px;
}

@media (max-width: 640px) {
  .group-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.table--compact th,
.table--compact td {
  padding: 6px 12px;
}

.table--compact .input--count {
  max-width: 140px;
  margin-left: auto;
  text-align: right;
}

.tag--personal {
  border-color: var(--accent);
  color: var(--accent-text);
}

.questionnaire__actions {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 24px;
}

/* builder: section navigation beside the form */
.questionnaire-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

@media (max-width: 900px) {
  .questionnaire-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.section-nav__list,
.section-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.section-nav__item a,
.section-list__item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
  color: inherit;
}

.section-nav__item a:hover,
.section-nav__item a:focus-visible {
  text-decoration: underline;
}

.section-nav__item--current a {
  color: var(--primary);
  font-weight: 600;
  border-left: 3px solid var(--accent);
  padding-left: 8px;
}

.section-nav__count,
.section-list__count {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.875rem;
}

.section-list__item a {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

.section-list__item a:hover,
.section-list__item a:focus-visible {
  text-decoration: underline;
}

.section-list__item--done .section-list__count {
  color: var(--positive);
}

.section-list__item--started .section-list__count {
  color: var(--primary);
}

.barrier-list {
  margin: 0;
  padding-left: 1.2em;
}

/* ---------------------------------------------------------------
   WP4 — roadmap editor, reports, danger zone
   --------------------------------------------------------------- */

.roadmap-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px 20px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.roadmap-agree summary {
  list-style: none;
  cursor: pointer;
}

.roadmap-agree summary::-webkit-details-marker {
  display: none;
}

.roadmap-agree__form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 12px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.roadmap-agree__form .field {
  margin: 0;
}

.roadmap-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

@media (max-width: 900px) {
  .roadmap-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.roadmap-side {
  position: sticky;
  top: 16px;
}

@media (max-width: 900px) {
  .roadmap-side {
    position: static;
  }
}

.roadmap-nav__list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  border-top: 1px solid var(--line);
}

.roadmap-nav__item a {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 44px;
  padding: 6px 4px;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
  color: inherit;
}

.roadmap-nav__item a:hover,
.roadmap-nav__item a:focus-visible {
  text-decoration: underline;
}

.roadmap-nav__state {
  margin-left: auto;
}

.panel--compact {
  padding: 12px 16px;
}

.roadmap-exports {
  list-style: none;
  margin: 0;
  padding: 0;
}

.roadmap-exports li {
  padding: 4px 0;
  border-bottom: 1px solid var(--line-soft);
}

.roadmap-section {
  scroll-margin-top: 16px;
}

.roadmap-section .panel__head {
  align-items: center;
}

.roadmap-textarea {
  width: 100%;
  min-height: 12em;
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
  overflow: hidden;
}

.roadmap-textarea.generated {
  border-left: 3px solid var(--accent);
}

.roadmap-preview {
  margin-top: 12px;
  border-top: 1px solid var(--line-soft);
  padding-top: 8px;
}

.roadmap-preview summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.875rem;
}

.roadmap-preview__body {
  padding: 8px 0 4px;
}

.roadmap-preview__body .rm-h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  margin: 12px 0 4px;
}

.roadmap-preview__body .rm-list {
  margin: 0 0 8px;
  padding-left: 1.2em;
}

.src {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-text);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 0 4px;
  vertical-align: middle;
  white-space: nowrap;
}

.panel--danger {
  border-color: #C2703A;
}

.danger-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 16px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}

@media (max-width: 700px) {
  .danger-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.notice--warning {
  border-left: 3px solid var(--accent);
}

.invite-option {
  margin-top: 16px;
  padding-top: 4px;
  border-top: 1px solid var(--line-soft);
}

.invite-option .h4 {
  margin-top: 12px;
}

.invite-form .btn,
.invite-option form .btn {
  margin-bottom: 6px;
}

.report-columns {
  word-break: break-word;
}

/* -------------------------------------------------------------
   Administration (users, partners, account)
   ------------------------------------------------------------- */

.rail__account {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.rail__account form {
  margin-top: 0;
}

.rail .btn--ghost-active {
  border-color: var(--accent);
}

.badge--inactive {
  background: var(--ground);
  color: var(--muted);
  border: 1px solid var(--line);
}

.roles {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 24px;
}

.roles dt {
  font-weight: 600;
}

.roles dd {
  margin: 0;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  margin: 0 0 16px;
}

.meta div {
  display: flex;
  gap: 8px;
}

.meta dt {
  color: var(--muted);
}

.meta dd {
  margin: 0;
}

#manual-password[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .roles {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .roles dd {
    margin-bottom: 8px;
  }
}

/* Question set v2: evidence note under each reflection prompt, and the "what a low score means" line. */
.assessment-evidence {
  margin-top: 0.75rem;
}
.assessment-evidence textarea {
  width: 100%;
}
.assessment-question__source {
  white-space: nowrap;
}
/* The organisation's Quick Check answers behind a prompt (builder, read-only). */
.assessment-answers {
  margin: 0.5rem 0 0.75rem;
  padding: 0 12px 4px;
  background: var(--ground);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}
.assessment-answers summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 0.35em;
  color: var(--primary);
  font-size: 0.875rem;
}
.assessment-answers summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.assessment-answers__list {
  padding: 4px 0 8px;
}
.assessment-answers__list .import-response {
  display: block;
  margin: 0;
}
@media print {
  .assessment-answers {
    background: none;
    border-color: #000;
    break-inside: avoid;
  }
  .assessment-answers summary {
    color: #000;
    min-height: 0;
  }
}
.score-meaning {
  display: block;
  font-weight: 400;
}

/* Maintenance mode: the notice everyone else sees, and the super administrator's banner.
   Ink on the light accent tint is well above 4.5:1; the link keeps a 44px target (rule 9). */
.maintenance-notice {
  max-width: 560px;
  margin: 32px auto;
}
.maintenance-notice__text {
  font-size: 1.125rem;
}
.maintenance-notice__owner {
  margin: 24px 0 0;
}
.maintenance-banner {
  background: #FBF1E9;
  border: 1px solid var(--accent);
  border-left-width: 4px;
  border-radius: var(--radius);
  color: var(--ink);
  padding: 4px 16px;
  margin-bottom: 16px;
}
.maintenance-banner p {
  margin: 0;
}
.maintenance-banner a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-left: 4px;
}
.admin-maintenance__status {
  font-weight: 600;
}

/* View as user (support, read-only): banner on every page while active. The server refuses every
   change anyway; the dimmed, disabled buttons only say so before the click. */
.view-as-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  background: var(--accent-text);
  color: #FFFFFF;
  border-radius: var(--radius);
  padding: 8px 16px;
  margin-bottom: 16px;
}
.view-as-banner__text {
  margin: 0;
}
.view-as-banner__form {
  margin: 0;
}
.view-as-banner__button {
  min-height: 44px;
  background: #FFFFFF;
  color: var(--ink);
  border: 2px solid #FFFFFF;
  font-weight: 600;
}
.view-as-banner__button:hover,
.view-as-banner__button:focus-visible {
  background: var(--ground);
  color: var(--ink);
}
.view-as-banner__button:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}
.body--view-as main form[method="post"]:not([data-view-as-allowed]) [type="submit"] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Session warning (partials/session_warning.php, shown by app.js) */
.session-warning {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  max-width: 640px;
  margin: 0 auto;
  background: #FBF1E9;
  border: 1px solid var(--accent);
  border-left-width: 4px;
  border-radius: var(--radius);
  color: var(--ink);
  padding: 12px 16px;
}
.session-warning[hidden],
.session-warning [hidden] {
  display: none;
}
.session-warning p {
  margin: 0 0 8px;
}
.session-warning [data-session-expired] {
  margin: 0;
}
.session-warning a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
