/* ============================================================
   SARIIO MAPS - Main Stylesheet
   Version 1.0 - May 2026
   British English. No em dashes. Mobile first.
   ============================================================ */

/* ── Custom properties ──────────────────────────────────── */
:root {
  /* Sariio factor colours */
  --colour-connecting:    #f5a623;
  --colour-thinking:      #29b6d6;
  --colour-deciding:      #f06292;
  --colour-implementing:  #2cc5a0;

  /* Organisation branding (overridden per org at render time) */
  --colour-org-primary:   #29b6d6;
  --colour-org-secondary: #1d9eb8;
  --colour-org-text:      #ffffff;

  /* Heat map bands */
  --colour-red-hot:   #E24B4A;
  --colour-hot:       #EF9F27;
  --colour-warm:      #97C459;
  --colour-lukewarm:  #85B7EB;
  --colour-cool:      #B4B2A9;

  /* Sariio core */
  --colour-sariio:    #29b6d6;
  --colour-dark:      #1a1a1a;
  --colour-white:     #ffffff;

  /* Surfaces */
  --surface-page:     #f5f5f3;
  --surface-card:     #ffffff;
  --surface-raised:   #f8f8f6;
  --surface-input:    #f0f0ee;

  /* Text */
  --text-primary:     #1a1a1a;
  --text-secondary:   #555555;
  --text-tertiary:    #999999;
  --text-on-colour:   #ffffff;

  /* Borders */
  --border-light:     rgba(0,0,0,0.08);
  --border-medium:    rgba(0,0,0,0.14);
  --border-strong:    rgba(0,0,0,0.24);

  /* Radii */
  --radius-sm:  6px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-pill:999px;

  /* Shadows */
  --shadow-card:   0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-raised: 0 4px 12px rgba(0,0,0,0.08);

  /* Spacing */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  12px;
  --space-lg:  16px;
  --space-xl:  24px;
  --space-2xl: 32px;
  --space-3xl: 48px;

  /* Nav */
  --nav-height: 52px;
}


/* === Zone CSS variables — see DESIGN_SYSTEM.md === */

.zone-survey {
  --cta-primary: #0e8a6c;
  --cta-hover: #0a7259;
  --cta-pressed: #075545;
  --accent: #2cc5a0;
  --subtle-bg: #e8f7f2;
}

.zone-admin {
  --cta-primary: #c83963;
  --cta-hover: #b32f57;
  --cta-pressed: #97244a;
  --accent: #f06292;
  --subtle-bg: #fde8ee;
}

/* zone-analysis and zone-collaboration variables to be added when those zones are built */


/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--surface-page);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 500; line-height: 1.25; }
p { margin: 0; }
a { color: var(--colour-sariio); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; padding: 0; }
input, select, textarea {
  font-family: inherit;
  font-size: 15px;
  color: var(--text-primary);
  border: 0.5px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--surface-input);
  padding: 10px 14px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--colour-sariio);
  background: var(--surface-card);
}
textarea { resize: vertical; min-height: 80px; }
ul, ol { margin: 0; padding: 0; list-style: none; }


/* ── Navigation bar ─────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  z-index: 100;
}
.nav--org {
  background: #ffffff;
}
.nav--sariio {
  background: #ffffff;
}
.nav__brand { display: flex; align-items: center; gap: var(--space-sm); }
.nav__org-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}
.nav__logo {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
}
.nav__wordmark {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}
.nav__wordmark em {
  color: var(--colour-sariio);
  font-style: normal;
}
.nav__right {
  font-size: 12px;
  color: var(--text-primary);
}
.nav__back {
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s;
}
.nav__back:hover { color: var(--text-primary); }
.nav__org-badge {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--colour-white);
  flex-shrink: 0;
}


/* ── Progress bar (survey) ──────────────────────────────── */
.progress-bar {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  height: 5px;
  background: #e0e0de;
  z-index: 99;
}


/* ── Page wrapper ───────────────────────────────────────── */
.page {
  padding-top: var(--nav-height);
  flex: 1;
}
.page--survey {
  padding-top: calc(var(--nav-height) + 3px); /* nav + progress bar */
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}
.container--narrow { max-width: 480px; }
.container--wide   { max-width: 800px; }


/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  border: 0.5px solid var(--border-light);
  padding: var(--space-lg);
}
.card--raised {
  box-shadow: var(--shadow-card);
}
.card--inset {
  background: var(--surface-raised);
  border: 0.5px solid var(--border-light);
}
.card + .card { margin-top: var(--space-sm); }


/* ── Factor colour cards ────────────────────────────────── */
.factor-card {
  border-radius: var(--radius-md);
  padding: var(--space-md);
  color: var(--colour-white);
}
.factor-card--connecting   { background: var(--colour-connecting); }
.factor-card--thinking     { background: var(--colour-thinking); }
.factor-card--deciding     { background: var(--colour-deciding); }
.factor-card--implementing { background: var(--colour-implementing); }
.factor-card__label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.8);
  margin-bottom: 3px;
}
.factor-card__archetype {
  font-size: 15px;
  font-weight: 500;
  color: var(--colour-white);
  margin-bottom: 2px;
}
.factor-card__tagline {
  font-size: 11px;
  color: rgba(255,255,255,0.8);
  line-height: 1.3;
}
.factor-card__expand {
  font-size: 10px;
  color: rgba(255,255,255,0.7);
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid rgba(255,255,255,0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}


/* ── Archetype badges ───────────────────────────────────── */
.arch-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  color: var(--colour-white);
}
.arch-badge--c { background: var(--colour-connecting); }
.arch-badge--t { background: var(--colour-thinking); }
.arch-badge--d { background: var(--colour-deciding); }
.arch-badge--i { background: var(--colour-implementing); }
.arch-badge--sm {
  font-size: 10px;
  padding: 2px 8px;
}


/* ── Status pills ───────────────────────────────────────── */
.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
}
.pill--done      { background: #e1f5ee; color: #085041; }
.pill--pending   { background: #fff3e0; color: #854F0B; }
.pill--none      { background: var(--surface-raised); color: var(--text-tertiary); border: 0.5px solid var(--border-medium); }
.pill--flag-warn { background: #fff3e0; color: #854F0B; }
.pill--flag-info { background: #e3f6fb; color: #0C447C; }
.pill--retake    { background: #fbeaf0; color: #72243E; }


/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px var(--space-lg);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s, transform 0.1s;
  border: 0.5px solid transparent;
  text-align: center;
  white-space: nowrap;
  width: 100%;
  text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn:hover { text-decoration: none; }

.btn--primary {
  /* Uses zone variable; falls back to teal-dark if outside any zone */
  background: var(--cta-primary, #0e8a6c);
  color: var(--colour-white);
}
.btn--primary:hover {
  background: var(--cta-hover, #0a7259);
}
.btn--primary:active {
  background: var(--cta-pressed, #075545);
}

.btn--org {
  background: var(--colour-org-primary);
  color: var(--colour-org-text);
}
.btn--org:hover { opacity: 0.9; }

.btn--secondary {
  background: var(--surface-card);
  color: var(--text-primary);
  border-color: var(--border-medium);
}
.btn--secondary:hover {
  background: var(--surface-input);
  border-color: var(--border-strong);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-medium);
}
.btn--ghost:hover {
  background: var(--surface-input);
  color: var(--text-primary);
}

.btn--disabled,
.btn:disabled {
  opacity: 0.35;
  pointer-events: none;
  cursor: not-allowed;
}

.btn--sm {
  padding: 8px 14px;
  font-size: 13px;
}


/* ── VAS Slider ─────────────────────────────────────────── */
.vas-container { padding: var(--space-lg) 0 var(--space-sm); }
.vas-poles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}
.vas-pole {
  padding: var(--space-md);
  border-radius: var(--radius-md);
}
.vas-pole--a {
  background: rgba(245,166,35,0.08);
  border-left: 3px solid var(--colour-connecting);
}
.vas-pole--b {
  background: rgba(41,182,214,0.08);
  border-left: 3px solid var(--colour-thinking);
}
.vas-pole__label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.vas-pole--a .vas-pole__label { color: #c47d0a; }
.vas-pole--b .vas-pole__label { color: #1a8aab; }
.vas-pole__text {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}
@media (max-width: 480px) {
  .vas-poles {
    grid-template-columns: 1fr;
  }
  .vas-pole--b { border-left: 3px solid var(--colour-thinking); }
}

.vas-track { padding: var(--space-sm) 0; }
.vas-ends {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.vas-end {
  font-size: 11px;
  font-weight: 500;
}
.vas-end--a { color: #c47d0a; }
.vas-end--b { color: #1a8aab; }
.vas-arrow { fill: currentColor; vertical-align: -1px; }

.vas-bar-wrap {
  position: relative;
  height: 30px;
  display: flex;
  align-items: center;
}

.vas-bar {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 22px;
  transform: translateY(-50%);
  border-radius: 6px;
  background: linear-gradient(to right, #f5a623, #e8dcc8 35%, #d5d3cb 50%, #b5dce6 65%, #29b6d6);
  pointer-events: none;
}

.vas-tick {
  position: absolute;
  width: 1px;
  top: 50%;
  transform: translateY(-50%);
}

.vas-tick--mj {
  height: 100%;
  top: 0;
  transform: none;
  background: rgba(50, 48, 42, 0.4);
}

.vas-tick--mn {
  height: 60%;
  background: rgba(50, 48, 42, 0.25);
}

.vas-tick--sm {
  height: 36%;
  background: rgba(50, 48, 42, 0.14);
}

.vas-scale-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: #777;
}

.vas-scale-labels span:nth-child(2) {
  text-align: center;
}

input[type="range"].vas-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  border-radius: 3px;
  background: transparent;
  outline: none;
  cursor: pointer;
  border: none;
  padding: 0;
  position: relative;
  z-index: 2;
}
input[type="range"].vas-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-card);
  border: 2.5px solid var(--colour-thinking);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="range"].vas-slider::-moz-range-thumb {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-card);
  border: 2.5px solid var(--colour-thinking);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
input[type="range"].vas-slider.moved::-webkit-slider-thumb {
  border-color: var(--colour-thinking);
  box-shadow: 0 2px 10px rgba(41,182,214,0.3);
}
.vas-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: var(--space-sm);
  min-height: 20px;
  transition: color 0.25s;
}
.vas-hint--ready { color: var(--colour-implementing); }


/* ── Form helpers ───────────────────────────────────────── */
.field { margin-bottom: var(--space-lg); }
.field__label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-xs);
}
.field__hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: var(--space-xs);
}
.field__error {
  font-size: 12px;
  color: #E24B4A;
  margin-top: var(--space-xs);
}


/* ── Section labels ─────────────────────────────────────── */
.section-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.section-label__note {
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-secondary);
  font-weight: 400;
}


/* ── Stat row ───────────────────────────────────────────── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}
.stat {
  background: var(--surface-card);
  border-radius: var(--radius-md);
  border: 0.5px solid var(--border-light);
  padding: 10px 12px;
}
.stat__value {
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  color: var(--text-primary);
}
.stat__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-top: 3px;
}
.stat__value--green  { color: #085041; }
.stat__value--amber  { color: #854F0B; }
.stat__value--muted  { color: var(--text-tertiary); }
@media (max-width: 480px) {
  .stat-row { grid-template-columns: 1fr 1fr; }
}


/* ── Filter tabs ────────────────────────────────────────── */
.filter-tabs {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}
.filter-tab {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  border: 0.5px solid var(--border-medium);
  color: var(--text-secondary);
  background: var(--surface-card);
  cursor: pointer;
  transition: all 0.15s;
}
.filter-tab:hover { border-color: var(--colour-sariio); color: var(--colour-sariio); }
.filter-tab.active {
  background: var(--colour-dark);
  color: var(--colour-white);
  border-color: var(--colour-dark);
}


/* ── Agent cards (dashboard) ────────────────────────────── */
.agent-card {
  background: var(--surface-card);
  border-radius: var(--radius-md);
  border: 0.5px solid var(--border-light);
  padding: var(--space-md);
  cursor: pointer;
  transition: background 0.1s;
  margin-bottom: var(--space-sm);
}
.agent-card:hover { background: var(--surface-raised); }
.agent-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.agent-card__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--colour-white);
  flex-shrink: 0;
}
.agent-card__info { flex: 1; min-width: 0; }
.agent-card__name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}
.agent-card__role { font-size: 12px; color: var(--text-tertiary); }
.agent-card__status { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.agent-card__archetypes {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: var(--space-sm);
}
.agent-card__detail {
  display: none;
  padding-top: var(--space-md);
  margin-top: var(--space-md);
  border-top: 0.5px solid var(--border-light);
}
.agent-card__detail.open { display: block; }
.agent-card__detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}
.detail-cell {
  background: var(--surface-raised);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.detail-cell__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}
.detail-cell__value { font-size: 12px; color: var(--text-primary); }
.agent-card__actions {
  display: flex;
  gap: var(--space-sm);
}
.agent-card__actions .btn { flex: 1; }
.flag-note {
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.5;
  margin-top: var(--space-sm);
}
.flag-note--warn  { background: #fff3e0; color: #854F0B; }
.flag-note--info  { background: #e3f6fb; color: #185FA5; }
.flag-note--retake { background: #fbeaf0; color: #72243E; }
.flag-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.flag-icon--warn   { background: #fff3e0; }
.flag-icon--info   { background: #e3f6fb; }
.flag-icon--retake { background: #fbeaf0; }


/* ── Heat map bars ──────────────────────────────────────── */
.heat-pip {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.heat-pip--rh { background: var(--colour-red-hot); }
.heat-pip--h  { background: var(--colour-hot); }
.heat-pip--w  { background: var(--colour-warm); }
.heat-pip--lw { background: var(--colour-lukewarm); }
.heat-pip--c  { background: var(--colour-cool); }
.heat-bar-bg {
  background: var(--surface-raised);
  border-radius: 3px;
  height: 5px;
  overflow: hidden;
}
.heat-bar-fill { height: 5px; border-radius: 3px; }


/* ── Expandable sections (results) ─────────────────────── */
.expand-section {
  background: var(--surface-card);
  border-radius: var(--radius-md);
  border: 0.5px solid var(--border-light);
  cursor: pointer;
  overflow: hidden;
  transition: background 0.1s;
}
.expand-section:hover { background: var(--surface-raised); }
.expand-section__header {
  padding: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}
.expand-section__icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.expand-section__title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}
.expand-section__sub {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.expand-section__caret {
  font-size: 12px;
  color: var(--text-tertiary);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.expand-section__caret.open { transform: rotate(180deg); }
.expand-section__body {
  display: none;
  padding: 0 var(--space-md) var(--space-md);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
  border-top: 0.5px solid var(--border-light);
  padding-top: var(--space-md);
}
.expand-section__body.open { display: block; }
.sections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}
@media (max-width: 480px) {
  .sections-grid { grid-template-columns: 1fr; }
}


/* ── Hero (results) ─────────────────────────────────────── */
.results-hero {
  text-align: center;
  padding: var(--space-xl) 0 var(--space-lg);
}
.results-hero__combo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background: var(--surface-raised);
  border: 0.5px solid var(--border-light);
  border-radius: var(--radius-pill);
  padding: 4px 14px;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: var(--space-md);
}
.results-hero__combo-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--colour-sariio);
}
.results-hero__name {
  font-size: 22px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: var(--space-sm);
}
.results-hero__name em {
  color: var(--colour-sariio);
  font-style: normal;
}
.results-hero__summary {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 440px;
  margin: 0 auto;
}


/* ── Factor grid (4 across) ─────────────────────────────── */
.factor-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
  margin: var(--space-lg) 0;
}
@media (max-width: 480px) {
  .factor-grid { grid-template-columns: 1fr 1fr; }
}


/* ── Factor detail panel ────────────────────────────────── */
.factor-detail {
  background: var(--surface-card);
  border-radius: var(--radius-md);
  border: 0.5px solid var(--border-light);
  padding: var(--space-md);
  display: none;
  margin-bottom: var(--space-sm);
}
.factor-detail.open { display: block; }
.factor-detail__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}
.factor-detail__body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: var(--space-sm);
}
.factor-detail__tags { display: flex; gap: var(--space-xs); flex-wrap: wrap; }
.factor-tag {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}
.factor-tag--c { background: #fff3e0; color: #854F0B; }
.factor-tag--t { background: #e3f6fb; color: #0C447C; }
.factor-tag--d { background: #fbeaf0; color: #72243E; }
.factor-tag--i { background: #e1f5ee; color: #085041; }


/* ── Primer / how it works box ──────────────────────────── */
.how-box {
  background: var(--surface-raised);
  border-radius: var(--radius-md);
  border: 0.5px solid var(--border-light);
  padding: var(--space-md);
  margin: var(--space-lg) 0;
}
.how-box__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--space-sm);
}
.how-box__text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-sm);
}
.how-box__try {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-bottom: var(--space-sm);
}
.how-box__hint { font-size: 11px; color: var(--text-tertiary); text-align: center; margin-top: var(--space-xs); }


/* ── Reassurance list (primer) ──────────────────────────── */
.reassurance { margin: var(--space-lg) 0; }
.reassurance__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.reassurance__dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reassurance__text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.reassurance__text strong {
  font-weight: 500;
  color: var(--text-primary);
}
.count-note {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
  margin-top: var(--space-sm);
}
.retake-note {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
  margin-top: var(--space-lg);
  line-height: 1.5;
}


/* ── Coaching card (manager view) ───────────────────────── */
.coaching-card {
  background: #e3f6fb;
  border-radius: var(--radius-md);
  border: 0.5px solid #85B7EB;
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
}
.coaching-card__title {
  font-size: 13px;
  font-weight: 500;
  color: #0C447C;
  margin-bottom: var(--space-sm);
}
.coaching-card__body {
  font-size: 13px;
  color: #185FA5;
  line-height: 1.65;
}


/* ── Access level indicator ─────────────────────────────── */
.access-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-md);
}
.access-tag--agent   { background: #fff3e0; color: #854F0B; }
.access-tag--manager { background: #e3f6fb; color: #0C447C; }
.access-tag--admin   { background: #fbeaf0; color: #72243E; }


/* ── Empty states ───────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
}
.empty-state__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface-raised);
  border: 0.5px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
}
.empty-state__title {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}
.empty-state__body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 320px;
  margin: 0 auto var(--space-xl);
}


/* ── Footer note ────────────────────────────────────────── */
.footer-note {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
  line-height: 1.5;
}


/* ── Utility ─────────────────────────────────────────────── */
.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mt-xl  { margin-top: var(--space-xl); }
.mb-sm  { margin-bottom: var(--space-sm); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }
.text-center { text-align: center; }
.text-muted  { color: var(--text-tertiary); font-size: 12px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}
/* ── Preference pair orientation cards ───────────────────────────────── */

.factor-detail__archetype-summary {
  margin-bottom: 0.75rem;
  line-height: 1.55;
  color: #2c3540;
}

.pp-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e6e8ec;
}

.pp-pair__name {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #4a5260;
  margin: 0 0 0.6rem 0;
  text-transform: uppercase;
}

.pp-orientations {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pp-card {
  border: 1px solid #e6e8ec;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pp-card:hover {
  border-color: #cfd3da;
}

.pp-card--open {
  border-color: #b9bdc5;
  box-shadow: 0 2px 8px rgba(20, 30, 50, 0.06);
}

.pp-card__head {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 1rem;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.pp-card__head:focus-visible {
  outline: 2px solid #29b6d6;
  outline-offset: -2px;
}

.pp-card__orient {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: #f3f4f7;
  color: #4a5260;
  white-space: nowrap;
}

.pp-card--left  .pp-card__orient { background: #e8f1fc; color: #1d5ba8; }
.pp-card--centre .pp-card__orient { background: #ecf3ee; color: #2a6c46; }
.pp-card--right .pp-card__orient { background: #fdecef; color: #b73456; }

.pp-card__hook {
  font-size: 0.95rem;
  line-height: 1.45;
  color: #2c3540;
}

.pp-card__caret {
  font-size: 0.85rem;
  color: #8a909a;
  transition: transform 0.15s ease;
}

.pp-card--open .pp-card__caret {
  transform: rotate(180deg);
}

.pp-card__body {
  padding: 0.25rem 1rem 1rem 1rem;
  border-top: 1px solid #f0f1f4;
}

.pp-section {
  margin-top: 0.9rem;
}

.pp-section__title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #4a5260;
  margin: 0 0 0.35rem 0;
}

.pp-section__body {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #2c3540;
  white-space: pre-line;
}

@media (max-width: 480px) {
  .pp-card__head {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    row-gap: 0.4rem;
  }
  .pp-card__orient { grid-column: 1; grid-row: 1; }
  .pp-card__caret  { grid-column: 2; grid-row: 1; }
  .pp-card__hook   { grid-column: 1 / -1; grid-row: 2; }
}


/* === Phase 5: results report === */

/* ── Wider container for the results page ────────────────── */
.container--results {
  max-width: 720px;
  padding: var(--space-xl) var(--space-xl);
}

/* ── Results page header ─────────────────────────────────── */
.results-header {
  padding: var(--space-xl) 0 var(--space-2xl);
  margin-left: 72px;
}
.results-header__name {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}
.results-header__meta {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}
.results-header__lede {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 560px;
}

/* ── Factor section wrapper ──────────────────────────────── */
.results-factors {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: var(--space-3xl);
}

/* ── Factor header row ───────────────────────────────────── */
.factor-header-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: var(--space-sm);
}
.factor-header-logo {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.factor-header-logo-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.factor-header-bar {
  flex: 1;
  border-radius: var(--radius-md);
  padding: 0 24px;
  min-height: 56px;
  display: flex;
  align-items: center;
}
.factor-header-name {
  font-size: 28px;
  font-weight: 700;
  color: var(--colour-white);
  line-height: 1.05;
  white-space: nowrap;
}

/* ── Pair blocks ─────────────────────────────────────────── */
.factor-pairs {
  display: flex;
  flex-direction: column;
  margin-left: 72px; /* logo (56px) + flex gap (16px) — aligns to bar left edge */
}
.pair-block {
  padding: 18px 0;
  border-bottom: 1px solid var(--border-light);
}
.pair-block:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* ── Pair header row ─────────────────────────────────────── */
.pair-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.pair-block__name {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.pair-block__meta-chip {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: var(--surface-raised);
  border: 0.5px solid var(--border-medium);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
}

/* ── Slider ──────────────────────────────────────────────── */
.pair-block__slider {
  width: 100%;
  margin-bottom: var(--space-xs);
}

/* ── Pole labels ─────────────────────────────────────────── */
.pair-block__poles {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
  padding-left: 3.3%;
  padding-right: 3.3%;
}
.pair-block__pole {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

/* ── Meta row ────────────────────────────────────────────── */
.pair-block__meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin: 10px 0;
  padding-left: 3.3%;
  padding-right: 3.3%;
}
.consistency-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  border: 0.5px solid var(--border-light);
  color: var(--text-secondary);
  white-space: nowrap;
}
.consistency-pill--consistent {
  background: #e1f5ee;
  border-color: transparent;
  color: #085041;
}
.consistency-pill--adapts {
  background: #fff3e0;
  border-color: transparent;
  color: #854F0B;
}
.consistency-pill--wide_range {
  background: #fbeaf0;
  border-color: transparent;
  color: #72243E;
}
.pair-block__stats {
  flex: 1;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
}
.pair-block__expand-hint {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ── Prose summary ───────────────────────────────────────── */
.pair-block__summary {
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-top: 12px;
  padding-left: 3.3%;
}

/* ── Details element ─────────────────────────────────────── */
.pair-block__details {
  margin-top: var(--space-md);
}

/* ── Details trigger (<summary>) ─────────────────────────── */
.pair-block__details-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  list-style: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  padding: 2px 0;
}
.pair-block__details-trigger::-webkit-details-marker {
  display: none;
}
.pair-block__details-trigger:hover {
  color: var(--text-primary);
}
.pair-block__details-trigger-text::before {
  content: 'Show more';
}
details[open] .pair-block__details-trigger-text::before {
  content: 'Show less';
}
.pair-block__details-trigger-icon {
  display: inline-block;
  line-height: 1;
  transition: transform 0.2s ease;
}
details[open] .pair-block__details-trigger-icon {
  transform: rotate(90deg);
}

/* ── Details panel: two-column grid ─────────────────────── */
.pair-block__details-body {
  background: var(--surface-raised);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 24px;
  row-gap: 18px;
}
@media (max-width: 520px) {
  .pair-block__details-body {
    grid-template-columns: 1fr;
  }
}

/* ── Section heading and body ────────────────────────────── */
.pair-block__details-section {
  min-width: 0;
}
.pair-block__details-h {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 0 6px;
}
.pair-block__details-text {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.pair-block__details-bullet {
  font-size: 15px;
  margin: 0 0 4px;
  text-indent: -14px;
  padding-left: 14px;
}
.pair-block__details-bullet:last-child {
  margin-bottom: 0;
}

/* ── Dividers between row-pairs inside the grid ──────────── */
.pair-block__details-divider {
  grid-column: 1 / -1;
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 0;
}
@media (max-width: 520px) {
  .pair-block__details-divider {
    display: none;
  }
}


/* === Phase 8: layer 1 polarisation view === */

.factor-block {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 24px;
  padding: 0;
  margin: 0;
}

.factor-anchor {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.factor-anchor__logo {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.factor-anchor__name {
  font-size: 13px;
  font-variant: small-caps;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  text-align: center;
}

.factor-scales {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scale-row__poles {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.scale-row__pole {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.scale-row__slider {
  width: 100%;
}

.factor-divider {
  display: none;
}

/* ── Admin nav ──────────────────────────────────────────────── */
.admin-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  padding: 0 var(--space-xl);
  gap: var(--space-xl);
  z-index: 1000;
}

.admin-nav__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  flex-shrink: 0;
}
.admin-nav__brand:hover { text-decoration: none; }

.admin-nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex: 1;
}

.admin-nav__link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.admin-nav__link:hover {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom-color: var(--border-medium);
}
.admin-nav__link--active {
  color: var(--text-primary);
  border-bottom-color: var(--colour-sariio);
}

.admin-nav__user {
  position: relative;
  flex-shrink: 0;
}

.admin-nav__user-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  transition: background 0.15s, color 0.15s;
}
.admin-nav__user-btn:hover {
  background: var(--surface-input);
  color: var(--text-primary);
}

.admin-nav__chevron { font-size: 10px; color: var(--text-tertiary); }

.admin-nav__user-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--surface-card);
  border: 0.5px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-raised);
  min-width: 140px;
  z-index: 1010;
  padding: 4px 0;
}

.admin-nav__user-dropdown-item {
  display: block;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.1s;
}
.admin-nav__user-dropdown-item:hover {
  background: var(--surface-input);
  text-decoration: none;
}

button.admin-nav__user-dropdown-item {
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: inherit;
}


/* ── Admin page layout ──────────────────────────────────────── */
.zone-admin {
  min-height: 100vh;
}

.container--admin {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: var(--space-xl);
  padding-right: var(--space-xl);
  padding-bottom: 40px;
}

.zone-admin__title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.zone-admin__subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}


/* ── Admin toolbar ──────────────────────────────────────────── */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.admin-toolbar__left,
.admin-toolbar__right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}


/* ── Filter row ─────────────────────────────────────────────── */
.filter-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.filter-dropdown {
  position: relative;
  display: inline-block;
}

.filter-dropdown__trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface-card);
  border: 0.5px solid var(--border-medium);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.filter-dropdown__trigger:hover {
  background: var(--surface-input);
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.filter-dropdown__trigger--active {
  background: var(--colour-dark);
  color: var(--colour-white);
  border-color: var(--colour-dark);
}

.filter-dropdown__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--colour-sariio);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.filter-dropdown__panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--surface-card);
  border: 0.5px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-raised);
  min-width: 180px;
  max-height: 260px;
  overflow-y: auto;
  z-index: 500;
  padding: 4px 0;
}
.filter-dropdown__panel.is-open { display: block; }

.filter-dropdown__option {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 7px 12px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.1s;
}
.filter-dropdown__option:hover { background: var(--surface-input); }
.filter-dropdown__option input[type="checkbox"] {
  width: auto;
  flex-shrink: 0;
  cursor: pointer;
}

.filter-dropdown__empty {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.filter-search {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

.filter-search__input {
  width: 100%;
  padding: 6px 10px;
  font-size: 13px;
  border: 0.5px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}
.filter-search__input:focus {
  border-color: var(--colour-sariio);
  background: var(--surface-card);
  outline: none;
}


/* ── Admin table ────────────────────────────────────────────── */
.admin-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 0.5px solid var(--border-light);
  background: var(--surface-card);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table__th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.admin-table__td {
  padding: 10px 12px;
  color: var(--text-primary);
  border-bottom: 0.5px solid var(--border-light);
  vertical-align: middle;
}
.admin-table__td--muted { color: var(--text-tertiary); }

.admin-table__row:last-child .admin-table__td { border-bottom: none; }
.admin-table__row:hover .admin-table__td { background: var(--surface-raised); }

.sort-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.sort-link:hover { color: var(--text-primary); text-decoration: none; }

.sort-icon { font-size: 9px; opacity: 0.5; }
.sort-icon--active { opacity: 1; color: var(--colour-sariio); }


/* ── Status badges ──────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Brand-aligned palette — matches the Candidates progression pills
   in app/templates/invite/list.html (§2 brand colours: amber, blue,
   teal, pink). "Not invited" is the only state Candidates doesn't
   have — kept as outlined-grey for visual quietness. */
.status-badge--not-invited {
  background: #fff;
  color: #a3a199;
  border: 1px solid #d9d6cc;
}
.status-badge--invited {
  background: #d68d12;
  color: #fff;
}
.status-badge--in-progress {
  background: #29b6d6;
  color: #fff;
}
.status-badge--completed {
  background: #2cc5a0;
  color: #fff;
}
.status-badge--withdrawn {
  background: #fde4ec;
  color: #c2477a;
}
/* active/inactive retained for non-survey-lifecycle uses on this
   listing (likely employee active/inactive flag) — kept on brand-
   aligned neutrals. */
.status-badge--active {
  background: #2cc5a0;
  color: #fff;
}
.status-badge--inactive {
  background: #fff;
  color: #a3a199;
  border: 1px solid #d9d6cc;
}


/* ── Action dropdown ────────────────────────────────────────── */
.action-dropdown {
  position: relative;
  display: inline-block;
}

.action-dropdown__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.action-dropdown__trigger:hover {
  background: var(--surface-input);
  color: var(--text-primary);
}

.action-dropdown__menu {
  display: none;
  position: fixed;
  background: var(--surface-card);
  border: 0.5px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-raised);
  min-width: 160px;
  z-index: 800;
  padding: 4px 0;
}
.action-dropdown__menu.is-open { display: block; }

.action-dropdown__item {
  display: block;
  width: 100%;
  padding: 8px 14px;
  font-size: 13px;
  text-align: left;
  color: var(--text-primary);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.1s;
  font-family: inherit;
}
.action-dropdown__item:hover { background: var(--surface-input); text-decoration: none; }
.action-dropdown__item--danger { color: #dc2626; }
.action-dropdown__item--danger:hover { background: #fef2f2; }


/* ── Empty states ───────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem var(--space-xl);
  text-align: center;
}

.empty-state__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface-input);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-lg);
  color: var(--text-tertiary);
}

.empty-state__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.empty-state__body {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  max-width: 320px;
}

.filtered-empty {
  padding: 3rem var(--space-xl);
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}
.filtered-empty a { color: var(--colour-sariio); }


/* ── Toast ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--colour-dark);
  color: var(--colour-white);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-raised);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
}
.toast--in {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* ── Dictionary layout ──────────────────────────────────────── */
.dict-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}
@media (max-width: 640px) {
  .dict-layout { grid-template-columns: 1fr; }
}

.dict-section {
  background: var(--surface-card);
  border: 0.5px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.dict-section__header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 0.5px solid var(--border-light);
}

.dict-section__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.dict-section__count {
  font-weight: 400;
  color: var(--text-tertiary);
}

.dict-section__footer {
  padding: var(--space-sm) var(--space-md);
  border-top: 0.5px solid var(--border-light);
}

.dict-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.dict-table__th {
  padding: 8px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  border-bottom: 0.5px solid var(--border-light);
}
.dict-table__th--status { width: 80px; }
.dict-table__th--actions { width: 40px; }

.dict-table__td {
  padding: 9px 16px;
  color: var(--text-primary);
  border-bottom: 0.5px solid var(--border-light);
  vertical-align: middle;
}
.dict-table__td--actions { text-align: right; }

.dict-table__row:last-child .dict-table__td { border-bottom: none; }
.dict-table__row:hover .dict-table__td { background: var(--surface-raised); }

.dict-action-btn {
  font-size: 13px;
  color: var(--text-tertiary);
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: background 0.1s, color 0.1s;
  letter-spacing: 0.04em;
}
.dict-action-btn:hover {
  background: var(--surface-input);
  color: var(--text-primary);
}

.dict-empty {
  padding: var(--space-xl) var(--space-lg);
  font-size: 13px;
  color: var(--text-tertiary);
  text-align: center;
}


/* ── Back link ──────────────────────────────────────────────── */
.back-link {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
}
.back-link:hover {
  color: var(--text-primary);
  text-decoration: none;
}


/* ── Flash messages ─────────────────────────────────────────── */
.flash-messages {
  position: fixed;
  top: calc(var(--nav-height) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-width: 280px;
  max-width: 480px;
}

.flash {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-raised);
}
.flash--warning { background: #fef3c7; color: #92400e; border: 0.5px solid #fcd34d; }
.flash--error   { background: #fef2f2; color: #991b1b; border: 0.5px solid #fca5a5; }
.flash--success { background: #d1fae5; color: #065f46; border: 0.5px solid #6ee7b7; }
.flash--info    { background: #e0f5fc; color: #0e7490; border: 0.5px solid #67e8f9; }


/* ── Admin table cells (alias for backward compat) ─────────── */
.admin-table__cell {
  padding: 10px 8px;
  color: var(--text-primary);
  border-bottom: 0.5px solid var(--border-light);
  vertical-align: middle;
  font-size: 13px;
}
.admin-table__cell--email a { color: var(--text-primary); }
.admin-table__cell--email a:hover { color: var(--colour-sariio); text-decoration: underline; }
.admin-table__cell--activity { color: var(--text-secondary); font-size: 12px; }
.admin-table__cell--actions { min-width: 316px; text-align: right; white-space: nowrap; }
.admin-table thead th {
  padding: 10px 8px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
.admin-table__row:last-child .admin-table__cell { border-bottom: none; }
.admin-table__row:hover .admin-table__cell { background: var(--surface-raised); }


/* ── Danger button ──────────────────────────────────────────── */
.btn--danger {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}
.btn--danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}


/* ── Admin modal overlay ────────────────────────────────────── */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.admin-modal {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.16);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-modal--sm { max-width: 400px; }

.admin-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 0.5px solid var(--border-light);
  flex-shrink: 0;
}

.admin-modal__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.admin-modal__close {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  font-size: 18px;
  line-height: 1;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, color 0.1s;
}
.admin-modal__close:hover {
  background: var(--surface-input);
  color: var(--text-primary);
}

.admin-modal__body {
  padding: var(--space-xl);
  overflow-y: auto;
  flex: 1;
}

.admin-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border-top: 0.5px solid var(--border-light);
  flex-shrink: 0;
}


/* ── Admin form fields ──────────────────────────────────────── */
.admin-form-group {
  margin-bottom: var(--space-md);
}
.admin-form-group:last-child { margin-bottom: 0; }

.admin-form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.admin-form-required { color: #dc2626; }

.admin-form-hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-tertiary);
}

.admin-form-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  border: 0.5px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--surface-input);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}
.admin-form-input:focus {
  border-color: var(--colour-sariio);
  background: var(--surface-card);
}
.admin-form-input--error { border-color: #dc2626; }

.admin-form-error {
  font-size: 12px;
  color: #dc2626;
  margin-top: 4px;
  min-height: 0;
  display: none;
}
.admin-form-error--visible { display: block; }

.admin-form-general-error {
  font-size: 13px;
  color: #dc2626;
  padding: var(--space-sm) var(--space-md);
  background: #fef2f2;
  border: 0.5px solid #fca5a5;
  border-radius: var(--radius-md);
  margin-top: var(--space-sm);
  display: none;
}
.admin-form-general-error--visible { display: block; }

.admin-form-group--check {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.admin-form-check-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
}
.admin-form-check-label input[type="checkbox"] {
  width: auto;
  flex-shrink: 0;
}

.admin-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}
@media (max-width: 480px) {
  .admin-form-row { grid-template-columns: 1fr; }
}


/* ── Upload wizard ──────────────────────────────────────────── */
.wizard-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: var(--space-2xl);
}

.wizard-step {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: var(--text-tertiary);
}

.wizard-step__num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-input);
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 6px;
}

.wizard-step--active .wizard-step__num {
  background: var(--colour-dark);
  color: #ffffff;
}
.wizard-step--active { color: var(--text-primary); font-weight: 500; }

.wizard-step--done .wizard-step__num {
  background: #2cc5a0;
  color: #ffffff;
}
.wizard-step--done { color: var(--text-secondary); }

.wizard-step__connector {
  flex: 1;
  height: 1px;
  background: var(--border-medium);
  margin: 0 var(--space-sm);
  min-width: var(--space-xl);
}


/* ── Upload zone ────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 3rem var(--space-xl);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--surface-raised);
}
.upload-zone:hover,
.upload-zone--drag-over {
  border-color: var(--colour-sariio);
  background: #e0f5fc;
}

.upload-zone__icon {
  color: var(--text-tertiary);
  margin-bottom: var(--space-md);
}

.upload-zone__text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.upload-zone__hint {
  font-size: 12px;
  color: var(--text-tertiary);
}

.upload-zone__filename {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-top: var(--space-sm);
}

.upload-errors {
  margin-top: var(--space-lg);
}

.upload-error-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: #fef2f2;
  border: 0.5px solid #fca5a5;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: #991b1b;
  margin-bottom: 6px;
}

.upload-col-spec {
  margin-top: var(--space-xl);
  padding: var(--space-md) var(--space-lg);
  background: var(--surface-raised);
  border: 0.5px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
}


/* ── Reconcile table ────────────────────────────────────────── */
.recon-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: var(--space-2xl);
}

.recon-table th {
  padding: 8px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-light);
}

.recon-table td {
  padding: 10px 12px;
  border-bottom: 0.5px solid var(--border-light);
  vertical-align: middle;
}

.recon-table tr:last-child td { border-bottom: none; }

.recon-section {
  background: var(--surface-card);
  border: 0.5px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-xl);
}

.recon-section__header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 0.5px solid var(--border-light);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.recon-radio-group {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  flex-wrap: wrap;
}

.recon-radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
}

.recon-map-select {
  margin-top: 6px;
  display: none;
}


/* ── Review summary ─────────────────────────────────────────── */
.review-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.review-stat {
  background: var(--surface-card);
  border: 0.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  text-align: center;
}

.review-stat__value {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.review-stat__label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.review-warnings {
  margin-bottom: var(--space-xl);
}

.review-warning-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: 8px var(--space-md);
  background: #fef3c7;
  border: 0.5px solid #fcd34d;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: #92400e;
  margin-bottom: 6px;
}


/* ── Customise columns dropdown ─────────────────────────────── */
.cols-dropdown {
  position: relative;
  display: inline-block;
}

.cols-dropdown__panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--surface-card);
  border: 0.5px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-raised);
  min-width: 180px;
  z-index: 500;
  padding: 4px 0;
}
.cols-dropdown__panel.is-open { display: block; }

.cols-dropdown__option {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 7px 12px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
}
.cols-dropdown__option:hover { background: var(--surface-input); }
.cols-dropdown__option input[type="checkbox"] {
  width: auto;
  flex-shrink: 0;
  cursor: pointer;
}


/* ── Device advisory banner ──────────────────────────────────────────────
   Informational only — appears on narrow viewports for complex views
   (admin, comparisons, chassis). Dismissable per session via the X button
   wiring in base.html. Survey and simple result views are unaffected
   because the banner is hidden by default and only flips to flex below
   768px; the banner itself is non-blocking so even un-dismissed it just
   sits above the content. */
/* --- Mobile hint banner ---
   Fixed strip below the (fixed) nav at top: var(--nav-height); z-index 999
   sits below the admin-nav (1000) and above page content. Matches the
   dismissable-banner pattern. When dismissed (sessionStorage), display: none
   removes the overlay entirely. */
.mobile-hint-banner {
  display: none;
}

@media (max-width: 768px) {
  .mobile-hint-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    z-index: 999;
    padding: 10px 16px;
    background: #fff8e1;
    border-bottom: 1px solid #f5a623;
    font-size: 0.82rem;
    color: #5a4a00;
    gap: 12px;
  }
}

.mobile-hint-banner__text {
  flex: 1;
  line-height: 1.4;
}

.mobile-hint-banner__close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #5a4a00;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  min-width: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* ── Shepherd.js tour theme ──────────────────────────────────────────────
   Scoped to .shepherd-theme-sariio for specificity over the CDN defaults. */
.shepherd-theme-sariio.shepherd-element {
  max-width: 300px;
  z-index: 10000;
  border-radius: 12px !important;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
.shepherd-theme-sariio .shepherd-header {
  background: #2b2a26 !important;
  padding: 8px 14px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 0;
}
.shepherd-theme-sariio .shepherd-title {
  color: #fff !important;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0;
}
.shepherd-theme-sariio .shepherd-cancel-icon {
  color: rgba(255, 255, 255, 0.7) !important;
  font-size: 1rem;
}
.shepherd-theme-sariio .shepherd-cancel-icon:hover {
  color: #fff;
}
.shepherd-theme-sariio .shepherd-text {
  font-size: 0.78rem !important;
  line-height: 1.5;
  color: #2b2a26;
  padding: 12px 14px !important;
  max-height: 160px;
  overflow-y: auto;
}
.shepherd-theme-sariio .shepherd-footer {
  padding: 0 14px 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.shepherd-theme-sariio .shepherd-button {
  background: #2b2a26;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.shepherd-theme-sariio .shepherd-button:hover {
  background: #3d3c37;
}
.shepherd-theme-sariio .shepherd-button.shepherd-button-secondary {
  background: #f0eeea;
  color: #2b2a26;
}
.shepherd-theme-sariio .shepherd-button.shepherd-button-secondary:hover {
  background: #e4e1da;
}
.shepherd-modal-overlay-container.shepherd-modal-is-visible {
  opacity: 0.35;
}
.shepherd-theme-sariio .shepherd-arrow { display: none !important; }

/* Nudge pulse: applied to the active tooltip when a user-action step has
   been idle for too long, or when the navigation guard blocks a click. */
@keyframes shepherd-nudge {
  0%, 100% { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15); }
  50% { box-shadow: 0 8px 30px rgba(43, 42, 38, 0.35); }
}
.shepherd-theme-sariio.shepherd-nudge {
  animation: shepherd-nudge 1.5s ease-in-out 2;
}
/* Hide any phantom empty footer Shepherd may render when a step is
   declared with buttons:[]. The upstream CDN sometimes paints an empty
   .shepherd-footer that catches stray padding and visually reads as
   a Next button slot. :empty matches only when the element has no
   children -- if a step ever DOES declare buttons, this rule won't
   match and the footer renders normally. */
.shepherd-theme-sariio .shepherd-footer:empty { display: none; }

/* ── Pairwise insight panel ──── */
/* Slide-in side panel that replaces the floating mini card on the
   relationship circle. position:fixed at z-index 1050/1051 so it sits
   over every page chrome element. The wrapping admin templates do not
   introduce a transformed ancestor, so the fixed positioning resolves
   against the viewport as intended even though the panel markup is
   declared deep inside admin_content. */

/* Backdrop sits at low opacity so the relationship circle stays
   visible behind the bottom sheet -- the panel is paired with the
   chart it explains, not modal-over-content. */
.pairwise-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.08);
  z-index: 1050;
}
.pairwise-overlay.active {
  display: block;
}

/* Bottom-sheet variant: anchored to the viewport bottom, slides up
   from off-screen via transform (GPU-accelerated) rather than the old
   right-edge layout. max-height keeps the underlying circle visible
   above the sheet. */
.pairwise-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  top: auto;
  max-height: 40vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
  z-index: 1051;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}
.pairwise-panel.open {
  transform: translateY(0);
}

/* Decorative drag-handle pill: centred at the top of the sheet, signals
   "you can dismiss this downward" without actually wiring a gesture. */
.pairwise-panel-drag {
  width: 40px;
  height: 8px;
  border-radius: 4px;
  background: #ccc;
  margin: 10px auto;
}

.pairwise-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  gap: 12px;
}
/* Each person token is an avatar + name pair laid out side-by-side.
   min-width:0 lets the name truncate cleanly when the viewport is
   narrow. */
.pairwise-person {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.pairwise-panel-header .av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
}
.pairwise-panel-header .pair-name {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Match-percentage pill: sits between the two people in the header. */
.pairwise-panel-header .match-pct {
  font-size: 13px;
  font-weight: 600;
  color: #555;
  padding: 4px 12px;
  background: #f7f7f5;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.pairwise-panel-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #eee;
  background: #f9f9f9;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: #999;
  flex-shrink: 0;
  margin-left: 8px;
  line-height: 1;
  font-family: inherit;
  padding: 0;
}
.pairwise-panel-close:hover {
  background: #eee;
  color: #333;
}

/* Two-column body: green-accent "connect" column on the left, coral-
   accent "differ" column on the right. The accent is a 3px coloured
   top-border that anchors the column visually without needing a
   coloured background. */
.pairwise-panel-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 16px 24px;
}
.pairwise-col {
  padding-top: 12px;
  border-top: 3px solid #ccc;
}
.pairwise-col--match { border-top-color: #2cc5a0; }
.pairwise-col--diff  { border-top-color: #d4537e; }
.pairwise-col-h {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #555;
}
.pairwise-col--match .pairwise-col-h { color: #0F6E56; }
.pairwise-col--diff  .pairwise-col-h { color: #993556; }

.pairwise-narrative {
  font-size: 13px;
  color: #333;
  line-height: 1.65;
}
.pairwise-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: #aaa;
  background: #f7f7f5;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 10px;
}
.pairwise-narrative-loading {
  font-size: 13px;
  color: #999;
  font-style: italic;
}

.pairwise-panel-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 24px;
  border-top: 1px solid #ece9df;
}
.pairwise-btn-copy {
  font-size: 13px;
  color: #777;
  background: #f7f7f5;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pairwise-btn-copy:hover {
  background: #eee;
  color: #333;
}
.pairwise-btn-compare {
  font-size: 13px;
  color: #1a73e8;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.pairwise-btn-compare:hover {
  color: #0d47a1;
}

/* Mobile: sheet grows a bit (more breathing room when the columns
   stack) and the two columns collapse to a single column. */
@media (max-width: 768px) {
  .pairwise-panel {
    max-height: 55vh;
  }
  .pairwise-panel-body {
    grid-template-columns: 1fr;
  }
}

/* ── Pairwise insight cheat-sheet card (comparison results page) ────────
   Compact two-column variant of the slide-in panel above, sized for the
   top of the comparison results page where chassis + rail already
   dominate. Reuses .pairwise-q-label / .pairwise-q-dot / .pairwise-narrative
   / .pairwise-ai-badge from the panel section so the visual language
   stays consistent across surfaces. */
.pairwise-insight-card {
  margin-bottom: 24px;
  /* Sit above the chatbot launcher (z-index 100) when the card and
     the bottom-right launcher end up in the same viewport region.
     position:relative is required because z-index only takes effect
     on positioned elements. */
  position: relative;
  z-index: 110;
}
.pairwise-insight-card-inner {
  display: flex;
  gap: 0;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #fff;
}
.pairwise-insight-card-section {
  flex: 1;
  padding: 16px 20px;
}
.pairwise-insight-card-divider {
  width: 1px;
  background: #eee;
}

@media (max-width: 768px) {
  .pairwise-insight-card-inner {
    flex-direction: column;
  }
  .pairwise-insight-card-divider {
    width: auto;
    height: 1px;
  }
}


/* ── Client-side photo editor modal ─────────────────────── */
.photo-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
}
.photo-editor-modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  overflow: hidden;
}
.photo-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 12px;
  border-bottom: 1px solid #eeece8;
}
.photo-editor-title {
  font-size: 16px;
  font-weight: 700;
  color: #2c2c2a;
  margin: 0;
}
.photo-editor-viewport {
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.photo-editor-viewport canvas {
  display: block;
  cursor: grab;
}
.photo-editor-viewport canvas:active {
  cursor: grabbing;
}
.photo-editor-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-top: 1px solid #eeece8;
}
.photo-editor-zoom-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #555;
  flex: 1;
}
.photo-editor-zoom-label input[type="range"] {
  flex: 1;
  accent-color: #534AB7;
  cursor: pointer;
}
.photo-editor-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid #eeece8;
}

/* ── Dyadic comparison photo pair (comparison/results.html) ─────────────── */
.cmp-dyadic-photos {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin: 0 0 20px;
}
.cdp-fig {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.cdp-img,
.cdp-initials {
  width: 108px;
  height: 108px;
  border-radius: 10px;
  flex-shrink: 0;
}
.cdp-img {
  object-fit: cover;
  display: block;
}
.cdp-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eeece8;
  color: #999;
  font-size: 32px;
  font-weight: 600;
}
.cdp-caption {
  font-size: 12px;
  color: var(--text-secondary, #6b7280);
  font-weight: 500;
  text-align: center;
}
