:root {
  --color-phlegmatic-green: #468254;
  --color-sanguine-mustard: #d6a848;
  --color-choleric-terracotta: #bc5c41;
  --color-melancholic-slate: #3b4a54;
  --color-neutral-beige: #c8b7a6;
  --primary-50: #f1f6f2;
  --primary-100: #daeada;
  --primary-500: #55a05e;
  --primary-600: var(--color-phlegmatic-green);
  --primary-700: #386944;
  --beige-50: #faf9f8;
  --beige-100: #f2efeb;
  --beige-200: var(--color-neutral-beige);
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-500: #64748b;
  --gray-700: #334155;
  --gray-900: #0f172a;
  --danger-700: #b91c1c;
  --amber-50: #fffbeb;
  --amber-700: #b45309;
}

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

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Manrope", sans-serif;
  color: var(--gray-900);
  background: #fff;
  line-height: 1.5;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

.app-container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.narrow {
  width: min(980px, 92vw);
}

.top-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  border-bottom: 1px solid rgb(226 232 240 / 90%);
  background: rgb(255 255 255 / 82%);
  backdrop-filter: blur(10px);
}

.header-stack {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: rgb(255 255 255 / 82%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgb(226 232 240 / 90%);
}

.header-stack .top-nav {
  position: static;
  background: transparent;
  backdrop-filter: none;
  border-bottom: none;
}

.nav-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: #fff;
  background: linear-gradient(160deg, var(--primary-600), var(--primary-700));
  box-shadow: 0 8px 20px rgb(70 130 84 / 28%);
}

.brand-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.01em;
}

.brand-text span {
  color: var(--primary-600);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  color: var(--gray-500);
  text-decoration: none;
  font-size: 0.96rem;
  font-weight: 600;
}

.nav-links a:hover {
  color: var(--primary-600);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.3rem;
  border-radius: 999px;
  border: 0;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  color: #fff;
  background: var(--primary-600);
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.nav-cta:hover {
  background: var(--primary-700);
  transform: translateY(-1px);
}

main {
  overflow: hidden;
}

.hero {
  position: relative;
  padding: 140px 0 96px;
  overflow: hidden;
}

.hero-home {
  background: linear-gradient(160deg, rgb(200 183 166 / 14%) 0%, #ffffff 62%);
  min-height: 88vh;
  display: grid;
  place-items: center;
}

.hero-select {
  background: linear-gradient(160deg, var(--beige-50) 0%, #ffffff 62%);
  min-height: 70vh;
  display: grid;
  place-items: center;
}

.hero-mesh {
  position: absolute;
  inset: -12%;
  pointer-events: none;
}

.mesh-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.2;
  width: min(420px, 42vw);
  aspect-ratio: 1;
}

.orb-phlegmatic {
  background: var(--color-phlegmatic-green);
  left: -110px;
  top: -80px;
}

.orb-sanguine {
  background: var(--color-sanguine-mustard);
  right: -120px;
  top: 18%;
}

.orb-choleric {
  background: var(--color-choleric-terracotta);
  left: 16%;
  bottom: -160px;
}

.orb-melancholic {
  background: var(--color-melancholic-slate);
  right: 14%;
  bottom: -120px;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.hero-content h1 {
  font-size: clamp(2.55rem, 6vw, 4.55rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--gray-900);
}

.hero-content h1 span {
  color: var(--primary-600);
}

.hero-copy {
  margin: 1.25rem auto 0;
  max-width: 700px;
  font-size: clamp(1.05rem, 2vw, 1.24rem);
  color: var(--gray-500);
  line-height: 1.7;
}

.hero-actions {
  margin-top: 2.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.hero-meta {
  margin-top: 1rem;
  color: var(--gray-500);
  font-size: 0.95rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: var(--color-phlegmatic-green);
  color: #fff;
  padding: 1rem 1.7rem;
  box-shadow: 0 10px 22px rgb(70 130 84 / 26%);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-700);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgb(70 130 84 / 32%);
}

.btn-outline {
  background: #fff;
  color: var(--gray-700);
  border-color: var(--gray-200);
  padding: 1rem 1.6rem;
}

.hero-actions .btn-outline {
  background-color: rgb(200 183 166 / 20%);
  border-color: rgb(200 183 166 / 42%);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--primary-500);
  color: var(--primary-600);
  background: var(--primary-50);
  transform: translateY(-1px);
}

.hero-actions .btn-outline:hover:not(:disabled) {
  border-color: var(--color-neutral-beige);
  background: rgb(200 183 166 / 30%);
}

.btn-light {
  background: #fff;
  color: var(--primary-700);
  padding: 1rem 1.7rem;
  box-shadow: 0 12px 24px rgb(2 6 23 / 16%);
}

.btn-light:hover {
  transform: translateY(-2px);
}

.section {
  padding: 90px 0;
}

.section-muted {
  background: var(--gray-50);
}

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 2.9rem;
}

.section-kicker {
  display: inline-block;
  margin-bottom: 0.5rem;
  color: var(--color-choleric-terracotta);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.section-head h2 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.section-head p {
  margin-top: 0.8rem;
  color: var(--gray-500);
  font-size: 1.04rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.35rem;
}

.feature-card {
  border: 1px solid var(--gray-100);
  background: #fff;
  border-radius: 1.1rem;
  padding: 1.7rem;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgb(15 23 42 / 6%);
}

/* Clarity Pass Sections */
.learn-list {
  max-width: 680px;
  margin: 0 auto;
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1rem;
  font-size: 1.1rem;
  color: var(--gray-700);
}

.learn-list li {
  padding: 1rem 1.25rem;
  background: var(--gray-50);
  border-radius: 8px;
  border-left: 4px solid var(--primary-500);
}

.learn-list li strong {
  color: var(--gray-900);
}

.who-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.who-card {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgb(0 0 0 / 4%);
  border: 1px solid var(--gray-100);
  text-align: center;
}

.who-card h3 {
  color: var(--gray-900);
  margin-bottom: 0.75rem;
}

.who-card p {
  color: var(--gray-500);
  font-size: 0.95rem;
}

.how-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
  counter-reset: step-counter;
}

.step-card {
  position: relative;
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--gray-50);
  border-radius: 16px;
  border: 1px solid var(--gray-100);
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--primary-600);
  color: white;
  font-weight: 800;
  border-radius: 50%;
  margin: 0 auto 1.25rem;
  font-size: 1.2rem;
}

.step-card h3 {
  margin-bottom: 0.75rem;
}

.step-card p {
  color: var(--gray-500);
  font-size: 0.95rem;
}

.trust-section {
  background: #fff;
  padding-bottom: 6rem;
}

.trust-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 24px;
  padding: 4rem 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.trust-list {
  text-align: left;
  max-width: 500px;
  margin: 2rem auto;
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.trust-list li {
  position: relative;
  padding-left: 1.75rem;
}

.trust-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--primary-600);
  font-weight: bold;
}

.trust-links {
  margin-top: 2rem;
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.trust-links a {
  color: var(--primary-700);
  text-decoration: underline;
}

.text-center {
  text-align: center;
}

.icon-chip {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--color-melancholic-slate);
  background: rgb(59 74 84 / 12%);
  margin-bottom: 1rem;
}

.card-sanguine .icon-chip {
  background: rgb(214 168 72 / 15%);
}

.card-choleric .icon-chip {
  background: rgb(188 92 65 / 15%);
}

.card-melancholic .icon-chip {
  background: rgb(59 74 84 / 15%);
}

.card-sanguine:hover {
  border-color: var(--color-sanguine-mustard);
}

.card-choleric:hover {
  border-color: var(--color-choleric-terracotta);
}

.card-melancholic:hover {
  border-color: var(--color-melancholic-slate);
}

.feature-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.feature-card p {
  color: var(--gray-500);
  line-height: 1.65;
}

.temp-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.2rem;
}

.temp-card {
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid var(--gray-200);
  background: #fff;
  box-shadow: 0 8px 20px rgb(15 23 42 / 6%);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.temp-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.temp-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 30px rgb(15 23 42 / 11%);
}

.temp-card-link:focus-visible {
  outline: 3px solid rgb(70 130 84 / 38%);
  outline-offset: 2px;
}

.temp-img {
  height: 190px;
  overflow: hidden;
}

.temp-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.temp-card:hover .temp-img img {
  transform: scale(1.05);
}

.temp-body {
  padding: 1.1rem 1rem 1.2rem;
}

.temp-body h3 {
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.temp-sub {
  margin-top: 0.28rem;
  color: var(--primary-600);
  font-size: 0.84rem;
  font-weight: 700;
}

.temp-body p {
  margin-top: 0.7rem;
  color: var(--gray-500);
  font-size: 0.92rem;
  line-height: 1.55;
}

.cta-band {
  background: linear-gradient(145deg, var(--primary-700), var(--primary-600));
  color: #fff;
}

.cta-inner {
  text-align: center;
}

.cta-inner h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: -0.01em;
}

.cta-inner .btn {
  margin-top: 1.8rem;
}

.cta-inner p {
  margin-top: 1rem;
  color: rgb(240 246 241 / 90%);
}

.site-footer {
  border-top: 1px solid var(--gray-100);
  background: #fff;
}

.footer-grid {
  padding: 3rem 0 2rem;
  display: grid;
  gap: 2rem;
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
}

.footer-brand p {
  margin-top: 0.9rem;
  color: var(--gray-500);
  max-width: 420px;
}

.footer-col h3 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-700);
  margin-bottom: 0.75rem;
}

.footer-col a,
.footer-col p {
  display: block;
  color: var(--gray-500);
  text-decoration: none;
  margin-top: 0.55rem;
  line-height: 1.45;
}

.footer-col a:hover {
  color: var(--primary-600);
}

.footer-base {
  border-top: 1px solid var(--gray-100);
  padding: 1.05rem 0;
}

.footer-base p {
  font-size: 0.92rem;
  color: var(--gray-500);
}

.site-selection {
  background: linear-gradient(180deg,
      var(--beige-50) 0%,
      #ffffff 36%,
      var(--gray-50) 100%);
}

.selection-direct {
  padding-top: 132px;
}

.depth-grid {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.depth-card {
  position: relative;
  display: block;
  cursor: pointer;
}

.depth-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.depth-content {
  display: block;
  border-radius: 1rem;
  border: 1px solid var(--gray-200);
  background: #fff;
  padding: 1.35rem;
  min-height: 180px;
  transition: all 0.2s ease;
}

.depth-card:hover .depth-content {
  transform: translateY(-2px);
  border-color: var(--primary-100);
  box-shadow: 0 12px 24px rgb(70 130 84 / 10%);
}

.depth-card input:checked+.depth-content {
  border-color: var(--primary-500);
  background: linear-gradient(160deg, var(--primary-50) 0%, #ffffff 88%);
  box-shadow: 0 18px 30px rgb(70 130 84 / 15%);
}

.depth-card input:focus-visible+.depth-content {
  outline: 3px solid rgb(70 130 84 / 32%);
  outline-offset: 2px;
}

.depth-title {
  display: block;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.depth-sub {
  display: block;
  margin-top: 0.55rem;
  color: var(--gray-500);
  line-height: 1.55;
}

.depth-meta {
  display: inline-flex;
  margin-top: 1rem;
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  background: var(--primary-50);
  color: var(--primary-700);
  font-size: 0.8rem;
  font-weight: 700;
}

.selection-actions {
  margin-top: 1.8rem;
  text-align: center;
}

.btn-start {
  font-size: 1.02rem;
}

.selection-note {
  margin-top: 0.9rem;
  color: var(--gray-500);
  font-size: 0.92rem;
}

.back-home-btn {
  margin-top: 0.6rem;
}

.quiz-stage,
.results-stage {
  padding-top: 2.5rem;
}

.panel-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 1.2rem;
  padding: clamp(1rem, 2.8vw, 2rem);
  box-shadow: 0 20px 40px rgb(15 23 42 / 10%);
}

#assessment-panel .panel-card {
  position: relative;
  overflow: hidden;
  border-color: rgb(200 183 166 / 45%);
  background: linear-gradient(160deg, rgb(200 183 166 / 12%) 0%, #fff 88%);
}

#assessment-panel .panel-card> :not(.assessment-mesh) {
  position: relative;
  z-index: 1;
}

.assessment-mesh {
  position: absolute;
  inset: -14%;
  pointer-events: none;
}

.assessment-orb {
  position: absolute;
  width: min(300px, 34vw);
  aspect-ratio: 1;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.2;
}

.assessment-orb-phlegmatic {
  background: var(--color-phlegmatic-green);
  left: -90px;
  top: -120px;
}

.assessment-orb-sanguine {
  background: var(--color-sanguine-mustard);
  right: -120px;
  top: 10%;
}

.assessment-orb-choleric {
  background: var(--color-choleric-terracotta);
  left: 12%;
  bottom: -170px;
}

.assessment-orb-melancholic {
  background: var(--color-melancholic-slate);
  right: 10%;
  bottom: -155px;
}

.eyebrow {
  margin-bottom: 0.35rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-600);
}

.assessment-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

#assessment-panel .eyebrow {
  color: var(--color-choleric-terracotta);
}

.assessment-header h2,
.result-card h2,
.panel-card h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

#progress-meta {
  color: var(--gray-500);
}

#assessment-panel #progress-meta {
  color: var(--color-melancholic-slate);
}

.progress-track {
  height: 12px;
  margin-top: 1rem;
  border-radius: 999px;
  border: 1px solid var(--primary-100);
  background: var(--primary-50);
  overflow: hidden;
}

#assessment-panel .progress-track {
  border-color: rgb(200 183 166 / 55%);
  background: rgb(200 183 166 / 22%);
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary-600), var(--primary-500));
  transition: width 0.2s ease;
}

#assessment-panel .progress-fill {
  background: linear-gradient(90deg,
      var(--color-phlegmatic-green),
      var(--color-sanguine-mustard));
}

.question-page {
  margin-top: 1.1rem;
  display: grid;
  gap: 0.85rem;
}

.question-card {
  border: 1px solid var(--gray-200);
  border-radius: 0.9rem;
  background: #fff;
  padding: 0.95rem;
}

#assessment-panel .question-card {
  border-color: rgb(200 183 166 / 40%);
  background: rgb(255 252 249 / 92%);
}

.question-top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.question-type {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--primary-600);
  min-width: 0;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

#assessment-panel .question-type {
  color: var(--color-choleric-terracotta);
}

.question-text {
  line-height: 1.55;
}

.slider-box {
  margin-top: 1.2rem;
  display: grid;
  gap: 0.95rem;
  padding: 0 0.35rem;
}

.slider-label-display {
  min-height: 1.5rem;
  font-size: 1.12rem;
  text-align: center;
  font-weight: 800;
  color: var(--primary-700);
}

#assessment-panel .slider-label-display {
  color: var(--color-melancholic-slate);
}

.slider-label-display .prompt {
  font-size: 0.9rem;
  color: var(--gray-500);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

#assessment-panel .slider-label-display .prompt {
  color: var(--color-melancholic-slate);
  opacity: 0.78;
}

.question-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--primary-100);
  background: var(--primary-50);
  outline: none;
  cursor: pointer;
  --thumb-scale: 1;
}

#assessment-panel .question-range {
  border-color: rgb(200 183 166 / 55%);
  background: rgb(200 183 166 / 24%);
}

.question-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 4px solid #fff;
  background: var(--primary-600);
  box-shadow: 0 4px 10px rgb(70 130 84 / 30%);
  transform: scale(var(--thumb-scale));
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#assessment-panel .question-range::-webkit-slider-thumb {
  background: var(--color-phlegmatic-green);
  box-shadow: 0 4px 10px rgb(70 130 84 / 34%);
}

.question-range::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 4px solid #fff;
  background: var(--primary-600);
  box-shadow: 0 4px 10px rgb(70 130 84 / 30%);
  transform: scale(var(--thumb-scale));
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#assessment-panel .question-range::-moz-range-thumb {
  background: var(--color-phlegmatic-green);
  box-shadow: 0 4px 10px rgb(70 130 84 / 34%);
}

.question-range:hover::-webkit-slider-thumb,
.question-range:hover::-moz-range-thumb {
  transform: scale(1.1);
}

.question-range[data-answered="false"]::-webkit-slider-thumb,
.question-range[data-answered="false"]::-moz-range-thumb {
  background: var(--gray-300);
  box-shadow: none;
}

#assessment-panel .question-range[data-answered="false"]::-webkit-slider-thumb,
#assessment-panel .question-range[data-answered="false"]::-moz-range-thumb {
  background: var(--color-neutral-beige);
  box-shadow: none;
}

.slider-extremes {
  display: flex;
  justify-content: space-between;
  color: var(--gray-500);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#assessment-panel .slider-extremes {
  color: var(--color-melancholic-slate);
}

.page-controls {
  margin-top: 1.2rem;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.warning {
  margin-top: 0.9rem;
  color: var(--danger-700);
  font-weight: 700;
}

#assessment-panel .warning {
  color: var(--color-choleric-terracotta);
}

#assessment-panel .page-controls .btn-outline {
  background-color: rgb(200 183 166 / 20%);
  border-color: rgb(200 183 166 / 48%);
}

#assessment-panel .page-controls .btn-outline:hover:not(:disabled) {
  border-color: var(--color-neutral-beige);
  background: rgb(200 183 166 / 30%);
}

.result-short {
  margin-top: 0.95rem;
  color: var(--gray-500);
  line-height: 1.7;
}

.result-confidence {
  margin-top: 0.75rem;
  padding: 0.72rem 0.85rem;
  border-left: 3px solid var(--amber-700);
  border-radius: 0.6rem;
  background: var(--amber-50);
  color: #7c2d12;
  line-height: 1.55;
}

.detail {
  margin-top: 1rem;
  display: grid;
  gap: 0.85rem;
}

.detail article {
  border: 1px solid var(--gray-200);
  border-radius: 0.8rem;
  background: var(--primary-50);
  padding: 0.85rem;
}

.detail article h3 {
  font-size: 1rem;
}

.detail ul {
  margin: 0.6rem 0 0;
  padding-left: 1.05rem;
  line-height: 1.55;
}

.detail p {
  margin: 0.6rem 0 0;
  line-height: 1.6;
}

.disclaimer {
  margin-top: 1rem;
  border-left: 3px solid var(--color-neutral-beige);
  border-radius: 0.6rem;
  padding: 0.8rem 0.9rem;
  background: rgb(200 183 166 / 16%);
  color: var(--color-melancholic-slate);
  line-height: 1.55;
}

.assistant-guide {
  margin-top: 0.2rem;
  border-color: rgb(200 183 166 / 40%);
  background: linear-gradient(160deg, rgb(200 183 166 / 12%) 0%, #fff 88%);
}

.assistant-collapsed {
  display: grid;
  gap: 0.45rem;
}

.assistant-title {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  color: var(--color-melancholic-slate);
}

.assistant-subtitle {
  margin: 0;
  color: var(--gray-500);
  font-size: 0.92rem;
}

.assistant-open-btn {
  justify-self: start;
  padding: 0.78rem 1.25rem;
}

.assistant-expanded {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.85rem;
}

.assistant-header h3 {
  margin: 0;
  font-size: 1.04rem;
  color: var(--color-melancholic-slate);
}

.assistant-header p {
  margin-top: 0.35rem;
  color: var(--gray-500);
  font-size: 0.92rem;
  line-height: 1.55;
}

.assistant-counter {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-phlegmatic-green);
  letter-spacing: 0.02em;
}

.assistant-status,
.assistant-error,
.assistant-limit {
  margin: 0;
  border-radius: 0.75rem;
  border: 1px solid transparent;
  padding: 0.72rem 0.85rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.assistant-status {
  background: var(--primary-50);
  border-color: var(--primary-100);
  color: var(--gray-600);
}

.assistant-status[data-loading="true"]::before {
  content: "";
  display: inline-block;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  margin-right: 0.45rem;
  background: var(--color-phlegmatic-green);
  animation: assistantPulse 1.2s ease-in-out infinite;
  vertical-align: middle;
}

@keyframes assistantPulse {
  0% {
    opacity: 0.32;
    transform: scale(0.82);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0.32;
    transform: scale(0.82);
  }
}

.assistant-error {
  background: rgb(188 92 65 / 12%);
  border-color: rgb(188 92 65 / 25%);
  color: #7f1d1d;
}

.assistant-limit {
  background: rgb(200 183 166 / 16%);
  border-color: rgb(200 183 166 / 45%);
  color: var(--color-melancholic-slate);
}

.assistant-limit p {
  margin: 0;
}

.assistant-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.assistant-mode-btn {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  border-radius: 0.85rem;
  padding: 0.85rem 1rem;
  line-height: 1.25;
  font-size: 0.9rem;
}

.assistant-history {
  display: grid;
  gap: 0.8rem;
}

.assistant-response-card {
  border: 1px solid rgb(200 183 166 / 42%);
  border-radius: 0.9rem;
  background: #fff;
  padding: 0.9rem;
}

.assistant-response-title {
  margin: 0;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-choleric-terracotta);
}

.assistant-response-body {
  margin: 0.55rem 0 0;
  color: var(--gray-600);
  line-height: 1.65;
}

.assistant-suggested-title {
  margin: 0.7rem 0 0;
  color: var(--color-melancholic-slate);
  font-size: 0.86rem;
  font-weight: 700;
}

.assistant-suggested-list {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
  color: var(--gray-600);
  display: grid;
  gap: 0.2rem;
}

.assistant-suggested-list li {
  line-height: 1.5;
}

/* ─── Chat quick-start chips ───────────────────────────────────────────── */

.assistant-chips-label {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
}

.assistant-chip {
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  border-radius: 999px;
  line-height: 1.2;
}

/* ─── Chat window ──────────────────────────────────────────────────────── */

.chat-window {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 360px;
  overflow-y: auto;
  padding: 0.75rem;
  border: 1px solid rgb(200 183 166 / 42%);
  border-radius: 1rem;
  background: rgb(200 183 166 / 8%);
  scroll-behavior: smooth;
}

.chat-window:empty {
  display: none;
}

/* ─── Chat bubbles ─────────────────────────────────────────────────────── */

.chat-bubble {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 82%;
  animation: bubbleFadeIn 0.2s ease;
}

@keyframes bubbleFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-bubble--user {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-bubble--ai {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-bubble__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gray-400);
}

.chat-bubble__text {
  margin: 0;
  padding: 0.6rem 0.9rem;
  border-radius: 1rem;
  line-height: 1.55;
  font-size: 0.93rem;
  word-break: break-word;
}

.chat-bubble--user .chat-bubble__text {
  background: var(--color-phlegmatic-green);
  color: #fff;
  border-bottom-right-radius: 0.25rem;
}

.chat-bubble--ai .chat-bubble__text {
  background: #fff;
  border: 1px solid rgb(200 183 166 / 45%);
  color: var(--gray-700);
  border-bottom-left-radius: 0.25rem;
}

/* ─── Chat input row ───────────────────────────────────────────────────── */

.chat-input-row {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  min-height: 2.8rem;
  max-height: 8rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--gray-200);
  border-radius: 0.85rem;
  font-family: inherit;
  font-size: 0.93rem;
  line-height: 1.5;
  resize: none;
  background: #fff;
  color: var(--gray-800);
  transition: border-color 0.2s;
  overflow-y: auto;
}

.chat-input:focus {
  outline: none;
  border-color: var(--color-phlegmatic-green);
  box-shadow: 0 0 0 3px rgb(70 130 84 / 14%);
}

.chat-input:disabled {
  background: var(--gray-50);
  color: var(--gray-400);
  cursor: not-allowed;
}

.chat-send-btn {
  flex-shrink: 0;
  padding: 0.65rem 1.2rem;
  border-radius: 0.85rem;
}

.result-restart {
  margin-top: 1rem;
}

.result-container {
  width: min(1120px, 92vw);
  margin: 0 auto;
  display: grid;
  gap: 1.2rem;
}

.result-container .eyebrow {
  color: var(--color-choleric-terracotta);
}

.result-hero-card {
  text-align: center;
  background: linear-gradient(160deg, rgb(200 183 166 / 16%) 0%, #ffffff 78%);
  border-color: rgb(200 183 166 / 40%);
  overflow: hidden;
  position: relative;
}

.result-hero-mesh {
  position: absolute;
  inset: -14%;
  pointer-events: none;
}

.result-mesh-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(74px);
  opacity: 0.22;
  width: min(350px, 38vw);
  aspect-ratio: 1;
}

.result-orb-phlegmatic {
  background: var(--color-phlegmatic-green);
  left: -90px;
  top: -90px;
}

.result-orb-sanguine {
  background: var(--color-sanguine-mustard);
  right: -90px;
  top: 6%;
}

.result-orb-choleric {
  background: var(--color-choleric-terracotta);
  left: 16%;
  bottom: -170px;
}

.result-orb-melancholic {
  background: var(--color-melancholic-slate);
  right: 12%;
  bottom: -150px;
}

.result-hero-card::before {
  display: none;
}

.result-hero-card::after {
  display: none;
}

.result-hero-card> :not(.result-hero-mesh) {
  position: relative;
  z-index: 1;
}

.result-pill {
  display: inline-flex;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgb(188 92 65 / 35%);
  color: var(--color-choleric-terracotta);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-name {
  margin-top: 0.95rem;
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 0.96;
  letter-spacing: -0.02em;
  color: var(--color-melancholic-slate);
}

.result-tagline {
  margin-top: 0.5rem;
  font-size: 1rem;
  color: var(--gray-700);
  font-style: italic;
}

.result-hero-card .result-short {
  margin: 0.9rem auto 0;
  max-width: 680px;
}

.result-confidence-pill {
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgb(70 130 84 / 32%);
  background: #fff;
  color: var(--color-phlegmatic-green);
  font-weight: 700;
  font-size: 0.86rem;
}

.confidence-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--color-sanguine-mustard);
}

.result-profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.2rem;
  align-items: start;
}

.profile-main-card {
  padding: 0;
  overflow: hidden;
}

.profile-image-wrap {
  position: relative;
  height: 290px;
  overflow: hidden;
}

.profile-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-image-overlay {
  position: absolute;
  inset: 0;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(to top, rgb(15 23 42 / 72%) 0%, transparent 62%);
}

.profile-image-overlay h3 {
  color: #fff;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  letter-spacing: -0.01em;
}

.profile-image-overlay p {
  margin-top: 0.35rem;
  color: rgb(241 245 249 / 88%);
  line-height: 1.55;
}

.profile-columns {
  padding: 1.35rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
}

.result-list-col h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-choleric-terracotta);
  margin-bottom: 0.6rem;
}

.result-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
}

.result-list li {
  color: var(--gray-500);
  line-height: 1.5;
  display: grid;
  grid-template-columns: 9px 1fr;
  gap: 0.5rem;
}

.result-list li::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: 0.46rem;
  border-radius: 999px;
  background: var(--color-phlegmatic-green);
}

.growth-note {
  margin: 0 1.35rem 1.3rem;
  border-left: 3px solid var(--color-choleric-terracotta);
  border-radius: 0 0.6rem 0.6rem 0;
  background: rgb(200 183 166 / 16%);
  padding: 0.75rem 0.9rem;
}

.growth-note h4 {
  font-size: 0.9rem;
  color: var(--color-melancholic-slate);
}

.growth-note p {
  margin-top: 0.45rem;
  color: var(--gray-500);
  line-height: 1.6;
  font-style: italic;
}

.profile-main-card .detail {
  margin: 0 1.35rem 1.35rem;
}

.profile-main-card .detail article {
  background: rgb(200 183 166 / 16%);
  border-color: rgb(200 183 166 / 42%);
}

.result-sidebar {
  display: grid;
  gap: 1rem;
}

.mix-card h3 {
  font-size: 1.06rem;
  margin-bottom: 0.8rem;
}

.mix-donut {
  width: 176px;
  height: 176px;
  margin: 0 auto;
  position: relative;
}

.mix-donut canvas {
  width: 100%;
  height: 100%;
}

.mix-donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
}

.mix-donut-center span {
  font-size: 1.28rem;
  color: var(--color-melancholic-slate);
  font-weight: 800;
}

.mix-donut-center small {
  color: var(--gray-500);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mix-legend {
  margin-top: 0.95rem;
  display: grid;
  gap: 0.5rem;
}

.mix-legend-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.mix-legend-name {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--gray-500);
  font-size: 0.88rem;
}

.mix-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.mix-legend-val {
  font-size: 0.9rem;
  font-weight: 700;
}

.secondary-card {
  border-radius: 1rem;
  padding: 1.2rem 1.1rem;
  color: #fff;
  background: linear-gradient(145deg,
      var(--color-melancholic-slate),
      var(--color-phlegmatic-green));
}

.secondary-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgb(214 168 72 / 84%);
}

.secondary-card h3 {
  margin-top: 0.3rem;
  font-size: 1.55rem;
}

.secondary-card p {
  margin-top: 0.6rem;
  color: rgb(240 246 241 / 88%);
  line-height: 1.55;
  font-size: 0.9rem;
}

.secondary-traits {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgb(255 255 255 / 20%);
  font-weight: 700;
}

.result-actions {
  display: grid;
  gap: 0.55rem;
}

.result-actions .btn {
  width: 100%;
}

.score-breakdown-card h3,
.comms-card h3,
.confidence-card h3 {
  margin-top: 0.2rem;
  font-size: clamp(1.35rem, 2.3vw, 1.7rem);
  letter-spacing: -0.01em;
}

.score-grid {
  margin-top: 1.1rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.95rem;
}

.score-col {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
}

.score-track {
  width: 100%;
  height: 190px;
  border-radius: 0.8rem;
  background: var(--gray-100);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.score-fill {
  width: 100%;
  height: 0%;
  border-radius: 0.8rem;
  transition: height 1.2s cubic-bezier(0.22, 0.68, 0, 1.1);
}

.score-col[data-temp="Sanguine"] .score-fill {
  background: linear-gradient(180deg, #e4bc66, var(--color-sanguine-mustard));
}

.score-col[data-temp="Choleric"] .score-fill {
  background: linear-gradient(180deg,
      #cf7a60,
      var(--color-choleric-terracotta));
}

.score-col[data-temp="Melancholic"] .score-fill {
  background: linear-gradient(180deg, #55646e, var(--color-melancholic-slate));
}

.score-col[data-temp="Phlegmatic"] .score-fill {
  background: linear-gradient(180deg, #69a272, var(--color-phlegmatic-green));
}

.score-percent {
  font-weight: 800;
  color: var(--gray-900);
}

.score-name {
  color: var(--gray-500);
  font-size: 0.85rem;
  font-weight: 600;
}

.comms-grid {
  margin-top: 1.1rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.comms-grid article {
  border: 1px solid var(--gray-200);
  border-radius: 0.9rem;
  padding: 1rem 0.95rem;
  background: #fff;
}

.comms-grid h4 {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-choleric-terracotta);
}

.comms-grid p {
  margin-top: 0.55rem;
  color: var(--gray-500);
  line-height: 1.6;
}

.confidence-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 1rem;
  align-items: center;
  background: linear-gradient(160deg, rgb(200 183 166 / 16%) 0%, #fff 85%);
  border-color: rgb(200 183 166 / 40%);
}

.confidence-copy p {
  margin-top: 0.55rem;
  color: var(--gray-500);
  line-height: 1.7;
}

.confidence-meter {
  display: grid;
  justify-items: center;
  gap: 0.55rem;
}

.confidence-ring {
  --confidence-fill: 50;
  width: 104px;
  height: 104px;
  border-radius: 999px;
  background: conic-gradient(var(--color-phlegmatic-green) calc(var(--confidence-fill) * 1%),
      rgb(200 183 166 / 44%) 0);
  display: grid;
  place-items: center;
  position: relative;
}

.confidence-ring::before {
  content: "";
  width: 78px;
  height: 78px;
  border-radius: 999px;
  background: #fff;
  position: absolute;
}

.confidence-ring span {
  position: relative;
  z-index: 1;
  font-weight: 800;
  color: var(--color-melancholic-slate);
}

.confidence-label {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-melancholic-slate);
  font-weight: 700;
}

@media (max-width: 1100px) {
  .temp-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 860px) {
  .nav-links {
    display: none;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .depth-grid {
    grid-template-columns: 1fr;
  }

  .result-profile-grid {
    grid-template-columns: 1fr;
  }

  .result-sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .result-actions {
    grid-column: 1 / -1;
  }

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

  .confidence-card {
    grid-template-columns: 1fr;
  }

  .assessment-header {
    flex-direction: column;
    gap: 0.45rem;
  }
}

@media (max-width: 700px) {

  .app-container,
  .narrow {
    width: 94vw;
  }

  .nav-inner {
    min-height: 66px;
  }

  .brand-text {
    font-size: 1rem;
  }

  .nav-cta {
    padding: 0.56rem 0.9rem;
    font-size: 0.82rem;
  }

  .hero {
    padding: 120px 0 70px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .section {
    padding: 70px 0;
  }

  .temp-grid {
    grid-template-columns: 1fr;
  }

  .result-sidebar,
  .comms-grid,
  .profile-columns {
    grid-template-columns: 1fr;
  }

  .assistant-mode-grid {
    grid-template-columns: 1fr;
  }

  .assistant-open-btn {
    width: 100%;
  }

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

  .score-track {
    height: 160px;
  }

  .score-percent {
    font-size: 0.78rem;
    line-height: 1;
  }

  .page-controls {
    flex-direction: column;
  }

  .page-controls .btn {
    width: 100%;
  }
}

/* Temperaments Detail Page - New Tabs Bar */
.tabs-bar {
  padding: 0.5rem 0;
}

.tabs-nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.tab-btn {
  border: none;
  background: transparent;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--gray-500);
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--gray-900);
  background: var(--gray-50);
}

.tab-btn.active {
  background: var(--primary-600);
  color: #fff;
  box-shadow: 0 4px 12px rgba(70, 130, 84, 0.25);
}

@media (max-width: 768px) {
  .tabs-bar .app-container {
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .tabs-nav {
    justify-content: flex-start;
    width: max-content;
    padding: 0 4px;
  }
}

.temp-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
  min-height: 500px;
}

.temp-detail-card {
  display: none;
  padding: 2.5rem;
  animation: fadeIn 0.4s ease-out forwards;
}

.temp-detail-card.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.temp-detail-header {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-100);
  padding-bottom: 1.5rem;
}

.temp-detail-header h2 {
  margin-top: 1rem;
}

.temp-detail-body>p {
  font-size: 1.15rem;
  color: var(--gray-700);
  line-height: 1.7;
  margin-bottom: 2rem;
}

#sanguine .temp-detail-body.sanguine-longform {
  color: var(--gray-700);
  line-height: 1.7;
}

#sanguine .sanguine-longform-title {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--gray-900);
}

#sanguine .sanguine-section {
  margin-top: 1.85rem;
}

#sanguine .sanguine-section h3 {
  font-size: 1.2rem;
  line-height: 1.35;
  color: var(--gray-900);
}

#sanguine .sanguine-section p {
  margin-top: 0.8rem;
}

#sanguine .sanguine-section ul {
  margin: 0.85rem 0 0;
  padding-left: 1.25rem;
}

#sanguine .sanguine-section li {
  margin-bottom: 0.55rem;
}

#sanguine .sanguine-section li:last-child {
  margin-bottom: 0;
}

#sanguine .sanguine-section strong {
  color: var(--gray-900);
}

#choleric .temp-detail-body.choleric-longform {
  color: var(--gray-700);
  line-height: 1.7;
}

#choleric .choleric-longform-title {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--gray-900);
}

#choleric .choleric-section {
  margin-top: 1.85rem;
}

#choleric .choleric-section h3 {
  font-size: 1.2rem;
  line-height: 1.35;
  color: var(--gray-900);
}

#choleric .choleric-section p {
  margin-top: 0.8rem;
}

#choleric .choleric-section ul {
  margin: 0.85rem 0 0;
  padding-left: 1.25rem;
}

#choleric .choleric-section li {
  margin-bottom: 0.55rem;
}

#choleric .choleric-section li:last-child {
  margin-bottom: 0;
}

#choleric .choleric-section strong {
  color: var(--gray-900);
}

#melancholic .temp-detail-body.melancholic-longform {
  color: var(--gray-700);
  line-height: 1.7;
}

#melancholic .melancholic-longform-title {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--gray-900);
}

#melancholic .melancholic-section {
  margin-top: 1.85rem;
}

#melancholic .melancholic-section h3 {
  font-size: 1.2rem;
  line-height: 1.35;
  color: var(--gray-900);
}

#melancholic .melancholic-section p {
  margin-top: 0.8rem;
}

#melancholic .melancholic-section ul {
  margin: 0.85rem 0 0;
  padding-left: 1.25rem;
}

#melancholic .melancholic-section li {
  margin-bottom: 0.55rem;
}

#melancholic .melancholic-section li:last-child {
  margin-bottom: 0;
}

#melancholic .melancholic-section strong {
  color: var(--gray-900);
}

#phlegmatic .temp-detail-body.phlegmatic-longform {
  color: var(--gray-700);
  line-height: 1.7;
}

#phlegmatic .phlegmatic-longform-title {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--gray-900);
}

#phlegmatic .phlegmatic-section {
  margin-top: 1.85rem;
}

#phlegmatic .phlegmatic-section h3 {
  font-size: 1.2rem;
  line-height: 1.35;
  color: var(--gray-900);
}

#phlegmatic .phlegmatic-section p {
  margin-top: 0.8rem;
}

#phlegmatic .phlegmatic-section ul {
  margin: 0.85rem 0 0;
  padding-left: 1.25rem;
}

#phlegmatic .phlegmatic-section li {
  margin-bottom: 0.55rem;
}

#phlegmatic .phlegmatic-section li:last-child {
  margin-bottom: 0;
}

#phlegmatic .phlegmatic-section strong {
  color: var(--gray-900);
}

.detail-columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.detail-col h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--gray-900);
}

.detail-col ul {
  padding-left: 1.25rem;
  margin: 0;
}

.detail-col li {
  margin-bottom: 0.5rem;
  color: var(--gray-600);
}

.detail-meta-box {
  background: var(--gray-50);
  border-radius: 0.8rem;
  padding: 1.5rem;
  border-left: 4px solid var(--primary-500);
}

.card-sanguine .detail-meta-box {
  border-left-color: var(--color-sanguine-mustard);
}

.card-choleric .detail-meta-box {
  border-left-color: var(--color-choleric-terracotta);
}

.card-melancholic .detail-meta-box {
  border-left-color: var(--color-melancholic-slate);
}

.card-phlegmatic .detail-meta-box {
  border-left-color: var(--color-phlegmatic-green);
}

.detail-meta-box h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-700);
}

.temp-actions {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 4rem;
}

@media (max-width: 768px) {
  .detail-columns {
    grid-template-columns: 1fr;
  }

  .tabs-nav {
    padding: 0.3rem;
    gap: 0.2rem;
    max-width: 100%;
    overflow-x: auto;
    border-radius: 1rem;
  }

  .tab-btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  #sanguine .sanguine-longform-title {
    font-size: 1.35rem;
  }

  #sanguine .sanguine-section {
    margin-top: 1.45rem;
  }

  #sanguine .sanguine-section h3 {
    font-size: 1.07rem;
  }

  #choleric .choleric-longform-title {
    font-size: 1.35rem;
  }

  #choleric .choleric-section {
    margin-top: 1.45rem;
  }

  #choleric .choleric-section h3 {
    font-size: 1.07rem;
  }

  #melancholic .melancholic-longform-title {
    font-size: 1.35rem;
  }

  #melancholic .melancholic-section {
    margin-top: 1.45rem;
  }

  #melancholic .melancholic-section h3 {
    font-size: 1.07rem;
  }

  #phlegmatic .phlegmatic-longform-title {
    font-size: 1.35rem;
  }

  #phlegmatic .phlegmatic-section {
    margin-top: 1.45rem;
  }

  #phlegmatic .phlegmatic-section h3 {
    font-size: 1.07rem;
  }
}

/* Temperaments Page Layout Adjustment */
.site-temperaments main {
  padding-top: 132px;
  /* Navbar (72px) + TabsBar (~50px) + Buffer */
}

@media (max-width: 768px) {
  .site-temperaments main {
    padding-top: 110px;
  }
}

/* ─── Floating Chat FAB & Modal ────────────────────────────────────────── */

.chat-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1010;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.35rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(145deg, var(--color-phlegmatic-green), #3d7a4c);
  color: #fff;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow:
    0 6px 24px rgba(70, 130, 84, 0.35),
    0 2px 8px rgba(0, 0, 0, 0.12);
  transition:
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.25s ease,
    opacity 0.3s ease;
  animation: fabSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.chat-fab.hidden {
  display: none;
}

.chat-fab:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow:
    0 10px 32px rgba(70, 130, 84, 0.45),
    0 4px 12px rgba(0, 0, 0, 0.14);
}

.chat-fab:active {
  transform: translateY(-1px) scale(0.98);
}

.chat-fab svg {
  flex-shrink: 0;
}

.chat-fab-icon.hidden {
  display: none;
}

.chat-fab-label {
  line-height: 1;
}

/* When modal is open, collapse FAB label on desktop */
.chat-fab.chat-fab--open .chat-fab-label {
  display: none;
}

.chat-fab.chat-fab--open {
  padding: 0.85rem;
}

@keyframes fabSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.85);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ─── Chat Modal ───────────────────────────────────────────────────────── */

.chat-modal {
  position: fixed;
  bottom: 5.5rem;
  right: 2rem;
  z-index: 1000;
  width: 400px;
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  border-radius: 1.15rem;
  background: #fff;
  border: 1px solid rgb(200 183 166 / 40%);
  box-shadow:
    0 12px 48px rgba(0, 0, 0, 0.15),
    0 4px 16px rgba(0, 0, 0, 0.08);
  animation: chatModalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  overflow: hidden;
}

.chat-modal.hidden {
  display: none;
}

@keyframes chatModalSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chat-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid rgb(200 183 166 / 30%);
  background: linear-gradient(160deg, rgb(200 183 166 / 12%) 0%, #fff 88%);
  flex-shrink: 0;
}

.chat-modal-title {
  margin: 0;
  font-size: 1.06rem;
  color: var(--color-melancholic-slate);
  font-weight: 700;
}

.chat-modal-subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--gray-400);
}

.chat-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--gray-400);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}

.chat-modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}

.chat-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.9rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
}

/* Override chat-window in modal context for better sizing */
.chat-modal-body .chat-window {
  max-height: none;
  flex: 1;
  min-height: 120px;
}

/* Empty chat — still show area with min-height */
.chat-modal-body .chat-window:empty {
  display: flex;
  min-height: 80px;
  align-items: center;
  justify-content: center;
  color: var(--gray-300);
  font-size: 0.88rem;
}

.chat-modal-body .chat-window:empty::before {
  content: "Your conversation will appear here…";
}

.chat-modal-body .assistant-mode-grid {
  grid-template-columns: 1fr 1fr;
}

.chat-modal-footer {
  padding: 0.75rem 1.15rem;
  border-top: 1px solid rgb(200 183 166 / 30%);
  background: var(--gray-50);
  flex-shrink: 0;
}

/* ─── Chat FAB & Modal Responsive ──────────────────────────────────────── */

@media (max-width: 600px) {
  .chat-fab {
    bottom: 1.25rem;
    right: 1.25rem;
    padding: 0.75rem 1.1rem;
    font-size: 0.84rem;
  }

  .chat-fab.chat-fab--open {
    padding: 0.75rem;
  }

  .chat-modal {
    bottom: 4.5rem;
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    max-height: 80vh;
  }
}