
/* =============================================================
   AI Governance Risk Appetite Assessment — Allen + Clarke
   Redesigned to follow the Allen + Clarke Design System
   ============================================================= */

:root {
  /* Allen + Clarke brand colours */
  --ac-pine:        #007E00;
  --ac-green:       #77B800;
  --ac-grey:        #36424A;
  --ac-black:       #000000;
  --ac-white:       #FFFFFF;
  --ac-pear:        #D1E3B0;
  --ac-light-grey:  #EBECED;
  
  /* Semantic roles */
  --fg-body:        #36424A;
  --fg-muted:       #6B7479;
  --fg-on-dark:     #FFFFFF;
  --fg-link:        #007E00;
  
  --bg-page:        #F7F8FA;
  --bg-card:        #FFFFFF;
  --bg-subtle:      #EBECED;
  --bg-tint:        #F0F7EB;
  --bg-selected:    #D1E3B0;
  --bg-dark:        #36424A;
  
  --border-light:   #E4E6E8;
  --border-default: #CCCCCC;
  --border-strong:  #36424A;
  
  --approved:       #007E00;
  --conditional:    #E8A838;
  --not-approved:   #B91C1C;
  
  /* Typography */
  --font-display:   'Inter Tight', 'Neue Haas Grotesk Display Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-body:      'Avenir LT Pro', 'Avenir Next', Avenir, 'Nunito Sans', 'Segoe UI', Arial, sans-serif;
  --font-docs:      Arial, 'Helvetica Neue', Helvetica, sans-serif;
  
  /* Spacing (4px base) */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-7:  32px;
  --space-8:  40px;
  --space-9:  56px;
  --space-10: 72px;
  
  /* Radii — slightly rounded */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-pill: 999px;
  
  /* Shadows — restrained */
  --shadow-xs:    0 1px 2px rgba(54, 66, 74, 0.06);
  --shadow-sm:    0 2px 6px rgba(54, 66, 74, 0.08);
  --shadow-md:    0 6px 16px rgba(54, 66, 74, 0.10);
  --shadow-focus: 0 0 0 3px rgba(0, 126, 0, 0.25);
  
  /* Motion */
  --ease-standard: cubic-bezier(0.2, 0.0, 0.2, 1);
  --dur-fast:      120ms;
  --dur-std:       200ms;
  --dur-slow:      320ms;
  
  /* Layout */
  --maxw: 900px;
}

/* -------------------------------------------------------------
   Inter Tight (display headings) — self-hosted, OFL licensed.
   Variable weight; latin + latin-ext (latin-ext covers macrons
   for te reo Māori). Body text uses the system stack below.
   ------------------------------------------------------------- */
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-tight-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-tight-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--fg-body);
  background: var(--bg-page);
  font-weight: 400;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[hidden] {
  display: none !important;
}

/* -------------------------------------------------------------
   Site header — dark band with Pine accent
   ------------------------------------------------------------- */

.site-header {
  background: var(--bg-dark);
  color: var(--fg-on-dark);
  border-bottom: 4px solid var(--ac-pine);
}

.site-header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--space-6) var(--space-5);
}

.brand-lockup {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-6);
  align-items: center;
}

.brand-logo {
  display: block;
  width: 220px;
  height: auto;
}

.site-header .brand {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ac-green);
  margin: 0 0 var(--space-2);
}

.site-header .tool-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--fg-on-dark);
}

.site-header .tool-desc {
  font-size: 15px;
  color: #B8C0C5;
  margin: var(--space-2) 0 0;
  max-width: 64ch;
  line-height: 1.45;
}

/* -------------------------------------------------------------
   Layout container
   ------------------------------------------------------------- */

#app {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--space-8) var(--space-5) var(--space-10);
}

[data-state] {
  padding: 0;
}

/* Intro — white card */
#state-intro {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-8);
}

#state-intro p[data-intro-body] {
  max-width: 64ch;
  line-height: 1.6;
}

#identify-form {
  margin-top: var(--space-7);
}

/* -------------------------------------------------------------
   Typography
   ------------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ac-pine);
  margin: 0 0 var(--space-4);
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  font-size: 32px;
  font-weight: 700;
}

h2 {
  font-size: 28px;
  font-weight: 700;
}

h3 {
  font-size: 18px;
  font-weight: 700;
}

h4 {
  font-size: 16px;
  font-weight: 700;
}

p[data-subheading] {
  font-size: 16px;
  color: var(--fg-muted);
  margin: 0 0 var(--space-7);
  max-width: 64ch;
  line-height: 1.5;
}

/* -------------------------------------------------------------
   Buttons
   ------------------------------------------------------------- */

button,
.btn {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  padding: 13px 24px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--dur-std) var(--ease-standard);
}

button[data-action="start"],
button[data-action="submit"],
button[data-action="next"],
button[data-action="save-org"],
button[data-action="retry"] {
  background: var(--ac-pine);
  color: var(--fg-on-dark);
}

button[data-action="start"]:hover,
button[data-action="submit"]:hover,
button[data-action="next"]:hover,
button[data-action="save-org"]:hover,
button[data-action="retry"]:hover {
  background: #006b00;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 126, 0, 0.2);
}

button[data-action="start"]:active,
button[data-action="submit"]:active,
button[data-action="next"]:active,
button[data-action="save-org"]:active,
button[data-action="retry"]:active {
  transform: translateY(0);
}

button[data-action="back"],
.btn.secondary {
  background: var(--bg-card);
  color: var(--ac-pine);
  border: 1px solid var(--ac-pine);
  text-decoration: none;
}

button[data-action="back"]:hover,
.btn.secondary:hover {
  background: var(--bg-tint);
  transform: translateY(-1px);
}

#identify-form button[data-action="start"] {
  width: 100%;
  margin-top: var(--space-2);
}

button[disabled],
button:disabled {
  background: var(--bg-subtle);
  color: var(--fg-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

footer[data-state-footer] {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  margin-top: var(--space-8);
}

footer[data-state-footer] button[data-action="next"],
footer[data-state-footer] button[data-action="submit"] {
  margin-left: auto;
}

/* -------------------------------------------------------------
   Progress indicator — stepped with milestones
   ------------------------------------------------------------- */

#progress-indicator {
  max-width: var(--maxw);
  margin: 0 auto var(--space-6);
  padding: var(--space-3) var(--space-5);
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-page);
}

#progress-indicator .progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--fg-muted);
  margin-bottom: var(--space-3);
}

#progress-indicator .progress-label::after {
  content: '12 scenarios';
  font-weight: 400;
  color: var(--fg-muted);
}

#progress-indicator .progress-track {
  position: relative;
  height: 8px;
  background: var(--bg-subtle);
  border-radius: var(--radius-pill);
  overflow: visible;
}

#progress-indicator .bar {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ac-pine);
  border-radius: var(--radius-pill);
  transition: width var(--dur-slow) var(--ease-standard);
  position: relative;
}

#progress-indicator.is-advancing .bar::after {
  content: '';
  position: absolute;
  inset: -4px -8px;
  border-radius: var(--radius-pill);
  background: rgba(119, 184, 0, 0.2);
  animation: progress-pulse 220ms var(--ease-standard) 1;
  pointer-events: none;
}

/* Stepped milestone markers */
#progress-indicator .progress-track::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background-image: 
    repeating-linear-gradient(
      to right,
      transparent 0%,
      transparent calc(8.333% - 1px),
      var(--bg-page) calc(8.333% - 1px),
      var(--bg-page) calc(8.333%)
    );
  pointer-events: none;
  border-radius: var(--radius-pill);
}

/* -------------------------------------------------------------
   Form fields
   ------------------------------------------------------------- */

[data-field] {
  margin-bottom: var(--space-5);
}

label,
.field-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--fg-body);
  margin-bottom: var(--space-2);
}

input[type="email"],
input[type="text"],
textarea,
select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--fg-body);
  padding: 11px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  transition: all var(--dur-std) var(--ease-standard);
}

input[type="email"]:focus,
input[type="text"]:focus,
textarea:focus,
select:focus {
  border-color: var(--ac-pine);
  outline: none;
  box-shadow: var(--shadow-focus);
}

textarea {
  resize: vertical;
  min-height: 84px;
  line-height: 1.5;
}

p[data-privacy-note] {
  font-size: 13px;
  color: var(--fg-muted);
  margin: 0 0 var(--space-2);
  line-height: 1.5;
}

.field-error {
  font-size: 13px;
  font-weight: 700;
  color: var(--not-approved);
  margin-top: var(--space-2);
}

/* -------------------------------------------------------------
   Scenario cards — document-style with Pine left accent
   ------------------------------------------------------------- */

#question-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-bottom: var(--space-4);
}

.question-transition-status {
  min-height: 20px;
  margin: 0 0 var(--space-2);
  font-size: 14px;
  font-weight: 700;
  color: var(--ac-pine);
  line-height: 1.4;
}

.question-transition-status[hidden] {
  display: none;
}

.question-card {
  padding: var(--space-6);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--ac-pine);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--dur-std) var(--ease-standard);
  scroll-margin-top: 96px;
}

.question-card:hover {
  box-shadow: var(--shadow-sm);
}

.question-card.is-advancing {
  animation: question-card-soft-exit 220ms var(--ease-standard) forwards;
}

.question-card.is-entering {
  animation: question-card-soft-enter 220ms var(--ease-standard);
}

.question-card .scenario-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--ac-pine);
  margin: 0 0 var(--space-3);
  line-height: 1.3;
}

.question-card .scenario-situation {
  font-size: 15px;
  color: var(--fg-body);
  margin: 0 0 var(--space-6);
  line-height: 1.5;
  max-width: 72ch;
}

@keyframes question-card-soft-exit {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0.72;
    transform: translateY(-4px);
  }
}

@keyframes question-card-soft-enter {
  from {
    opacity: 0.86;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes progress-pulse {
  from {
    opacity: 0.9;
    transform: scaleX(0.98);
  }
  to {
    opacity: 0;
    transform: scaleX(1.04);
  }
}

/* -------------------------------------------------------------
   Likert scale — minimal radio-style with number rings
   ------------------------------------------------------------- */

.likert {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-3);
}

.likert .likert-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-2);
  font-size: 13px;
  color: var(--fg-body);
  padding: var(--space-4) var(--space-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  cursor: pointer;
  transition: all var(--dur-std) var(--ease-standard);
}

.likert .likert-option:hover {
  border-color: var(--ac-pine);
  background: var(--bg-tint);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.likert .likert-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 2px solid var(--border-default);
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  color: var(--fg-body);
  transition: all var(--dur-std) var(--ease-standard);
}

.likert .likert-label {
  line-height: 1.3;
  font-weight: 500;
}

.likert .likert-option.is-selected {
  border-color: var(--ac-pine);
  background: var(--bg-selected);
}

.likert .likert-option.is-selected .likert-number {
  background: var(--ac-pine);
  border-color: var(--ac-pine);
  color: var(--fg-on-dark);
}

/* Accessible hidden radios */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.likert .likert-option:focus-within {
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* Unanswered scenario flagged on submit */
.question-card.is-missing {
  border-left-color: var(--not-approved);
  background: #FEF5F5;
}

.question-card [data-card-error] {
  margin: var(--space-4) 0 0;
}

/* Optional per-scenario note */
.question-card .scenario-note {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-light);
}

.note-toggle {
  font-size: 13px;
  font-weight: 700;
  color: var(--ac-pine);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: opacity var(--dur-fast) var(--ease-standard);
}

.note-toggle:hover {
  opacity: 0.75;
  text-decoration: underline;
}

.note-field {
  margin-top: var(--space-3);
}

.note-field label {
  font-size: 13px;
  font-weight: 700;
}

p[data-answered-count] {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-muted);
  margin: 0 0 var(--space-2);
}

/* -------------------------------------------------------------
   Submitting state — calm loading
   ------------------------------------------------------------- */

#state-submitting {
  text-align: center;
  min-height: 40vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#state-submitting [data-submitting-loading] p,
#state-submitting [data-submitting-error] p {
  color: var(--fg-muted);
  max-width: 48ch;
  line-height: 1.5;
}

.loading-bar {
  width: 280px;
  height: 6px;
  margin: var(--space-7) auto 0;
  background: var(--bg-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.loading-bar::after {
  content: "";
  display: block;
  width: 40%;
  height: 100%;
  background: var(--ac-pine);
  border-radius: var(--radius-pill);
  animation: indeterminate 1.4s ease-in-out infinite;
}

@keyframes indeterminate {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(320%); }
}

@media (prefers-reduced-motion: reduce) {
  .loading-bar::after { 
    animation: none; 
    width: 100%; 
    opacity: 0.6; 
  }
  #progress-indicator .bar,
  .likert .likert-option,
  button { 
    transition: none; 
  }
  #progress-indicator.is-advancing .bar::after,
  .question-card.is-advancing,
  .question-card.is-entering {
    animation: none;
  }
  .question-card.is-advancing,
  .question-card.is-entering,
  .likert .likert-option:hover {
    opacity: 1;
    transform: none;
  }
}

/* -------------------------------------------------------------
   Personal result — enhanced visual treatment
   ------------------------------------------------------------- */

#state-result {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-8);
}

#state-result > h2 {
  text-align: center;
  font-size: 28px;
  margin-bottom: var(--space-6);
}

#result-band {
  margin: var(--space-6) 0 var(--space-9);
  padding: var(--space-9) var(--space-7);
  border: 2px solid var(--ac-pine);
  border-top: 8px solid var(--ac-pine);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--bg-tint) 0%, #E8F5E0 100%);
  box-shadow: 0 8px 24px rgba(0, 126, 0, 0.12);
  position: relative;
}

/* Decorative accent corner */
#result-band::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle at top right, rgba(0, 126, 0, 0.08) 0%, transparent 70%);
  border-radius: 0 var(--radius-lg) 0 0;
  pointer-events: none;
}

#result-band .band-score {
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 900;
  color: var(--ac-pine);
  line-height: 1;
  margin: 0;
  text-align: center;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 4px rgba(0, 126, 0, 0.1);
}

#result-band .band-name {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--ac-grey);
  margin: var(--space-4) 0 0;
  text-align: center;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

#result-band .band-summary {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  color: var(--fg-body);
  margin: var(--space-5) auto 0;
  text-align: center;
  line-height: 1.6;
  max-width: 56ch;
}

p[data-result-readout] {
  max-width: 68ch;
  margin: 0 0 var(--space-8);
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg-body);
}

/* Per-domain horizontal bars */
#result-domains {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin: 0 0 var(--space-8);
  padding: var(--space-6);
  background: var(--bg-page);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

#result-domains .domain-row {
  display: grid;
  grid-template-columns: 240px 1fr 56px;
  align-items: center;
  gap: var(--space-4);
}

#result-domains .domain-row .domain-statement {
  grid-column: 1 / -1;
  font-size: 14px;
  color: var(--fg-muted);
  margin: var(--space-2) 0 0;
  line-height: 1.5;
  font-style: italic;
}

#result-domains .domain-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--fg-body);
  line-height: 1.3;
}

#result-domains .domain-meter {
  height: 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}

#result-domains .domain-meter .fill {
  display: block;
  height: 100%;
  background: var(--ac-pine);
  border-radius: var(--radius-pill);
  transition: width var(--dur-slow) var(--ease-standard);
}

#result-domains .domain-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--fg-body);
  text-align: right;
  font-family: var(--font-display);
}

p[data-result-footnote] {
  font-size: 14px;
  color: var(--fg-muted);
  max-width: 64ch;
  margin: 0;
  line-height: 1.5;
}

.org-insight {
  margin-top: var(--space-8);
  padding: var(--space-6);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--ac-pine);
  border-radius: var(--radius-lg);
  background: var(--bg-page);
}

.org-insight-copy h3 {
  margin-bottom: var(--space-2);
}

.org-insight-copy p {
  max-width: 64ch;
  margin: 0 0 var(--space-5);
  color: var(--fg-muted);
  font-size: 15px;
}

.org-insight form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: end;
  gap: var(--space-4);
}

.org-insight form [data-field] {
  margin-bottom: 0;
}

.org-insight form [data-privacy-note] {
  grid-column: 1 / -1;
}

.checkbox-field {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  align-items: start;
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-body);
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--ac-pine);
}

.risk-themes {
  margin: 0 0 var(--space-8);
  padding-top: var(--space-7);
  border-top: 1px solid var(--border-light);
}

.risk-themes h3 {
  margin-bottom: var(--space-2);
}

.risk-theme-intro {
  max-width: 68ch;
  margin: 0 0 var(--space-5);
  color: var(--fg-muted);
  font-size: 15px;
}

.risk-theme-group {
  padding: var(--space-5);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-page);
}

.risk-theme-group h4 {
  color: var(--ac-grey);
  margin-bottom: var(--space-4);
}

.risk-theme-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-4);
}

.risk-theme-list li {
  display: grid;
  gap: var(--space-1);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-light);
}

.risk-theme-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.risk-theme-scenario {
  font-weight: 700;
  color: var(--fg-body);
}

.risk-theme-answer {
  font-size: 13px;
  font-weight: 700;
  color: var(--ac-pine);
}

.risk-theme-stance {
  justify-self: start;
  padding: 3px 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 700;
}

.risk-theme-text,
.risk-theme-empty {
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.5;
}

.org-insight-result {
  margin-top: var(--space-5);
  padding: var(--space-5);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.org-insight-result.is-building {
  border-left: 4px solid var(--conditional);
}

.org-insight-result.is-error {
  border-left: 4px solid var(--not-approved);
}

.org-insight-result h4 {
  margin-bottom: var(--space-2);
}

.org-insight-result h5 {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.2;
  color: var(--ac-grey);
  margin: 0 0 var(--space-3);
}

.org-insight-score {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  color: var(--ac-pine);
  margin: 0 0 var(--space-2);
}

.org-insight-score span {
  font-size: 18px;
  color: var(--ac-grey);
}

.org-insight-meta {
  font-size: 13px;
  color: var(--fg-muted);
  margin: var(--space-3) 0 0;
}

.org-insight-meta.is-warning {
  color: var(--conditional);
  font-weight: 700;
}

.sample-progress {
  margin-bottom: var(--space-5);
  padding: var(--space-5);
  border: 1px solid var(--ac-pear);
  border-radius: var(--radius-lg);
  background: var(--bg-tint);
}

.sample-progress-kicker {
  margin: 0 0 var(--space-2);
  color: var(--fg-muted);
  font-size: 14px;
  font-weight: 700;
}

.sample-progress h4 {
  margin: 0;
  color: var(--ac-grey);
  font-size: 30px;
  line-height: 1.15;
}

.sample-progress h4 span {
  color: var(--ac-pine);
}

.sample-progress-track {
  height: 14px;
  margin: var(--space-4) 0 var(--space-3);
  overflow: hidden;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  background: var(--ac-white);
}

.sample-progress-track span {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--ac-pine);
}

.sample-progress-next {
  margin: 0;
  color: var(--ac-grey);
  font-size: 17px;
  font-weight: 700;
}

.invite-colleagues {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-light);
}

.invite-colleagues p {
  margin: 0 0 var(--space-4);
}

.share-link {
  margin-bottom: var(--space-3);
  font-family: var(--font-docs);
  color: var(--fg-muted);
}

.invite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.invite-actions .btn.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.copy-status {
  margin: var(--space-3) 0 0;
  color: var(--ac-pine);
  font-size: 15px;
  font-weight: 700;
}

.copy-status:empty {
  display: none;
}

.org-insight-domains {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.org-insight-domains .domain-row {
  display: grid;
  grid-template-columns: 220px 1fr 56px;
  align-items: center;
  gap: var(--space-3);
}

.org-insight-domains .domain-label {
  font-size: 14px;
  font-weight: 700;
}

.org-insight-domains .domain-meter {
  height: 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.org-insight-domains .domain-meter .fill {
  display: block;
  height: 100%;
  background: var(--ac-pine);
}

.org-insight-domains .domain-value {
  font-family: var(--font-display);
  font-weight: 700;
  text-align: right;
}

.org-risk-tradeoffs,
.org-next-steps {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-light);
}

.org-risk-tradeoffs > p {
  max-width: 68ch;
  margin: 0 0 var(--space-4);
  color: var(--fg-muted);
  font-size: 14px;
  line-height: 1.5;
}

.org-risk-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.org-risk-category {
  padding: var(--space-4);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-page);
}

.org-risk-category h6 {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.25;
  color: var(--ac-grey);
}

.org-risk-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.org-risk-list li {
  display: grid;
  gap: var(--space-1);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-light);
}

.org-risk-list li:first-child {
  padding-top: 0;
  border-top: 0;
}

.org-risk-scenario-title {
  color: var(--fg-body);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.org-risk-scenario-detail,
.org-risk-empty {
  color: var(--fg-muted);
  font-size: 13px;
  line-height: 1.45;
}

.org-next-steps ul {
  margin: 0;
  padding-left: 1.2em;
  color: var(--fg-body);
  font-size: 14px;
  line-height: 1.55;
}

.org-next-steps li + li {
  margin-top: var(--space-2);
}

.org-booking {
  margin-top: var(--space-5);
  padding: var(--space-5);
  border: 1px solid var(--ac-pear);
  border-radius: var(--radius-lg);
  background: var(--bg-tint);
}

.org-booking p {
  margin: 0 0 var(--space-4);
  color: var(--fg-body);
  font-size: 15px;
  line-height: 1.5;
}

.org-booking-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ac-pine);
  color: var(--fg-on-dark);
  text-decoration: none;
}

.org-booking-cta:hover {
  background: #006b00;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 126, 0, 0.2);
}

.org-booking-cta:active {
  transform: translateY(0);
}

/* -------------------------------------------------------------
   Responsive — single column, mobile-friendly
   ------------------------------------------------------------- */

@media (max-width: 640px) {
  #app {
    padding: var(--space-6) var(--space-4) var(--space-9);
  }

  .site-header-inner {
    padding: var(--space-5) var(--space-4);
  }

  .brand-lockup {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .brand-logo { width: 190px; }

  .site-header .tool-title {
    font-size: 22px;
  }

  h1 {
    font-size: 26px;
  }

  h2 {
    font-size: 22px;
  }

  #state-intro,
  #state-result {
    padding: var(--space-6);
  }

  .likert {
    gap: var(--space-2);
  }

  .likert .likert-option {
    padding: var(--space-3) var(--space-1);
    font-size: 11px;
  }

  .likert .likert-number {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }

  #result-domains .domain-row {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  #result-domains .domain-value {
    text-align: left;
    grid-row: 1;
    grid-column: 1;
    justify-self: end;
  }

  #result-domains .domain-label {
    grid-row: 1;
    grid-column: 1;
  }

  #result-domains .domain-meter {
    grid-row: 2;
    grid-column: 1;
  }

  .org-insight form,
  .org-insight-domains .domain-row {
    grid-template-columns: 1fr;
  }

  .org-risk-grid {
    grid-template-columns: 1fr;
  }

  .org-booking-cta {
    width: 100%;
    text-align: center;
  }

  footer[data-state-footer] {
    flex-wrap: wrap;
  }

  #result-band .band-score {
    font-size: 56px;
  }

  #result-band .band-name {
    font-size: 26px;
  }

  #result-band .band-summary {
    font-size: 15px;
  }
}

/* -------------------------------------------------------------
   Print — clean result, hide controls
   ------------------------------------------------------------- */

@media print {
  #progress-indicator,
  footer[data-state-footer],
  .note-toggle {
    display: none !important;
  }

  body { 
    color: var(--ac-black); 
    background: var(--ac-white); 
  }

  #app { 
    max-width: none; 
    padding: 0; 
  }

  .question-card,
  #state-intro,
  #state-result { 
    box-shadow: none; 
    page-break-inside: avoid;
  }

  .site-header {
    border-bottom: 2px solid var(--ac-pine);
  }
}

/* =============================================================
   Admin dashboard (admin.html) — document-style reporting.
   Reuses the design tokens; tables are plain (no zebra striping).
   ============================================================= */

.site-header-inner { position: relative; }

.admin-signout {
  position: absolute;
  top: var(--space-6);
  right: var(--space-5);
  font-size: 13px;
  font-weight: 700;
  color: var(--ac-green);
  text-decoration: none;
}
.admin-signout:hover { text-decoration: underline; }

.admin-back {
  background: none;
  color: var(--ac-pine);
  font-weight: 700;
  font-size: 14px;
  padding: 0;
  margin-bottom: var(--space-5);
}
.admin-back:hover { text-decoration: underline; background: none; box-shadow: none; transform: none; }

.admin-report > .admin-export {
  float: right;
  margin-bottom: var(--space-5);
}

.admin-report > h2 {
  clear: both;
}

.admin-report-export-meta {
  max-width: 72ch;
  margin: calc(-1 * var(--space-5)) 0 var(--space-7);
  color: var(--fg-muted);
  font-size: 13px;
  line-height: 1.5;
}

body.is-exporting .no-print,
body.is-exporting .admin-back,
body.is-exporting .admin-export,
body.is-exporting .admin-signout,
body.is-exporting .admin-internal-only {
  display: none !important;
}

/* Organisation picker */
#org-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.org-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  text-align: left;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--ac-pine);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  box-shadow: var(--shadow-xs);
}
.org-card:hover {
  box-shadow: var(--shadow-sm);
  background: var(--bg-tint);
}
.org-card .org-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--ac-pine);
}
.org-card .org-meta {
  font-size: 13px;
  font-weight: 400;
  color: var(--fg-muted);
}

p[data-org-empty],
.admin-notes-empty,
.admin-scenario-empty {
  color: var(--fg-muted);
  font-size: 14px;
}

.admin-benchmark {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0 0 var(--space-8);
  padding: var(--space-5);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-page);
}

.benchmark-row {
  display: grid;
  grid-template-columns: 180px 1fr 56px 120px;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border-light);
}

.benchmark-row:first-child {
  border-top: none;
}

.benchmark-label,
.benchmark-band {
  font-weight: 700;
  color: var(--fg-body);
}

.benchmark-meter {
  height: 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.benchmark-meter .fill {
  display: block;
  height: 100%;
  background: var(--ac-pine);
}

.benchmark-value {
  font-family: var(--font-display);
  font-weight: 700;
  text-align: right;
}

.benchmark-note {
  grid-column: 2 / -1;
  font-size: 13px;
  color: var(--fg-muted);
}

.benchmark-row.is-unavailable .benchmark-meter .fill {
  background: var(--border-default);
}

/* Agreement / divergence */
.admin-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  margin: 0 0 var(--space-8);
}

.admin-panel {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.admin-panel h3 { margin-bottom: var(--space-1); }
.admin-panel-hint {
  font-size: 13px;
  color: var(--fg-muted);
  margin: 0 0 var(--space-4);
}

.admin-scenario-list { list-style: none; margin: 0; padding: 0; }
.admin-scenario {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border-light);
}
.admin-scenario:first-child { border-top: none; }
.admin-scenario-title { font-size: 14px; font-weight: 700; color: var(--fg-body); }
.admin-scenario-detail { font-size: 13px; color: var(--fg-muted); }

.admin-risk-categories {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin: 0 0 var(--space-8);
}

.admin-risk-category {
  padding: var(--space-5);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-page);
}

.admin-risk-category h4 {
  margin: 0 0 var(--space-3);
  color: var(--ac-grey);
  font-size: 17px;
}

.admin-risk-category ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.admin-risk-category li {
  display: grid;
  gap: var(--space-1);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-light);
}

.admin-risk-category li:first-child {
  padding-top: 0;
  border-top: 0;
}

.admin-risk-scenario-title {
  color: var(--fg-body);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.admin-risk-scenario-detail {
  color: var(--fg-muted);
  font-size: 13px;
}

.admin-next-steps {
  margin: 0 0 var(--space-8);
  padding: var(--space-6);
  border: 1px solid var(--ac-pear);
  border-left: 4px solid var(--ac-pine);
  border-radius: var(--radius-lg);
  background: var(--bg-tint);
}

.admin-next-steps-intro {
  max-width: 68ch;
  margin: 0 0 var(--space-4);
  color: var(--fg-muted);
  font-size: 14px;
  line-height: 1.5;
}

.admin-next-step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.admin-next-step-list li {
  display: grid;
  gap: var(--space-1);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-light);
}

.admin-next-step-list li:first-child {
  padding-top: 0;
  border-top: 0;
}

.admin-next-step-title {
  color: var(--ac-grey);
  font-size: 14px;
  font-weight: 700;
}

.admin-next-step-text {
  color: var(--fg-body);
  font-size: 14px;
  line-height: 1.5;
}

/* Comparison table — document-style, no zebra */
.admin-table-wrap {
  overflow-x: auto;
  margin: 0 0 var(--space-8);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.admin-table th,
.admin-table td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
.admin-table thead th {
  font-weight: 700;
  color: var(--fg-body);
  border-bottom: 2px solid var(--border-strong);
}
.admin-table .admin-respondent { font-weight: 700; }
.admin-band-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--ac-pine);
}

/* Notes */
.admin-note-group { margin-bottom: var(--space-5); }
.admin-note-group h4 { margin-bottom: var(--space-2); }
.admin-notes { list-style: none; margin: 0; padding: 0; }
.admin-notes li {
  padding: var(--space-2) 0;
  border-top: 1px solid var(--border-light);
}
.admin-note-author {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--fg-muted);
}
.admin-note-text { font-size: 14px; color: var(--fg-body); }

@media (max-width: 640px) {
  .admin-split,
  .admin-risk-categories { grid-template-columns: 1fr; }
  .benchmark-row { grid-template-columns: 1fr; }
  .benchmark-value { text-align: left; }
  .benchmark-note { grid-column: 1; }
  .admin-signout { position: static; display: inline-block; margin-top: var(--space-3); }
  .admin-report > .admin-export {
    float: none;
    width: 100%;
    margin: 0 0 var(--space-5);
  }
}

@media print {
  @page {
    margin: 18mm;
  }

  .no-print,
  .admin-back,
  .admin-export,
  .admin-signout,
  .admin-internal-only,
  [data-admin-state="orgs"],
  [data-admin-state="loading"],
  [data-admin-state="error"] {
    display: none !important;
  }

  [data-admin-state="report"] {
    display: block !important;
  }

  .admin-report-export-meta {
    color: var(--ac-grey);
    margin-bottom: var(--space-6);
  }

  #result-band,
  .admin-benchmark,
  #result-domains,
  .admin-risk-categories,
  .admin-next-steps,
  .admin-split,
  .admin-panel,
  .admin-risk-category {
    box-shadow: none !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .admin-risk-categories,
  .admin-split {
    grid-template-columns: 1fr;
  }
}
