/* AI for Equity — Horizon 2028 Survey (tokens from colors_and_type.css) */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --brand-navy: #20303a;
  --brand-blue: #23abe1;
  --blue-50: #e9f6fc;
  --blue-600: #1a8cbf;
  --blue-700: #166f99;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  --grad-blue: linear-gradient(135deg, #23abe1, #1a8cbf);
  --glow: 0 4px 12px rgba(35, 171, 225, 0.3);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--gray-50);
  background-image: radial-gradient(circle at 15% 10%, rgba(35,171,225,0.05), transparent 40%),
                    radial-gradient(circle at 85% 70%, rgba(35,171,225,0.03), transparent 45%);
  -webkit-font-smoothing: antialiased;
  font-family: var(--font-body);
  color: var(--brand-navy);
  min-height: 100vh;
}

a { color: var(--blue-600); text-decoration: none; }
a:hover { color: var(--blue-700); text-decoration: underline; }
input::placeholder, textarea::placeholder { color: var(--gray-400); }

.topbar {
  position: sticky; top: 0; z-index: 100;
  background: #fff;
  box-shadow: 0 2px 20px rgba(32,48,58,0.08);
  border-bottom: 1px solid var(--gray-200);
}
.topbar-inner {
  max-width: 900px; margin: 0 auto; padding: 14px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.topbar-brand { display: flex; align-items: center; gap: 14px; }
.topbar-brand img { height: 30px; display: block; }
.topbar-divider { width: 1px; height: 22px; background: var(--gray-200); }
.topbar-title { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; color: var(--brand-navy); }
.progress-pill {
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.05em;
  padding: 7px 16px; border-radius: 100px;
  background: var(--blue-50); color: var(--blue-700);
  transition: all 250ms var(--ease);
  white-space: nowrap;
}
.progress-pill.done { background: var(--grad-blue); color: #fff; box-shadow: var(--glow); }

.container { max-width: 860px; margin: 0 auto; padding: 56px 32px 80px; }

.eyebrow {
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--gray-500); margin: 0 0 12px;
}
h1 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 3rem);
  font-weight: 700; letter-spacing: -0.02em; line-height: 1.15;
  margin: 0 0 16px; color: var(--brand-navy);
}
h1 .accent { color: var(--brand-blue); }
.lede { font-size: 1.15rem; line-height: 1.65; color: var(--gray-600); margin: 0 0 16px; max-width: 64ch; text-wrap: pretty; }

.card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: 16px;
  box-shadow: 0 4px 20px rgba(32,48,58,0.08);
  padding: 26px 30px;
}

.respondent-card {
  border-radius: 16px; box-shadow: 0 2px 12px rgba(32,48,58,0.06);
  padding: 24px 28px; margin: 0 0 32px;
  display: flex; gap: 20px; flex-wrap: wrap;
}
.field { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 8px; }
.field-label {
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--gray-500);
}
.field input, textarea {
  font-family: var(--font-body); font-size: 1rem; color: var(--brand-navy);
  padding: 11px 14px; border: 2px solid var(--gray-200); border-radius: 12px;
  outline: none; transition: border-color 250ms;
}
.field input:focus, textarea:focus { border-color: var(--brand-blue); }
.role-row { width: 100%; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 4px; }
.role-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.role-btn {
  cursor: pointer; border-radius: 100px; padding: 9px 18px;
  font-family: var(--font-body); font-size: 0.85rem; font-weight: 600;
  border: 2px solid var(--gray-200); background: #fff; color: var(--gray-600);
  transition: all 250ms var(--ease);
}
.role-btn.active { border-color: transparent; background: var(--grad-blue); color: #fff; box-shadow: var(--glow); }

.items { display: flex; flex-direction: column; gap: 20px; }
.item-card { border-left: 4px solid var(--gray-300); transition: border-color 400ms var(--ease); }
.item-card.complete { border-left-color: var(--brand-blue); }
.item-head { display: flex; align-items: baseline; gap: 12px; }
.item-num { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600; color: var(--gray-400); }
.item-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; line-height: 1.3; margin: 0; color: var(--brand-navy); }

.spectrum { position: relative; margin: 22px 0 4px; }
.spectrum-line { position: absolute; left: 17%; right: 17%; top: 20px; height: 2px; background: var(--gray-200); }
.spectrum-grid { position: relative; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.pole {
  cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 6px 8px; border-radius: 12px; transition: background 250ms;
  border: none; background: transparent; font-family: var(--font-body);
}
.pole:hover { background: rgba(35,171,225,0.06); }
.pole-circle-wrap { height: 30px; display: flex; align-items: center; }
.pole-circle {
  border-radius: 100px; border: 2px solid var(--gray-300); background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: all 250ms var(--ease);
}
.pole-circle.lg { width: 30px; height: 30px; }
.pole-circle.sm { width: 22px; height: 22px; }
.pole.selected .pole-circle { border-color: var(--brand-blue); background: var(--brand-blue); box-shadow: var(--glow); }
.pole-dot { border-radius: 100px; background: #fff; opacity: 0; transition: opacity 250ms; }
.pole-circle.lg .pole-dot { width: 10px; height: 10px; }
.pole-circle.sm .pole-dot { width: 8px; height: 8px; }
.pole.selected .pole-dot { opacity: 1; }
.pole-text { font-size: 0.875rem; line-height: 1.55; color: var(--gray-500); margin: 0; text-align: center; text-wrap: pretty; transition: color 250ms; }
.pole.selected .pole-text { color: var(--brand-navy); }

.conf-row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--gray-100);
  opacity: 0.4; pointer-events: none; transition: opacity 250ms;
}
.conf-row.enabled { opacity: 1; pointer-events: auto; }
.conf-group { display: flex; gap: 4px; background: var(--gray-100); border-radius: 100px; padding: 4px; flex-wrap: wrap; }
.conf-btn {
  border: none; cursor: pointer; border-radius: 100px; padding: 8px 16px;
  font-family: var(--font-body); font-size: 0.8rem; font-weight: 600;
  background: transparent; color: var(--gray-600);
  transition: all 250ms var(--ease);
}
.conf-btn.active { background: var(--grad-blue); color: #fff; box-shadow: var(--glow); }

.open-card { border-left: 4px solid var(--gray-300); transition: border-color 400ms var(--ease); }
.open-card.filled { border-left-color: var(--brand-blue); }
.open-hint { font-size: 0.95rem; line-height: 1.6; color: var(--gray-500); margin: 12px 0 16px; text-wrap: pretty; }
textarea { width: 100%; line-height: 1.6; resize: vertical; }

.summary-card {
  margin-top: 40px; background: #fff; border: 2px solid var(--brand-blue);
  border-radius: 20px; box-shadow: 0 12px 30px rgba(32,48,58,0.12); padding: 32px 36px;
}
.summary-eyebrow { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--blue-600); margin: 0 0 8px; }
.summary-card h2 { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 4px; color: var(--brand-navy); }
.respondent-line { font-size: 0.95rem; color: var(--gray-500); margin: 0 0 24px; }
.summary-grid { display: grid; grid-template-columns: 36px 1fr 110px 90px; border-top: 1px solid var(--gray-200); }
.summary-grid > span { padding: 10px 0; border-bottom: 1px solid var(--gray-100); font-size: 0.9rem; }
.sum-num { font-family: var(--font-mono); font-size: 0.8rem; color: var(--gray-400); }
.sum-title { padding-right: 8px !important; color: var(--brand-navy); }
.sum-choice { font-weight: 600; color: var(--blue-600); }
.sum-choice.mid { color: var(--gray-500); }
.sum-conf { color: var(--gray-600); text-align: right; }

.actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; align-items: center; }
.btn-primary {
  border: none; cursor: pointer; border-radius: 100px; padding: 13px 26px;
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 600; color: #fff;
  background: var(--grad-blue); box-shadow: var(--glow);
  transition: all 250ms var(--ease);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(35,171,225,0.35); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn-secondary {
  cursor: pointer; border-radius: 100px; padding: 13px 26px;
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 600;
  color: var(--brand-navy); background: #fff; border: 2px solid var(--gray-200);
  transition: all 250ms var(--ease);
}
.btn-secondary:hover { transform: translateY(-2px); border-color: var(--brand-blue); box-shadow: 0 4px 12px rgba(35,171,225,0.2); }
.submit-hint { font-size: 0.85rem; color: #d64545; margin: 0; }
.submit-hint.progress { color: var(--gray-500); }
.submit-card { margin-top: 20px; }
.submit-card .actions { margin-top: 0; }

.confirm-card {
  margin-top: 40px; background: #fff; border: 2px solid #1f9d55; border-radius: 20px;
  box-shadow: 0 12px 30px rgba(32,48,58,0.12); padding: 32px 36px;
}
.confirm-eyebrow { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: #1f9d55; margin: 0 0 8px; }
.confirm-card h2 { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; color: var(--brand-navy); }
.confirm-card p { font-size: 1rem; line-height: 1.6; color: var(--gray-600); margin: 0 0 4px; }

.footnote { font-size: 0.8rem; color: var(--gray-400); margin: 32px 0 0; text-align: center; }

/* ---- Results dashboard ---- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin: 0 0 32px; }
.stat-card { background: #fff; border: 1px solid var(--gray-200); border-radius: 16px; box-shadow: 0 2px 12px rgba(32,48,58,0.06); padding: 20px 24px; }
.stat-value { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--brand-navy); }
.stat-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gray-500); margin-top: 4px; }

.dist-row { display: grid; grid-template-columns: 90px 1fr 56px; gap: 12px; align-items: center; margin-top: 10px; }
.dist-label { font-size: 0.8rem; font-weight: 600; color: var(--gray-600); }
.dist-track { height: 22px; background: var(--gray-100); border-radius: 100px; overflow: hidden; }
.dist-fill { height: 100%; border-radius: 100px; background: var(--grad-blue); transition: width 400ms var(--ease); min-width: 0; }
.dist-fill.mid { background: var(--gray-300); }
.dist-count { font-family: var(--font-mono); font-size: 0.8rem; color: var(--gray-500); text-align: right; }
.pole-caption { font-size: 0.8rem; line-height: 1.5; color: var(--gray-500); margin: 14px 0 0; }
.pole-caption strong { color: var(--brand-navy); }
.conf-note { font-size: 0.8rem; color: var(--gray-400); margin-top: 12px; }
.resp-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.resp-table th { text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gray-500); padding: 8px 10px; border-bottom: 1px solid var(--gray-200); }
.resp-table td { padding: 8px 10px; border-bottom: 1px solid var(--gray-100); color: var(--brand-navy); vertical-align: top; }
.open-response { border-left: 3px solid var(--brand-blue); padding: 4px 0 4px 16px; margin: 16px 0; }
.open-response .who { font-size: 0.8rem; font-weight: 600; color: var(--gray-500); margin-bottom: 4px; }
.open-response .what { font-size: 0.95rem; line-height: 1.6; color: var(--brand-navy); white-space: pre-wrap; }
.section-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; margin: 48px 0 16px; color: var(--brand-navy); }

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
}
@media (max-width: 640px) {
  .container { padding: 40px 20px 64px; }
  .topbar-inner { padding: 12px 20px; }
  .card, .summary-card, .confirm-card { padding: 20px; }
  .summary-grid { grid-template-columns: 28px 1fr 80px 70px; }
}

/* ---- Results v2: diverging spectrum charts ---- */
.filter-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 24px; }
.seg-control { display: flex; gap: 4px; background: var(--gray-100); border-radius: 100px; padding: 4px; }
.seg-btn {
  border: none; cursor: pointer; border-radius: 100px; padding: 8px 16px;
  font-family: var(--font-body); font-size: 0.8rem; font-weight: 600;
  background: transparent; color: var(--gray-600); transition: all 250ms var(--ease);
}
.seg-btn.active { background: var(--grad-blue); color: #fff; box-shadow: var(--glow); }
.chart-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 0.75rem; color: var(--gray-500); }
.legend-arm { display: flex; align-items: center; gap: 5px; }
.legend-swatches { display: flex; gap: 2px; }
.legend-swatches span { width: 14px; height: 14px; border-radius: 3px; display: block; }

.overview-row {
  display: grid; grid-template-columns: minmax(150px, 240px) 1fr 92px;
  gap: 14px; align-items: center; padding: 9px 0;
  border-bottom: 1px solid var(--gray-100); cursor: pointer; border-radius: 8px;
}
.overview-row:hover { background: rgba(35,171,225,0.05); }
.ov-label { font-size: 0.85rem; font-weight: 600; color: var(--brand-navy); line-height: 1.3; }
.ov-label .qnum { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600; color: var(--gray-400); margin-right: 6px; }
.ov-lean { font-size: 0.78rem; font-weight: 600; text-align: right; white-space: nowrap; }
.ov-lean.left { color: #a84a10; }
.ov-lean.right { color: var(--blue-700); }
.ov-lean.split { color: var(--gray-500); }

.div-track { position: relative; height: 20px; }
.div-track.tall { height: 28px; }
.div-center { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: var(--gray-300); transform: translateX(-1px); border-radius: 2px; }
.div-bar { position: absolute; top: 0; bottom: 0; display: flex; gap: 2px; }
.div-seg {
  height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 0.68rem; font-weight: 700; color: #fff; min-width: 0; overflow: hidden;
  transition: width 400ms var(--ease), left 400ms var(--ease);
}
.div-seg.s-l1 { color: #7c3a10; }
.div-seg.s-r1 { color: #125a7c; }
.div-seg.s-m { color: var(--gray-600); }
.div-bar .div-seg:first-child { border-radius: 4px 0 0 4px; }
.div-bar .div-seg:last-child { border-radius: 0 4px 4px 0; }
.div-bar .div-seg:only-child { border-radius: 4px; }

.detail-bar-wrap { margin: 20px 0 6px; }
.axis-caps { display: flex; justify-content: space-between; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.axis-caps .cap-left { color: #a84a10; }
.axis-caps .cap-right { color: var(--blue-700); }

.pole-desc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 14px; }
.pole-desc { font-size: 0.83rem; line-height: 1.55; color: var(--gray-500); text-wrap: pretty; }
.pole-desc.right { text-align: right; }

.who-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--gray-100); }
.who-col-head { display: flex; align-items: center; gap: 6px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gray-500); margin-bottom: 8px; }
.who-col:nth-child(2) .who-col-head, .who-col:nth-child(2) .who-chips { justify-content: center; }
.who-col:nth-child(3) .who-col-head, .who-col:nth-child(3) .who-chips { justify-content: flex-end; }
.who-dot { width: 10px; height: 10px; border-radius: 100px; }
.who-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 0.75rem; font-weight: 600; padding: 4px 10px; border-radius: 100px;
  white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.chip.c3 { background: var(--brand-navy); color: #fff; }
.chip.c2 { background: var(--gray-200); color: var(--brand-navy); }
.chip.c1 { background: #fff; color: var(--gray-500); border: 1px dashed var(--gray-300); }

.lean-chip { font-size: 0.75rem; font-weight: 700; padding: 5px 12px; border-radius: 100px; white-space: nowrap; }
.lean-chip.left { background: #fdf0e5; color: #a84a10; }
.lean-chip.right { background: var(--blue-50); color: var(--blue-700); }
.lean-chip.split { background: var(--gray-100); color: var(--gray-500); }

.viz-tooltip {
  position: fixed; z-index: 200; pointer-events: none; display: none;
  background: var(--brand-navy); color: #fff; font-size: 0.78rem; font-weight: 500;
  padding: 8px 12px; border-radius: 10px; box-shadow: 0 8px 24px rgba(32,48,58,0.3);
  max-width: 260px; line-height: 1.45;
}

@media (max-width: 640px) {
  .overview-row { grid-template-columns: 1fr; gap: 6px; }
  .ov-lean { text-align: left; }
  .pole-desc-grid, .who-grid { grid-template-columns: 1fr; }
  .pole-desc.right { text-align: left; }
  .who-col:nth-child(2) .who-col-head, .who-col:nth-child(2) .who-chips,
  .who-col:nth-child(3) .who-col-head, .who-col:nth-child(3) .who-chips { justify-content: flex-start; }
}
