:root {
  --cream: #FAF3E8;
  --gold: #FFB44F;
  --maroon: #700000;
  --gold-deep: #D98324;
  --maroon-deep: #4A0000;
  --ink: #2A1B12;
  --ink-soft: #5C4A3D;
  --card-bg: #FFFFFF;
  --border: #EBDFCB;

  --rating-gap: #9E1B1B;
  --rating-awareness: #D98324;
  --rating-developing: #FFB44F;
  --rating-strength: #700000;
}

* { box-sizing: border-box; }

html { overflow-x: hidden; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Lato', 'Segoe UI', -apple-system, sans-serif;
  min-height: 100vh;
  overflow-x: hidden; /* the story-section's 100vw breakout (below) can overshoot by the
                          scrollbar's width on some browsers; this keeps that harmless instead
                          of introducing a horizontal scrollbar */
}

.app-shell {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 18px 60px;
  min-height: 100vh;
}

.screen { display: none; }
.screen.active { display: block; animation: fadeIn 0.35s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--card-bg);
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 32px 26px;
  box-shadow: 0 8px 30px rgba(112, 0, 0, 0.06);
  margin-top: 24px;
}

.presented-by {
  text-align: center;
  font-weight: 700;
  color: var(--maroon);
  margin: 0 0 10px;
  font-size: 0.95rem;
  letter-spacing: 0.2px;
}

/* Wordmark */
.wordmark {
  text-align: center;
  margin-bottom: 18px;
}
.wordmark-logo {
  width: 150px;
  height: auto;
  display: inline-block;
}
.dash-wordmark {
  margin-bottom: 0;
}
.dash-wordmark-logo {
  width: 64px;
}

.headline {
  font-family: 'Palatino Linotype', 'Palatino', Georgia, serif;
  font-size: 1.55rem;
  text-align: center;
  line-height: 1.3;
  margin: 0 0 6px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--maroon) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--maroon);
}

.subhead {
  text-align: center;
  font-weight: 700;
  color: var(--ink-soft);
  margin: 0 0 20px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.kicker {
  text-align: center;
  font-weight: 700;
  color: var(--gold-deep);
  margin: 0 0 10px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.discover-list {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.discover-list li {
  position: relative;
  padding-left: 22px;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--ink);
}
.discover-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--maroon));
}

.next-step-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(255,180,79,0.14), rgba(112,0,0,0.06));
}
.next-step-card:last-child { margin-bottom: 0; }
.next-step-title {
  font-family: 'Palatino Linotype', 'Palatino', Georgia, serif;
  font-weight: 700;
  color: var(--maroon);
  font-size: 1.05rem;
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.next-step-text {
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
}

@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
  body { background: #fff; }
  .no-print { display: none !important; }
  .screen { display: none !important; }
  .screen.active { display: block !important; }
  .card { box-shadow: none; border: none; }
  .app-shell { max-width: 100%; padding: 0; }
}

.body-text {
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--ink);
  margin-bottom: 22px;
}

.meta-line {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.88rem;
  margin-bottom: 26px;
}

.btn-primary {
  display: block;
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--maroon) 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 6px 18px rgba(112, 0, 0, 0.25);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(112, 0, 0, 0.3); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

.btn-secondary {
  display: block;
  padding: 15px 22px;
  border: 1.5px solid var(--maroon);
  border-radius: 12px;
  background: transparent;
  color: var(--maroon);
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.btn-secondary:disabled { opacity: 0.35; cursor: not-allowed; }

/* Lead form */
.lead-title {
  font-family: 'Palatino Linotype', 'Palatino', Georgia, serif;
  color: var(--maroon);
  margin: 0 0 6px;
  font-size: 1.4rem;
}
.lead-sub { color: var(--ink-soft); margin: 0 0 22px; font-size: 0.95rem; }

#lead-form label {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 16px 0 6px;
}
#lead-form input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--cream);
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
}
#lead-form input:focus {
  outline: none;
  border-color: var(--gold-deep);
}
#lead-form .btn-primary { margin-top: 26px; }

/* Quiz */
.progress-wrap { margin-bottom: 22px; }
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--cream);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--maroon) 100%);
  width: 0%;
  transition: width 0.3s ease;
}
.progress-label {
  margin: 10px 0 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--maroon);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.question-text {
  font-family: 'Palatino Linotype', 'Palatino', Georgia, serif;
  font-size: 1.25rem;
  line-height: 1.4;
  color: var(--ink);
  margin: 0 0 22px;
}

.options { display: flex; flex-direction: column; gap: 12px; margin-bottom: 26px; }

.option-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--cream);
  cursor: pointer;
  transition: all 0.15s ease;
}
.option-card:hover { border-color: var(--gold); }
.option-card.selected {
  border-color: var(--maroon);
  background: linear-gradient(90deg, rgba(255,180,79,0.14) 0%, rgba(112,0,0,0.08) 100%);
}
.option-letter {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.option-card.selected .option-letter {
  background: var(--maroon);
  border-color: var(--maroon);
  color: #fff;
}
.option-text { font-size: 0.96rem; line-height: 1.45; color: var(--ink); padding-top: 3px; }

.quiz-nav { display: flex; gap: 12px; }
.quiz-nav .btn-secondary { flex: 0 0 auto; width: 110px; }
.quiz-nav .btn-primary { flex: 1; }

/* Results — dashboard layout */
.dash-card-outer { padding: 20px 16px 26px; }

.dash-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--maroon);
}
.dash-header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.dash-title {
  font-family: 'Palatino Linotype', 'Palatino', Georgia, serif;
  font-weight: 700;
  color: var(--maroon);
  font-size: 1.35rem;
  margin: 0;
  letter-spacing: 0.3px;
}
.dash-tagline {
  font-size: 0.82rem;
  color: var(--gold-deep);
  font-weight: 700;
  margin: 2px 0 0;
}
.dash-info-box {
  background: var(--cream);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 16px 20px;
  min-width: 240px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.dash-info-box p {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ink);
  line-height: 1.6;
}
.dash-info-label {
  color: var(--ink);
  font-weight: 700;
}

.dash-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 16px;
  margin-bottom: 18px;
  background: #fff;
}
.dash-card-title {
  font-family: 'Palatino Linotype', 'Palatino', Georgia, serif;
  color: var(--maroon);
  font-size: 1.05rem;
  margin: 0 0 14px;
}
.dash-card-title-center { text-align: center; }

.dash-pill-title {
  display: inline-block;
  background: #1B2436;
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.4px;
  padding: 8px 18px;
  border-radius: 30px;
  margin: 0 0 16px;
}

/* 9-pillar performance list */
.pillar-perf-header-row {
  display: grid;
  grid-template-columns: 1.3fr 1.7fr 1fr;
  gap: 10px 14px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.pillar-perf-header-row span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--ink-soft);
  text-transform: uppercase;
}

.pillar-perf-list { display: flex; flex-direction: column; }
.pillar-perf-row {
  display: grid;
  grid-template-columns: 1.3fr 1.7fr 1fr;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.pillar-perf-row:last-child { border-bottom: none; }

.pillar-perf-pillar-col { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pillar-perf-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pillar-perf-name-wrap { display: flex; flex-direction: column; min-width: 0; }
.pillar-perf-name { font-weight: 700; font-size: 0.86rem; color: var(--ink); }
.pillar-perf-meaning { font-style: italic; font-size: 0.72rem; color: var(--ink-soft); margin-top: 1px; }

.pillar-perf-score-col { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pillar-perf-segments { display: flex; gap: 2px; flex: 1; min-width: 0; }
.perf-segment { flex: 1; height: 10px; border-radius: 2px; background: #E2DFD6; }
.pillar-perf-score { font-weight: 700; font-size: 0.9rem; color: var(--ink); white-space: nowrap; }

.pillar-perf-result-col { display: flex; align-items: center; gap: 7px; }
.tier-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.tier-result-text { font-size: 0.68rem; letter-spacing: 0.2px; line-height: 1.35; }
.tier-result-label { font-weight: 700; }
.tier-result-sub { font-style: italic; font-weight: 400; }

/* Leadership index gauge */
.gauge-wrap { max-width: 260px; margin: 0 auto; }
.gauge-value {
  text-align: center;
  font-size: 2.4rem;
  font-weight: 700;
  margin: 6px 0 0;
  line-height: 1;
}
.gauge-value-suffix { font-size: 1.1rem; font-weight: 700; color: var(--ink-soft); }
.gauge-tier-label {
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 4px 0 12px;
}
.gauge-summary {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0;
}

/* Top strengths / priorities */
.dash-two-col {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.dash-two-col .dash-card { flex: 1 1 240px; margin-bottom: 0; }

.rank-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.rank-item:last-child { margin-bottom: 0; }
.rank-number {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rank-name { font-weight: 700; font-size: 0.88rem; color: var(--ink); margin: 0; }
.rank-score { font-weight: 700; color: var(--ink-soft); }
.rank-desc { font-size: 0.8rem; color: var(--ink-soft); margin: 2px 0 0; line-height: 1.4; }

/* Legend bar */
.legend-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
}
.legend-item {
  flex: 1 1 180px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.legend-item .tier-dot { margin-top: 5px; }
.legend-label-row { display: flex; align-items: baseline; gap: 6px; margin: 0 0 3px; flex-wrap: wrap; }
.legend-label { font-weight: 700; font-size: 0.8rem; }
.legend-range { font-size: 0.72rem; color: var(--ink-soft); }
.legend-desc { font-size: 0.76rem; color: var(--ink-soft); margin: 0; line-height: 1.4; }

@media (max-width: 480px) {
  .pillar-perf-header-row,
  .pillar-perf-row { grid-template-columns: 1fr; gap: 4px; }
  .pillar-perf-header-row span:not(:first-child) { display: none; }
  .pillar-perf-row { padding: 12px 0; }
  .pillar-perf-score-col { order: 2; }
  .pillar-perf-result-col { order: 3; }
}

@media (min-width: 700px) {
  .headline { font-size: 1.8rem; }
}

/* ===== Story section: orchestra preamble, deep-dive cards, closing quote, CTA ===== */
.story-section {
  padding: 32px 18px 10px;
}
.story-inner {
  max-width: 100%;
  margin: 0 auto;
}

/* 1. Orchestra preamble — now sits inside .dash-card-outer, right after the legend bar */
.orchestra-preamble {
  max-width: 700px;
  margin: 36px auto 40px;
  text-align: center;
}
.orchestra-quote {
  font-family: 'Palatino Linotype', 'Palatino', Georgia, serif;
  font-style: italic;
  color: var(--gold-deep);
  font-size: 1.15rem;
  line-height: 1.5;
  margin: 0 0 20px;
}
.orchestra-body {
  text-align: left;
  background: var(--cream);
  border-radius: 14px;
  padding: 22px 20px;
}
.orchestra-body p {
  font-size: 0.96rem;
  line-height: 1.65;
  color: var(--ink);
  margin: 0 0 14px;
  text-align: justify;
  text-align-last: left;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.orchestra-body p:last-child { margin-bottom: 0; }

/* 2. Deep-dive pillar cards (dynamic bottom-2) — also inside .dash-card-outer */
.pillar-deepdive-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 700px;
  margin: 0 auto;
}
.pillar-deepdive-card {
  background: var(--cream);
  border: 1px solid var(--gold);
  border-radius: 14px;
  padding: 28px 26px;
}
.deepdive-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.deepdive-icon-badge {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--maroon));
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
}
.deepdive-name {
  font-family: 'Palatino Linotype', 'Palatino', Georgia, serif;
  font-weight: 700;
  color: var(--maroon);
  font-size: 1.3rem;
  margin: 0;
}
.deepdive-subtitle {
  font-family: 'Palatino Linotype', 'Palatino', Georgia, serif;
  font-style: italic;
  font-size: 0.86rem;
  color: var(--ink-soft);
  margin: 6px 0 0;
}
.deepdive-quote-block {
  border-left: 3px solid var(--gold);
  padding: 4px 0 4px 16px;
  margin: 0 0 18px;
}
.deepdive-quote {
  font-family: 'Palatino Linotype', 'Palatino', Georgia, serif;
  font-style: italic;
  color: var(--gold-deep);
  font-size: 0.98rem;
  line-height: 1.5;
  margin: 0;
}
.deepdive-body p {
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 12px;
  text-align: justify;
  text-align-last: left;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.deepdive-body p:last-child { margin-bottom: 0; }
.deepdive-actions-label {
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--maroon);
  margin: 20px 0 12px;
  padding-top: 14px;
  border-top: 2px solid var(--gold);
}
.deepdive-actions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.deepdive-action-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
}
.deepdive-action-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.deepdive-action-row p {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink);
  margin: 2px 0 0;
}

/* 3. Download link */
.download-link-line {
  text-align: center;
  margin: 0 auto 40px;
  max-width: 700px;
}
.download-link-line a {
  color: var(--gold-deep);
  text-decoration: underline;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
}

/* 4. Closing quote */
.closing-quote-block {
  max-width: 700px;
  margin: 0 auto 32px;
  text-align: center;
}
.closing-quote-main {
  font-family: 'Palatino Linotype', 'Palatino', Georgia, serif;
  font-size: 1.25rem;
  line-height: 1.45;
  font-weight: 700;
  margin: 0 0 16px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--maroon) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--maroon);
}
/* html2canvas (used by the PDF download) can't reliably render background-clip:text gradient
   text — it can come out blank. While it's capturing the page for the PDF, script.js briefly
   adds this class to <body> so the closing quote falls back to a solid, still-on-brand color. */
.pdf-capturing .closing-quote-main {
  background: none !important;
  -webkit-text-fill-color: var(--maroon) !important;
  color: var(--maroon) !important;
}

/* The desktop-only "100vw breakout" on .dash-card-outer (see the min-width:1024px rule above)
   uses left:50% / -50vw margins to escape the app-shell's width cap. html2canvas renders the
   page in its own cloned context, where that trick resolves incorrectly and can push the whole
   panel off-canvas — producing a blank PDF. While capturing, force the panel back to normal
   in-flow sizing so html2canvas captures it correctly; !important beats the media query
   regardless of source order or viewport width. */
.pdf-capturing .dash-card-outer {
  width: auto !important;
  position: static !important;
  left: auto !important;
  right: auto !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.closing-quote-sub {
  font-family: 'Palatino Linotype', 'Palatino', Georgia, serif;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}

/* 5. CTA — glowing gradient panel, more prominent button */
.story-cta-wrap {
  max-width: 700px;
  margin: 0 auto;
  background: linear-gradient(135deg, rgba(255,180,79,0.22), rgba(112,0,0,0.12));
  border: 1px solid var(--gold);
  border-radius: 20px;
  padding: 36px 28px;
  box-shadow: 0 12px 34px rgba(112, 0, 0, 0.16);
}
.story-cta {
  text-align: center;
}
.story-cta-text {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 22px;
  line-height: 1.5;
  text-align: justify;
  text-align-last: center;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.btn-cta-book {
  display: inline-block;
  padding: 20px 52px;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--maroon) 100%);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(112, 0, 0, 0.32);
}

/* Tablet (768-1024): single column, base sizes already fit — just tidy spacing */
@media (min-width: 768px) and (max-width: 1023px) {
  .story-section { padding: 40px 24px 10px; }
}

/* Mobile (<768): full-width CTA button, tighter action-list indent */
@media (max-width: 767px) {
  .story-cta .btn-cta-book { display: block; width: 100%; }
  .deepdive-action-row { padding: 10px 12px; }
}

/* Desktop (>=1024): break the WHOLE dashboard panel (header through the deep-dive cards) out
   past the app-shell's 640px cap, so it reads as one continuous wide panel instead of a narrow
   dashboard with a separately-wide story section glued below it. The closing quote/CTA section
   stays at a comfortable reading width — it was already designed for that at any container size. */
@media (min-width: 1024px) {
  .dash-card-outer {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 40px 48px 48px;
  }
  .orchestra-quote { font-size: 1.5rem; }
  .orchestra-body p { font-size: 1.03rem; }
  .pillar-deepdive-list {
    max-width: 1100px;
    flex-direction: row;
    gap: 32px;
  }
  .pillar-deepdive-card { flex: 1; }
  .closing-quote-main { font-size: 1.7rem; }
  .closing-quote-sub { font-size: 1.15rem; }
}
