/* =============================================
   SMSS Assessment Tool — Design Tokens
   Sibling palette to the PROMs/MBC tool:
   White, Dark Blue (#000064), Light Purple (#E9D8EE), Pink/Purple (#933DA9)
   Plus semantic score-band colors
   ============================================= */

@font-face {
  font-family: 'Libre Franklin';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/libre-franklin-400.ttf') format('truetype');
}
@font-face {
  font-family: 'Libre Franklin';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./fonts/libre-franklin-500.ttf') format('truetype');
}
@font-face {
  font-family: 'Libre Franklin';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('./fonts/libre-franklin-600.ttf') format('truetype');
}
@font-face {
  font-family: 'Libre Franklin';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./fonts/libre-franklin-700.ttf') format('truetype');
}
@font-face {
  font-family: 'Libre Franklin';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('./fonts/libre-franklin-800.ttf') format('truetype');
}

:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.25rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --content-narrow: 720px;
  --content-default: 1040px;
  --content-wide: 1280px;

  --font-display: 'Libre Franklin', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Libre Franklin', 'Helvetica Neue', Arial, sans-serif;
}

/* Light mode (only mode) */
:root,
[data-theme='light'] {
  --color-bg: #fbfaff;
  --color-surface: #ffffff;
  --color-surface-2: #F4EDF7;
  --color-surface-offset: #E9D8EE;
  --color-divider: #d4c4da;
  --color-border: #c0b0c8;

  --color-text: #000064;
  --color-text-muted: #4a4a6a;
  --color-text-faint: #6a6a85;
  --color-text-inverse: #ffffff;

  --color-primary: #000064;
  --color-primary-hover: #000050;
  --color-primary-active: #00003c;
  --color-primary-highlight: #E9D8EE;
  --color-primary-subtle: #F4EDF7;

  --color-accent: #933DA9;
  --color-accent-hover: #7A2E90;
  --color-accent-active: #622078;
  --color-accent-highlight: #F4EDF7;
  --color-accent-subtle: #F9F4FB;

  /* Score band colors — WCAG AA on white */
  --band-green: #1B6B20;
  --band-green-bg: #E4F2E5;
  --band-green-border: #BCDDBD;
  --band-yellow: #8A5A00;
  --band-yellow-bg: #FBEFD0;
  --band-yellow-border: #ECCF7C;
  --band-red: #B01B1B;
  --band-red-bg: #FBE2E2;
  --band-red-border: #ECB9B9;
  --band-nr: #5a5a78;
  --band-nr-bg: #ECEAF2;
  --band-nr-border: #C8C4D5;

  --color-success: #1B6B20;
  --color-warning: #B85000;
  --color-error: #B01B1B;

  --shadow-sm: 0 1px 3px rgba(0, 0, 100, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 100, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 100, 0.12);
  --shadow-focus: 0 0 0 3px rgba(147, 61, 169, 0.3);
}

/* =============================================
   Skip link
   ============================================= */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 9999;
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: var(--space-2); }

/* =============================================
   ACCESS GATE
   ============================================= */
.gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  overflow-y: auto;
  background: linear-gradient(160deg, var(--color-primary), var(--color-primary-active));
}
body.unlocked .gate { display: none; }
body:not(.unlocked) { overflow: hidden; }

.gate-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.gate-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-4);
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--color-primary-highlight);
  box-shadow: 0 0 0 3px var(--color-primary-subtle);
}
.gate-mark img { width: 100%; height: 100%; object-fit: cover; }
.gate-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}
.gate-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.15;
  margin-bottom: var(--space-2);
}
.gate-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0 auto var(--space-5);
  max-width: 34ch;
}
.gate-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  text-align: left;
}
.gate-field { gap: var(--space-2); }
.gate-error {
  margin: calc(var(--space-2) * -1) 0 0;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-error);
}
.gate-submit { width: 100%; }

/* =============================================
   HEADER
   ============================================= */
.site-header {
  background: var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--space-3) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: #ffffff;
  min-width: 0;
}
.header-mark {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: grid;
  place-items: center;
  color: #fff;
  overflow: hidden;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.18);
}
.header-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.header-title {
  font-size: var(--text-xs);
  font-weight: 500;
  color: rgba(255,255,255,0.78);
  line-height: 1.3;
}
.header-title strong {
  display: block;
  font-size: var(--text-base);
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
  transition: color var(--transition-interactive);
}
.header-brand:hover .header-title strong { color: var(--color-surface-offset); }

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.nav-link {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  border-radius: var(--radius-md);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}
.nav-link:hover {
  background: rgba(255,255,255,0.12);
  color: #ffffff;
}
.nav-link.active {
  color: #ffffff;
  background: rgba(255,255,255,0.18);
}
.nav-link--accent {
  background: var(--color-accent);
  color: #ffffff !important;
  padding: var(--space-2) var(--space-4);
}
.nav-link--accent:hover { background: var(--color-accent-hover); }

.nav-hamburger {
  display: none;
  width: 44px; height: 44px;
  place-items: center;
  color: rgba(255,255,255,0.85);
  border-radius: var(--radius-md);
}
.nav-hamburger:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* Progress bar under header */
.progress-bar {
  height: 3px;
  background: rgba(255,255,255,0.12);
  width: 100%;
}
.progress-fill {
  height: 100%;
  background: var(--color-accent);
  transition: width 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* =============================================
   PAGE FRAME
   ============================================= */
main {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}
.page { animation: fadeIn 200ms ease-out; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =============================================
   ASSESS LAYOUT — sidebar + main
   ============================================= */
.assess-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: var(--space-8);
  align-items: flex-start;
}
.assess-main { min-width: 0; }

.assess-sidebar {
  position: sticky;
  top: calc(72px + var(--space-4));
  align-self: flex-start;
}
.sidebar-inner {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}
.sidebar-header { margin-bottom: var(--space-4); }
.sidebar-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-1);
}
.sidebar-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}
.sidebar-progress {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 600;
}

.domain-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: var(--space-4);
}
.domain-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  width: 100%;
  line-height: 1.35;
}
.domain-nav-item:hover {
  background: var(--color-surface-2);
  color: var(--color-primary);
}
.domain-nav-item.active {
  background: var(--color-primary-highlight);
  color: var(--color-primary);
}
.domain-nav-num {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
}
.domain-nav-item.active .domain-nav-num {
  background: var(--color-accent);
  color: #fff;
}
.domain-nav-count {
  font-size: 11px;
  color: var(--color-text-faint);
  font-weight: 600;
}
.domain-nav-item.complete .domain-nav-count {
  color: var(--band-green);
}
.domain-nav-label {
  flex: 1;
  min-width: 0;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-divider);
}
.sidebar-text-button {
  display: block;
  margin: var(--space-3) auto 0;
  padding: var(--space-1) var(--space-2);
  border: none;
  background: transparent;
  color: var(--color-text-faint);
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color var(--transition-interactive);
}
.sidebar-text-button:hover,
.sidebar-text-button:focus-visible {
  color: var(--color-accent);
  outline: none;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  line-height: 1;
  min-height: 40px;
}
.btn-primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.btn-primary:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); }
.btn-large { padding: var(--space-4) var(--space-6); font-size: var(--text-base); min-height: 48px; }

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-primary);
  border-color: var(--color-border);
}
.btn-secondary:hover {
  background: var(--color-surface-2);
  border-color: var(--color-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: transparent;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  min-height: 32px;
}
.btn-ghost:hover { color: var(--color-error); background: var(--color-surface-2); }

.btn-action {
  background: var(--color-surface);
  color: var(--color-primary);
  border-color: var(--color-border);
  padding: var(--space-2) var(--space-3);
  min-height: 36px;
  font-size: var(--text-xs);
}
.btn-action:hover {
  background: var(--color-surface-2);
  border-color: var(--color-primary);
}
.btn-action--accent {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.btn-action--accent:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

/* =============================================
   ASSESS HERO
   ============================================= */
.assess-hero {
  margin-bottom: var(--space-8);
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-3);
}
.hero-badge--light {
  background: rgba(255,255,255,0.2);
  color: #fff;
}
.assess-hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.12;
  margin-bottom: var(--space-3);
}
.assess-desc {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.65;
  max-width: 720px;
  margin-bottom: var(--space-5);
}
.assess-desc strong { color: var(--color-text); font-weight: 700; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid;
}
.swatch-green { background: var(--band-green-bg); border-color: var(--band-green-border); }
.swatch-yellow { background: var(--band-yellow-bg); border-color: var(--band-yellow-border); }
.swatch-red { background: var(--band-red-bg); border-color: var(--band-red-border); }
.swatch-nr { background: var(--band-nr-bg); border-color: var(--band-nr-border); }

/* =============================================
   SETUP CARD
   ============================================= */
.setup-card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-sm);
}
.setup-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.card-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-1);
}
.setup-header h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-primary);
}
.setup-status {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 600;
}
.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.field-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}
.field-input {
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text);
  font-family: inherit;
  min-height: 44px;
}
.field-input::placeholder { color: var(--color-text-faint); }
.field-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: var(--shadow-focus);
}

/* =============================================
   DOMAIN CARDS / ITEMS
   ============================================= */
.domains-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.domain-card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-xl);
  overflow: hidden;
  scroll-margin-top: 96px;
  box-shadow: var(--shadow-sm);
}
.domain-card-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-divider);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: linear-gradient(180deg, var(--color-surface), var(--color-surface));
}
.domain-card-num {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
}
.domain-card-meta { flex: 1; min-width: 0; }
.domain-card-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 2px;
}
.domain-card-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
}
.domain-card-stats {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 600;
  margin-top: var(--space-1);
}
.domain-card-preview {
  flex: 0 0 auto;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 700;
  background: var(--band-nr-bg);
  color: var(--band-nr);
  border: 1px solid var(--band-nr-border);
  white-space: nowrap;
}
.domain-card-preview[data-band="green"] { background: var(--band-green-bg); color: var(--band-green); border-color: var(--band-green-border); }
.domain-card-preview[data-band="yellow"] { background: var(--band-yellow-bg); color: var(--band-yellow); border-color: var(--band-yellow-border); }
.domain-card-preview[data-band="red"] { background: var(--band-red-bg); color: var(--band-red); border-color: var(--band-red-border); }

.domain-items {
  list-style: none;
  padding: 0;
  margin: 0;
}
.item-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--color-divider);
}
.item-row:last-child { border-bottom: none; }
.item-row:hover {
  background: var(--color-surface-2);
}
.item-row.answered .item-num {
  background: var(--color-primary);
  color: #fff;
}
.item-num {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.item-text {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.55;
  max-width: none;
}

/* Likert group */
.likert {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--color-surface-2);
  padding: 4px;
  border-radius: var(--radius-md);
  flex-wrap: nowrap;
}
.likert-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition-interactive);
  font-variant-numeric: tabular-nums;
}
.likert-btn:hover {
  background: var(--color-surface);
  color: var(--color-primary);
  border-color: var(--color-border);
}
.likert-btn[aria-pressed="true"] {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
  box-shadow: 0 1px 3px rgba(147, 61, 169, 0.3);
}
.likert-btn.na {
  width: 44px;
  font-size: var(--text-xs);
  margin-left: 2px;
  position: relative;
}
.likert-btn.na::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--color-border);
}
.likert-btn.na[aria-pressed="true"] {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* Likert label tooltip endpoints (1 / 5) */
.likert-scale-hint {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6) var(--space-4);
  font-size: 0.7rem;
  color: var(--color-text-faint);
  font-weight: 600;
  border-bottom: 1px solid var(--color-divider);
  background: var(--color-surface);
}

/* Bottom actions */
.bottom-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-8);
  flex-wrap: wrap;
}

/* =============================================
   REPORT PAGE
   ============================================= */
.report-container {
  max-width: var(--content-wide);
  margin: 0 auto;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  margin-bottom: var(--space-5);
  color: var(--color-text-muted);
}
.breadcrumb a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 600;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span[aria-current] { color: var(--color-text); font-weight: 600; }

.report-hero {
  background: var(--color-primary);
  color: #ffffff;
  padding: var(--space-8);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-8);
  position: relative;
  overflow: hidden;
}
.report-hero::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 280px;
  height: 280px;
  background: radial-gradient(closest-side, rgba(147, 61, 169, 0.35), transparent 70%);
  pointer-events: none;
}
.report-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  position: relative;
}
.report-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  margin-bottom: var(--space-3);
  line-height: 1.12;
  color: #fff;
}
.report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.9);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}
.meta-pill strong { color: #fff; font-weight: 700; }

.report-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.report-hero .btn-action {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-color: rgba(255,255,255,0.25);
}
.report-hero .btn-action:hover {
  background: rgba(255,255,255,0.25);
}
.report-hero .btn-action--accent {
  background: var(--color-accent);
  border-color: var(--color-accent);
}
.report-hero .btn-action--accent:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  position: relative;
}
.snapshot-card {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.snapshot-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}
.snapshot-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.snapshot-total {
  font-size: var(--text-base);
  color: rgba(255,255,255,0.6);
  font-weight: 600;
}
.snapshot-sub {
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.7);
  font-weight: 600;
}

/* Domain score grid */
.report-section { margin-bottom: var(--space-8); }
.report-section-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}
.score-card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.score-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--band-nr);
}
.score-card[data-band="green"]::before { background: var(--band-green); }
.score-card[data-band="yellow"]::before { background: var(--band-yellow); }
.score-card[data-band="red"]::before { background: var(--band-red); }

.score-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
}
.score-card-domain {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.25;
}
.score-card-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}
.score-card-value {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}
.score-value-num {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
.score-value-num[data-band="green"] { color: var(--band-green); }
.score-value-num[data-band="yellow"] { color: var(--band-yellow); }
.score-value-num[data-band="red"] { color: var(--band-red); }
.score-value-num[data-band="nr"] { color: var(--band-nr); font-size: 1.75rem; }
.score-value-out {
  font-size: var(--text-sm);
  color: var(--color-text-faint);
  font-weight: 600;
}
.score-card-meter {
  height: 6px;
  background: var(--color-surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.score-card-meter-fill {
  height: 100%;
  background: var(--band-nr);
  border-radius: var(--radius-full);
  transition: width 320ms cubic-bezier(0.16, 1, 0.3, 1);
}
.score-card-meter-fill[data-band="green"] { background: var(--band-green); }
.score-card-meter-fill[data-band="yellow"] { background: var(--band-yellow); }
.score-card-meter-fill[data-band="red"] { background: var(--band-red); }

.score-card-band {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  background: var(--band-nr-bg);
  color: var(--band-nr);
  border: 1px solid var(--band-nr-border);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  align-self: flex-start;
}
.score-card-band[data-band="green"] { background: var(--band-green-bg); color: var(--band-green); border-color: var(--band-green-border); }
.score-card-band[data-band="yellow"] { background: var(--band-yellow-bg); color: var(--band-yellow); border-color: var(--band-yellow-border); }
.score-card-band[data-band="red"] { background: var(--band-red-bg); color: var(--band-red); border-color: var(--band-red-border); }

.score-card-foot {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
  border-top: 1px solid var(--color-divider);
  padding-top: var(--space-3);
}

/* Summary table */
.table-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.summary-table thead {
  background: var(--color-surface-2);
}
.summary-table th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  font-weight: 700;
  border-bottom: 1px solid var(--color-divider);
}
.summary-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-divider);
  vertical-align: middle;
  color: var(--color-text);
}
.summary-table tbody tr:last-child td { border-bottom: none; }
.summary-table tbody tr:hover { background: var(--color-surface-2); }
.summary-table td.numeric {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}
.summary-table td.status .status-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.status-pill[data-band="green"] { background: var(--band-green-bg); color: var(--band-green); }
.status-pill[data-band="yellow"] { background: var(--band-yellow-bg); color: var(--band-yellow); }
.status-pill[data-band="red"] { background: var(--band-red-bg); color: var(--band-red); }
.status-pill[data-band="nr"] { background: var(--band-nr-bg); color: var(--band-nr); }
.status-pill[data-band="incomplete"] { background: var(--color-surface-2); color: var(--color-text-faint); border: 1px dashed var(--color-border); }

/* =============================================
   ABOUT
   ============================================= */
.about-container {
  max-width: var(--content-default);
  margin: 0 auto;
}
.about-heading {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: var(--space-5);
  line-height: 1.12;
}
.about-body { margin-bottom: var(--space-8); }
.about-body p {
  font-size: var(--text-base);
  color: var(--color-text);
  line-height: 1.75;
  max-width: 72ch;
  margin-bottom: var(--space-3);
}
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-8);
}
.about-card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.about-card-icon {
  width: 56px; height: 56px;
  margin: 0 auto var(--space-3);
  display: grid;
  place-items: center;
  background: var(--color-primary-highlight);
  border-radius: var(--radius-lg);
  color: var(--color-primary);
}
.about-card h2 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}
.about-card-num {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}
.about-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0;
  max-width: none;
}
.about-section { margin-bottom: var(--space-8); }
.about-section h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}
.rubric-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.rubric-band {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--text-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
}
.rubric-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.band-green .rubric-dot { background: var(--band-green); }
.band-green { color: var(--band-green); border-color: var(--band-green-border); background: var(--band-green-bg); }
.band-yellow .rubric-dot { background: var(--band-yellow); }
.band-yellow { color: var(--band-yellow); border-color: var(--band-yellow-border); background: var(--band-yellow-bg); }
.band-red .rubric-dot { background: var(--band-red); }
.band-red { color: var(--band-red); border-color: var(--band-red-border); background: var(--band-red-bg); }
.band-nr .rubric-dot { background: var(--band-nr); }
.band-nr { color: var(--band-nr); border-color: var(--band-nr-border); background: var(--band-nr-bg); }

.about-credit {
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-divider);
}
.about-credit p {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  line-height: 1.7;
}

/* =============================================
   TOAST
   ============================================= */
.toast {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: all 240ms cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 90vw;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast svg { color: var(--color-surface-offset); flex-shrink: 0; }
.toast.toast--accent { background: var(--color-accent); }
.toast.toast--accent svg { color: rgba(255,255,255,0.85); }

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  max-width: var(--content-wide);
  margin: var(--space-12) auto 0;
  padding: var(--space-6);
  border-top: 2px solid var(--color-primary);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.7;
  text-align: center;
}
.site-footer p {
  margin: 0 auto;
  max-width: var(--content-default);
}
.site-footer p + p { margin-top: var(--space-2); }
.site-footer strong { color: var(--color-primary); }
.site-footer a {
  color: var(--color-primary);
  font-weight: 700;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.site-footer a:hover { color: var(--color-accent); }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 980px) {
  .assess-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .assess-sidebar {
    position: static;
    order: -1;
    min-width: 0;
    width: 100%;
  }
  .sidebar-inner {
    padding: var(--space-4);
  }
  .domain-nav {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: var(--space-2);
    margin-bottom: var(--space-3);
    -webkit-overflow-scrolling: touch;
  }
  .domain-nav-item {
    flex-shrink: 0;
    max-width: 240px;
  }
  .sidebar-footer { flex-direction: row; }
  .about-grid { grid-template-columns: 1fr; }
  .snapshot-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  main { padding: var(--space-6) var(--space-4); }
  .header-inner { padding: var(--space-3) var(--space-4); gap: var(--space-2); }
  .header-title strong { font-size: var(--text-sm); }
  .header-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-primary);
    border-bottom: 2px solid var(--color-accent);
    flex-direction: column;
    padding: var(--space-4);
    gap: var(--space-2);
    box-shadow: var(--shadow-lg);
    z-index: 99;
  }
  .header-nav.open { display: flex; }
  .header-nav .nav-link { width: 100%; justify-content: center; }
  .nav-hamburger { display: grid; }

  .setup-grid { grid-template-columns: 1fr; }
  .item-row {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
  .item-num { justify-self: start; }
  .likert { justify-self: stretch; justify-content: space-between; }
  .likert-btn { flex: 1; min-width: 40px; }

  .report-hero { padding: var(--space-6); }
  .report-hero-top { flex-direction: column; }
  .report-actions { width: 100%; }
  .report-actions .btn-action { flex: 1; }

  .bottom-actions { flex-direction: column; align-items: stretch; }
  .bottom-actions button { width: 100%; }
}

@media (max-width: 480px) {
  .snapshot-grid { grid-template-columns: 1fr; }
  .legend { font-size: 11px; }
  .domain-card-header {
    flex-wrap: wrap;
    padding: var(--space-4);
  }
  .item-row { padding: var(--space-3) var(--space-4); }
  .likert-btn { width: auto; }
  .likert-btn.na { width: auto; padding: 0 var(--space-2); }
}

/* =============================================
   PRINT / PDF EXPORT
   ============================================= */
@media print {
  @page {
    size: letter;
    margin: 0.5in;
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body {
    background: #fff !important;
    color: #000064 !important;
  }

  .gate,
  .site-header,
  .breadcrumb,
  .report-actions,
  .bottom-actions,
  .toast {
    display: none !important;
  }

  main {
    max-width: none;
    padding: 0;
  }

  .report-container {
    max-width: none;
  }

  .report-hero,
  .report-section,
  .score-card,
  .snapshot-card {
    box-shadow: none !important;
  }

  .report-hero {
    background: #fff !important;
    color: #000064 !important;
    border: 1px solid #d4c4da;
    padding: 0.25in;
    break-inside: avoid;
  }

  .report-title {
    color: #000064 !important;
  }

  .report-hero .hero-badge,
  .meta-pill,
  .snapshot-card {
    background: #f4edf7 !important;
    color: #000064 !important;
    border: 1px solid #d4c4da;
  }

  .meta-pill strong,
  .snapshot-value,
  .snapshot-total {
    color: #000064 !important;
  }

  .snapshot-label,
  .snapshot-sub {
    color: #4a4a6a !important;
  }

  .snapshot-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .score-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .score-card,
  .report-section,
  .table-wrap {
    break-inside: avoid;
  }

  .table-wrap {
    overflow: visible;
  }

  .summary-table th {
    background: #f4edf7 !important;
    color: #000064 !important;
  }

  .site-footer {
    background: #fff !important;
    margin-top: 0.25in;
    padding: 0.2in 0 0;
    border-top: 1px solid #d4c4da;
    color: #4a4a6a !important;
  }
}
