:root {
  --font-title: "IBM Plex Sans Arabic", "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  --font-body: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;

  /* Luxury Deep Emerald & Royal Gold — Day Mode */
  --bg: #F6F3EA;
  --bg-accent: radial-gradient(circle at 12% 8%, rgba(212, 175, 55, 0.13), transparent 36%),
               radial-gradient(circle at 88% 18%, rgba(8, 61, 47, 0.08), transparent 40%);
  --surface: #FFFDF8;
  --surface-elevated: #FFFFFF;
  --surface-alt: #F0ECE0;
  --surface-glass: rgba(255, 253, 248, 0.88);
  --ink: #0B261E;
  --ink-soft: #365047;
  --ink-muted: #5F776F;
  --border: rgba(197, 155, 39, 0.24);
  --border-strong: rgba(197, 155, 39, 0.45);

  --emerald: #083D2F;
  --emerald-mid: #0E5744;
  --emerald-light: #167259;
  --emerald-deep: #042119;
  --gold: #C89B2B;
  --gold-ink: #8A6410;
  --gold-bright: #E5C158;
  --gold-pale: #F6E6B4;
  --gold-soft: rgba(200, 155, 43, 0.14);

  /* Official 16Personalities Role Accents (refined to harmonize with Emerald & Gold) */
  --analysts: #7E5693;
  --analysts-soft: rgba(126, 86, 147, 0.11);
  --analysts-dark: #58386A;

  --diplomats: #17785B;
  --diplomats-soft: rgba(23, 120, 91, 0.11);
  --diplomats-dark: #0D4F3B;

  --sentinels: #2D7C99;
  --sentinels-soft: rgba(45, 124, 153, 0.11);
  --sentinels-dark: #1D556B;

  --explorers: #C89B2B;
  --explorers-soft: rgba(200, 155, 43, 0.14);
  --explorers-dark: #8C6814;

  --agree: #0E6B50;
  --disagree: #8C4A6E;
  --neutral: #94A39D;

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --shadow-sm: 0 4px 14px rgba(6, 36, 27, 0.06);
  --shadow-md: 0 14px 36px rgba(6, 36, 27, 0.10);
  --shadow-lg: 0 24px 60px rgba(4, 24, 18, 0.18);
  --shadow-gold: 0 10px 28px rgba(200, 155, 43, 0.28);
}

/* ==================== LUXURY NIGHT MODE ==================== */
[data-theme="dark"] {
  --bg: #04130F;
  --bg-accent: radial-gradient(circle at 15% 10%, rgba(229, 193, 88, 0.10), transparent 36%),
               radial-gradient(circle at 85% 22%, rgba(20, 114, 89, 0.18), transparent 42%);
  --surface: #082019;
  --surface-elevated: #0C2A21;
  --surface-alt: #0E3127;
  --surface-glass: rgba(6, 26, 20, 0.88);
  --ink: #F7F1E1;
  --ink-soft: #C6D4CD;
  --ink-muted: #8FA79E;
  --border: rgba(229, 193, 88, 0.22);
  --border-strong: rgba(229, 193, 88, 0.5);

  --gold: #E5C158;
  --gold-ink: #F2D275;
  --gold-bright: #F4DC8B;
  --gold-soft: rgba(229, 193, 88, 0.14);

  --analysts-soft: rgba(168, 126, 191, 0.16);
  --analysts-dark: #D9B7EB;
  --diplomats-soft: rgba(45, 179, 134, 0.16);
  --diplomats-dark: #7EE2BE;
  --sentinels-soft: rgba(74, 176, 212, 0.16);
  --sentinels-dark: #8DD7F0;
  --explorers-soft: rgba(229, 193, 88, 0.16);
  --explorers-dark: #F4DC8B;

  --agree: #24B485;
  --disagree: #C982A8;
  --neutral: #6C857D;

  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.32);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 28px 68px rgba(0, 0, 0, 0.6);
  --shadow-gold: 0 10px 30px rgba(229, 193, 88, 0.22);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 17.5px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  background-image: var(--bg-accent);
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.88;
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  transition: background-color 0.35s ease, color 0.35s ease;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4,
.brand-text strong,
.stat-item strong,
.step-num,
.profile-code-display {
  font-family: var(--font-title);
}

a { color: inherit; text-decoration: none; }
button, input, select { font-family: inherit; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2.5px solid var(--gold);
  outline-offset: 2px;
}
button:disabled { opacity: 0.55; cursor: not-allowed; }

.nav-menu-btn {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.mobile-nav-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 22px;
}

/* ==================== ROYAL NAVBAR ==================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 120;
  background: var(--surface-glass);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(4, 24, 18, 0.05);
}

.navbar .container {
  max-width: 1280px;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 78px;
  height: auto;
  padding: 9px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 15px;
  padding: 2px;
  background: linear-gradient(135deg, var(--emerald-deep), var(--emerald-mid));
  border: 1.5px solid var(--gold);
  display: grid;
  place-items: center;
  color: var(--gold-bright);
  font-weight: 900;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(8, 61, 47, 0.34), inset 0 1px 0 rgba(246, 230, 180, 0.35);
}

.brand-text strong {
  display: block;
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.15;
}

.brand-text span {
  display: block;
  font-size: 12.5px;
  line-height: 1.2;
  color: var(--gold);
  letter-spacing: 0.2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
}

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.22s ease;
}

.nav-btn:hover {
  background: var(--gold-soft);
  color: var(--ink);
  border-color: var(--border);
}

.nav-btn.active {
  background: linear-gradient(135deg, rgba(8, 61, 47, 0.12), rgba(200, 155, 43, 0.16));
  color: var(--ink);
  border-color: var(--border-strong);
  font-weight: 700;
}

.nav-cta {
  background: linear-gradient(135deg, var(--gold), #A97E18) !important;
  color: #062119 !important;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid rgba(255, 245, 210, 0.45) !important;
  box-shadow: var(--shadow-gold);
}

.nav-cta:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.zoom-controls {
  display: inline-flex;
  align-items: center;
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
  white-space: nowrap;
}

.zoom-btn {
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 800;
  padding: 5px 8px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.18s ease;
  direction: ltr;
}

.zoom-btn:hover {
  background: var(--gold-soft);
  color: var(--gold-ink);
}

.zoom-btn.zoom-val {
  color: var(--gold-ink);
  min-width: 44px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.25;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.22s ease;
}

.theme-toggle:hover {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-primary {
  background: linear-gradient(135deg, #E5C158 0%, #C89B2B 55%, #A97D16 100%);
  color: #051F17;
  border-color: rgba(255, 245, 210, 0.5);
  box-shadow: var(--shadow-gold);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(200, 155, 43, 0.42);
  filter: brightness(1.05);
}

.btn-emerald {
  background: linear-gradient(135deg, var(--emerald-mid), var(--emerald-deep));
  color: var(--gold-pale);
  border-color: var(--border-strong);
  box-shadow: 0 10px 26px rgba(4, 33, 25, 0.32);
}

.btn-emerald:hover {
  transform: translateY(-2px);
  border-color: var(--gold-bright);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--gold);
  background: var(--surface-alt);
  transform: translateY(-1px);
}

.btn-lg {
  padding: 15px 34px;
  font-size: 1.05rem;
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none !important;
}

/* ==================== VIEWS ==================== */
.view {
  display: none;
  padding: 36px 0 84px;
  animation: fadeUp 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.view.active {
  display: block;
}

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

/* ==================== ROYAL HERO ==================== */
.hero {
  position: relative;
  background: linear-gradient(135deg, #031B14 0%, #083D2F 50%, #0D5340 100%);
  color: #FAF6EB;
  border-radius: var(--radius-lg);
  padding: 58px 46px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1.5px solid rgba(229, 193, 88, 0.35);
  margin-bottom: 40px;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 36px;
  align-items: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 80% 20%, rgba(229, 193, 88, 0.22), transparent 42%),
    radial-gradient(circle at 10% 88%, rgba(22, 114, 89, 0.35), transparent 45%),
    repeating-linear-gradient(45deg, rgba(229, 193, 88, 0.03) 0px, rgba(229, 193, 88, 0.03) 1px, transparent 1px, transparent 22px);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(229, 193, 88, 0.14);
  border: 1px solid rgba(229, 193, 88, 0.45);
  color: #F4DC8B;
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(1.95rem, 3.6vw, 2.85rem);
  font-weight: 900;
  line-height: 1.42;
  padding: 4px 0;
  margin-bottom: 16px;
  background: linear-gradient(180deg, #FFFFFF 20%, #F4DC8B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.06rem;
  color: rgba(247, 241, 225, 0.88);
  margin-bottom: 28px;
  max-width: 610px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero-actions-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  margin-top: 2px;
}

.hero .btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #FAF6EB;
  border-color: rgba(229, 193, 88, 0.42);
}

.hero .btn-secondary:hover {
  background: rgba(229, 193, 88, 0.18);
  border-color: #F4DC8B;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid rgba(229, 193, 88, 0.22);
}

.stat-item strong {
  display: block;
  font-size: 1.42rem;
  font-weight: 900;
  color: #F4DC8B;
}

.stat-item span {
  font-size: 0.85rem;
  color: rgba(247, 241, 225, 0.78);
}

.hero-showcase {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.hero-avatar-tile {
  background: rgba(255, 253, 248, 0.08);
  border: 1px solid rgba(229, 193, 88, 0.3);
  border-radius: 20px;
  padding: 16px 12px 12px;
  text-align: center;
  font: inherit;
  color: inherit;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: transform 0.28s ease, border-color 0.28s ease, background-color 0.22s ease;
}

.hero-avatar-tile:hover {
  transform: translateY(-5px);
  border-color: #F4DC8B;
  background: rgba(255, 253, 248, 0.14);
}

.hero-avatar-tile img {
  width: 86px;
  height: 86px;
  object-fit: contain;
  display: block;
  margin: 0 auto 6px;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.35));
}

.hero-avatar-tile span {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #F4DC8B;
}

/* ==================== 3 STEP CARDS ==================== */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-bottom: 48px;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.step-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
}

.step-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--emerald-mid), var(--gold));
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-weight: 900;
  font-size: 1.05rem;
  margin-bottom: 14px;
  background: linear-gradient(135deg, var(--emerald), var(--emerald-deep));
  color: var(--gold-bright);
  border: 1px solid var(--gold);
}

.step-card h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.step-card p {
  font-size: 0.94rem;
  color: var(--ink-soft);
}

/* ==================== GROUPS PREVIEW ==================== */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.section-head h2 {
  font-size: 1.7rem;
  font-weight: 900;
}

.section-head p {
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.groups-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.group-preview-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 26px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.group-preview-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold);
}

.group-preview-bar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
}

.group-preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.group-preview-top h3 {
  font-size: 1.28rem;
  font-weight: 900;
}

.group-pill {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
}

.group-codes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.code-chip {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 10px;
  background: var(--surface-alt);
  color: var(--ink);
  direction: ltr;
}

/* ==================== PRE-TEST ONBOARDING ==================== */
.onboarding-card {
  max-width: 760px;
  margin: 0 auto;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 42px 38px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.onboarding-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--emerald-deep), var(--gold), var(--emerald-mid));
}

.onboarding-header {
  text-align: center;
  margin-bottom: 30px;
}

.onboarding-header .hero-badge {
  background: var(--gold-soft);
  color: var(--gold);
  border-color: var(--border-strong);
  margin-bottom: 12px;
}

.onboarding-header h2 {
  font-size: 1.7rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.onboarding-header p {
  color: var(--ink-soft);
  font-size: 0.96rem;
}

.onboard-group {
  margin-bottom: 26px;
}

.onboard-label {
  display: block;
  font-size: 1.02rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--ink);
}

.choice-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.choice-card {
  background: var(--surface-alt);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.22s ease;
  text-align: right;
  color: var(--ink);
}

.choice-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.choice-card.selected {
  background: linear-gradient(135deg, rgba(8, 61, 47, 0.14), rgba(200, 155, 43, 0.18));
  border-color: var(--gold);
  box-shadow: 0 8px 22px rgba(200, 155, 43, 0.2);
}

.choice-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--emerald), var(--emerald-deep));
  color: var(--gold-bright);
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  border: 1px solid rgba(229, 193, 88, 0.45);
}

.choice-card strong {
  display: block;
  font-size: 1.04rem;
  font-weight: 800;
}

.choice-card span {
  display: block;
  font-size: 0.84rem;
  color: var(--ink-soft);
}

.royal-input {
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-alt);
  color: var(--ink);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.royal-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-soft);
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-choice {
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip-choice:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}

.chip-choice.selected {
  background: linear-gradient(135deg, var(--emerald), var(--emerald-deep));
  color: #F6E6B4;
  border-color: var(--gold);
  box-shadow: 0 6px 16px rgba(8, 61, 47, 0.25);
}

.playbook-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 14px 0 22px;
}

.playbook-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  border-radius: 14px;
  padding: 18px 20px;
}

.playbook-card h4 {
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 8px;
}

.playbook-card p {
  font-size: 0.94rem;
  margin-bottom: 0;
}

.intensity-list {
  display: grid;
  gap: 12px;
  margin: 14px 0 22px;
}

.intensity-item {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-right: 4px solid var(--emerald-mid);
  border-radius: 12px;
  padding: 14px 18px;
}

.intensity-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.intensity-badge {
  font-size: 0.8rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold-ink);
}

.onboarding-required-tag {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--agree);
  background: rgba(14, 107, 80, 0.1);
  border: 1px solid rgba(14, 107, 80, 0.25);
  padding: 1px 8px;
  border-radius: 999px;
  margin-right: 6px;
}

.onboarding-optional-tag {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-muted);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 1px 8px;
  border-radius: 999px;
  margin-right: 6px;
}

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

/* ==================== TEST ARENA ==================== */
.test-wrapper {
  max-width: 840px;
  margin: 0 auto;
}

.test-progress-sticky {
  position: sticky;
  top: calc(var(--navbar-h, 78px) + 6px);
  z-index: 80;
  background: var(--surface-glass);
  backdrop-filter: blur(14px);
  padding: 16px 20px 18px;
  margin-bottom: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.test-top-utility {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.btn-link-subtle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink-muted);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-link-subtle:hover {
  border-color: #DC2626;
  color: #DC2626;
  background: rgba(220, 38, 38, 0.08);
}

.scale-legend-banner {
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  margin-bottom: 18px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.progress-pct {
  color: var(--gold-ink);
  font-weight: 900;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: var(--surface-alt);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--emerald-mid), var(--gold-bright));
  border-radius: 999px;
  transition: width 0.35s ease;
}

.question-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 30px 26px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.question-card.answered {
  border-color: var(--gold);
  box-shadow: 0 6px 20px rgba(200, 155, 43, 0.12);
  opacity: 0.88;
}

.question-card.answered:hover,
.question-card.answered:focus-within {
  opacity: 1;
}

.question-card.unanswered-alert {
  border-color: #EF4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}

.question-num {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--gold-ink);
  background: var(--gold-soft);
  border: 1px solid var(--border);
  padding: 2px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.question-card.answered .question-num {
  background: var(--emerald);
  color: #F6E6B4;
  border-color: var(--gold);
}

.question-text {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.75;
}

.likert-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.likert-label {
  font-size: 0.92rem;
  font-weight: 800;
  min-width: 74px;
}

.likert-label.agree { color: var(--agree); text-align: left; }
.likert-label.disagree { color: var(--disagree); text-align: right; }

.likert-circles {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.likert-btn {
  position: relative;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.likert-btn:hover { transform: scale(1.12); }
.likert-btn.size-lg { width: 54px; height: 54px; border: 3px solid; }
.likert-btn.size-md { width: 44px; height: 44px; border: 2.5px solid; }
.likert-btn.size-sm { width: 35px; height: 35px; border: 2.5px solid; }
.likert-btn.size-xs { width: 28px; height: 28px; border: 2px solid; }

.likert-btn.side-agree { border-color: var(--agree); }
.likert-btn.side-disagree { border-color: var(--disagree); }
.likert-btn.side-neutral { border-color: var(--neutral); }

.likert-btn.side-agree.selected {
  background: var(--agree);
  box-shadow: 0 6px 18px rgba(14, 107, 80, 0.42);
}

.likert-btn.side-disagree.selected {
  background: var(--disagree);
  box-shadow: 0 6px 18px rgba(140, 74, 110, 0.38);
}

.likert-btn.side-neutral.selected {
  background: var(--neutral);
  box-shadow: 0 6px 14px rgba(148, 163, 157, 0.35);
}

.likert-btn svg {
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.16s ease;
  color: #fff;
}

.likert-btn.selected svg { opacity: 1; transform: scale(1); }

.likert-selected-label {
  text-align: center;
  min-height: 24px;
  margin-top: 10px;
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--ink-muted);
}

.likert-selected-label.is-agree { color: var(--agree); }
.likert-selected-label.is-disagree { color: var(--disagree); }
.likert-selected-label.is-neutral { color: var(--ink-muted); }

.btn-ready-pulse {
  animation: readyPulse 1.4s ease-in-out 2;
}

@keyframes readyPulse {
  0%, 100% { box-shadow: var(--shadow-gold); }
  50% { box-shadow: 0 0 0 6px rgba(200, 155, 43, 0.35), var(--shadow-gold); transform: translateY(-2px); }
}

.likert-mobile-labels {
  display: none;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 0.84rem;
  font-weight: 800;
}

.test-footer-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  flex-wrap: wrap;
}

/* ==================== RESULT & PROFILE ==================== */
.profile-hero {
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  color: #FAF6EB;
  margin-bottom: 28px;
  box-shadow: var(--shadow-lg);
  border: 1.5px solid rgba(229, 193, 88, 0.48);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 32px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #031B14 0%, #083D2F 55%, #105542 100%);
}

.profile-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 14% 20%, rgba(229, 193, 88, 0.24), transparent 45%);
  pointer-events: none;
}

.profile-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(229, 193, 88, 0.16);
  border: 1px solid rgba(229, 193, 88, 0.45);
  color: #F4DC8B;
  padding: 5px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.profile-hero h1 {
  font-size: clamp(1.85rem, 3.2vw, 2.6rem);
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 8px;
  color: #FFFFFF;
}

.profile-code-display {
  display: inline-block;
  font-size: 1.16rem;
  font-weight: 900;
  letter-spacing: 1.2px;
  background: linear-gradient(135deg, rgba(229, 193, 88, 0.26), rgba(200, 155, 43, 0.14));
  border: 1px solid rgba(229, 193, 88, 0.55);
  color: #F6E6B4;
  padding: 5px 16px;
  border-radius: 12px;
  margin-bottom: 14px;
  direction: ltr;
}

.profile-hero p {
  font-size: 1.06rem;
  opacity: 0.94;
  max-width: 640px;
}

.profile-traits-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.trait-pill {
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(229, 193, 88, 0.34);
  color: #FAF6EB;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

.profile-avatar-showcase {
  position: relative;
  z-index: 2;
  width: 210px;
  height: 210px;
  border-radius: 30px;
  background: radial-gradient(circle at 50% 45%, rgba(244, 220, 139, 0.26), rgba(4, 28, 21, 0.65));
  border: 2px solid rgba(229, 193, 88, 0.58);
  display: grid;
  place-items: center;
  padding: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35), inset 0 0 28px rgba(229, 193, 88, 0.14);
}

.profile-avatar-showcase img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.38));
}

.result-actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.result-actions-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.result-actions-more {
  position: relative;
}

.result-actions-more summary {
  list-style: none;
  cursor: pointer;
}

.result-actions-more summary::-webkit-details-marker {
  display: none;
}

.result-actions-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.result-breadcrumb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  margin-bottom: 18px;
  font-size: 0.9rem;
  font-weight: 700;
}

.chapter-nav-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* 5-Axis Percentage Bars */
.traits-dashboard {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 30px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.traits-dashboard h2 {
  font-size: 1.35rem;
  font-weight: 900;
  margin-bottom: 20px;
  color: var(--ink);
}

.axis-row { margin-bottom: 22px; }
.axis-row:last-child { margin-bottom: 0; }

.axis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.94rem;
}

.axis-title { font-weight: 800; color: var(--ink); }

.axis-winner-tag {
  font-weight: 800;
  padding: 2px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  background: var(--gold-soft);
  color: var(--gold-ink);
  border: 1px solid var(--border);
}

.axis-bar-wrap {
  display: grid;
  grid-template-columns: 130px 1fr 130px;
  align-items: center;
  gap: 14px;
}

.axis-pole { font-size: 0.86rem; font-weight: 700; color: var(--ink-muted); }
.axis-pole.left { text-align: left; }
.axis-pole.right { text-align: right; }
.axis-pole.dominant { color: var(--ink); font-weight: 900; }

.axis-track {
  height: 14px;
  background: var(--surface-alt);
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  border: 1px solid var(--border);
}

.axis-track.winner-a { justify-content: flex-start; }
.axis-track.winner-b { justify-content: flex-end; }

.axis-fill-winner {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--emerald-mid), var(--gold));
  transition: width 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.axis-fill-a {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald-mid), var(--gold));
  transition: width 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.axis-fill-b {
  height: 100%;
  background: transparent;
  transition: width 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Profile Layout */
.profile-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 24px;
  align-items: start;
}

.profile-sidebar {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  position: sticky;
  top: 94px;
  box-shadow: var(--shadow-sm);
}

.profile-sidebar h3 {
  font-size: 0.88rem;
  color: var(--gold-ink);
  padding: 6px 12px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.chapter-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: right;
  background: transparent;
  border: 1px solid transparent;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.18s ease;
  margin-bottom: 4px;
}

.chapter-btn:hover {
  background: var(--surface-alt);
  color: var(--ink);
}

.chapter-btn.active {
  background: linear-gradient(135deg, var(--emerald), var(--emerald-deep));
  color: #F6E6B4;
  border-color: var(--gold);
  font-weight: 800;
}

.profile-content-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 36px 38px;
  box-shadow: var(--shadow-sm);
}

.chapter-panel { display: none; }
.chapter-panel.active { display: block; animation: fadeUp 0.25s ease; }

.chapter-panel h2 {
  font-size: 1.6rem;
  font-weight: 900;
  margin-bottom: 16px;
  color: var(--ink);
}

.chapter-panel h3 {
  font-size: 1.18rem;
  font-weight: 800;
  margin: 22px 0 10px;
  color: var(--gold);
}

.chapter-panel p {
  font-size: 1.04rem;
  color: var(--ink-soft);
  margin-bottom: 16px;
  line-height: 2;
}

.quote-box {
  border-right: 4px solid var(--gold);
  background: var(--surface-alt);
  padding: 20px 24px;
  border-radius: 14px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 22px;
}

.personal-context-box {
  background: linear-gradient(135deg, rgba(8, 61, 47, 0.12), rgba(200, 155, 43, 0.16));
  border: 1.5px solid var(--border-strong);
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 20px;
}

.personal-context-box strong {
  display: block;
  color: var(--gold);
  margin-bottom: 4px;
  font-size: 1.02rem;
}

.sw-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 12px;
}

.sw-col {
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  padding: 22px;
  border: 1px solid var(--border);
}

.sw-col.strengths { border-top: 4px solid var(--agree); }
.sw-col.weaknesses { border-top: 4px solid var(--gold); }
.sw-col h3 { margin-top: 0; margin-bottom: 14px; }

.sw-item {
  background: var(--surface);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.sw-item:last-child { margin-bottom: 0; }
.sw-item strong { display: block; font-size: 0.98rem; margin-bottom: 4px; color: var(--ink); }
.sw-item span { display: block; font-size: 0.92rem; color: var(--ink-soft); line-height: 1.75; }

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 20px;
}

.tag-chip {
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
}

.tag-chip.good { background: var(--diplomats-soft); border-color: var(--agree); color: var(--diplomats-dark); }
.tag-chip.bad { background: rgba(220, 38, 38, 0.1); border-color: rgba(220, 38, 38, 0.3); color: #DC2626; }
[data-theme="dark"] .tag-chip.bad { color: #FCA5A5; }
.tag-chip.match { background: var(--gold-soft); border-color: var(--gold); color: var(--gold); cursor: pointer; transition: transform 0.18s; }
.tag-chip.match:hover { transform: translateY(-2px); }

.workplace-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 14px;
}

.work-card {
  background: var(--surface-alt);
  border-radius: 14px;
  padding: 20px;
  border: 1px solid var(--border);
}

.work-card h4 { font-size: 1.02rem; font-weight: 800; margin-bottom: 8px; color: var(--gold); }
.work-card p { font-size: 0.94rem; margin-bottom: 0; }

.tips-list { list-style: none; margin: 12px 0 22px; }
.tips-list li {
  background: var(--surface-alt);
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 10px;
  border-right: 4px solid var(--gold);
  font-weight: 600;
  color: var(--ink);
}

/* ==================== 16 TYPES EXPLORER ==================== */
.explorer-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.explorer-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.gender-switch {
  display: inline-flex;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}

.gender-switch button {
  border: none;
  background: transparent;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s;
}

.gender-switch button.active {
  background: linear-gradient(135deg, var(--emerald), var(--emerald-deep));
  color: var(--gold-bright);
}

.filter-pill {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  color: var(--ink-soft);
  transition: all 0.18s ease;
}

.filter-pill.active, .filter-pill:hover {
  background: linear-gradient(135deg, var(--emerald), var(--emerald-deep));
  color: #F6E6B4;
  border-color: var(--gold);
}

.role-group-section { margin-bottom: 44px; }

.role-group-banner {
  border-radius: var(--radius-md);
  padding: 22px 26px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
}

.role-group-banner h2 { font-size: 1.48rem; font-weight: 900; }

.types-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.type-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 18px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.type-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold);
}

.type-card-avatar {
  width: 118px;
  height: 118px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  padding: 10px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}

.type-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.28s ease;
}

.type-card:hover .type-card-avatar img {
  transform: scale(1.07);
}

.type-card h3 { font-size: 1.18rem; font-weight: 900; margin-bottom: 2px; }
.type-card-en { font-size: 0.84rem; color: var(--ink-muted); margin-bottom: 8px; }
.type-card-code {
  font-size: 0.82rem;
  font-weight: 900;
  padding: 3px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
  direction: ltr;
}
.type-card p { font-size: 0.9rem; color: var(--ink-soft); line-height: 1.75; }

/* ==================== THEORY VIEW ==================== */
.theory-grid { display: grid; gap: 20px; }

.theory-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.theory-poles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.theory-pole-box {
  background: var(--surface-alt);
  border-radius: 14px;
  padding: 18px;
  border: 1px solid var(--border);
}

.theory-pole-box strong { display: block; font-size: 1.02rem; margin-bottom: 6px; }

/* ==================== FOOTER ==================== */
.site-footer {
  background: #031711;
  color: rgba(247, 241, 225, 0.78);
  padding: 38px 0;
  margin-top: 48px;
  border-top: 2px solid var(--gold);
  font-size: 0.92rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.site-footer strong { color: #F4DC8B; }

/* ==================== TOAST ==================== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 999;
  background: linear-gradient(135deg, #042119, #0A4636);
  color: #F6E6B4;
  border: 1px solid var(--gold);
  padding: 13px 22px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.94rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: all 0.25s ease;
}

.toast.show { opacity: 1; transform: translateY(0); }

/* ==================== COMPARE TWO PERSONALITIES ==================== */
.compare-builder-card {
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 34px 32px;
  box-shadow: var(--shadow-md);
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.compare-builder-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--emerald-deep), var(--gold), var(--emerald-mid));
}

.compare-modes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.compare-persons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 22px;
}

.person-config-card {
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 22px;
}

.person-config-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.person-config-head h3 {
  font-size: 1.2rem;
  color: var(--gold-ink);
}

.person-config-avatar {
  width: 112px;
  height: 112px;
  border-radius: 22px;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  padding: 10px;
}

.person-config-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.royal-select {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.96rem;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

.royal-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-soft);
}

.custom-pcts-details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 10px;
}

.custom-pcts-details summary {
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--gold-ink);
}

.pct-sliders-wrap {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.pct-slider-row {
  background: var(--surface-alt);
  border-radius: 10px;
  padding: 10px 12px;
}

.pct-slider-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 6px;
  gap: 6px;
}

.pct-slider-row input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
  cursor: pointer;
}

/* Dual Comparison Output */
.compare-dual-hero {
  background: linear-gradient(135deg, #031B14 0%, #083D2F 50%, #0E5340 100%);
  color: #FAF6EB;
  border: 1.5px solid rgba(229, 193, 88, 0.5);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.compare-person-badge-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.compare-hero-avatar {
  width: 124px;
  height: 124px;
  border-radius: 24px;
  background: rgba(255, 253, 248, 0.12);
  border: 1.5px solid rgba(229, 193, 88, 0.55);
  padding: 10px;
  margin-bottom: 12px;
  display: grid;
  place-items: center;
}

.compare-hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.compare-person-badge-col h3 {
  font-size: 1.32rem;
  color: #FFFFFF;
  margin-bottom: 4px;
}

.compare-synergy-medallion {
  background: radial-gradient(circle, rgba(229, 193, 88, 0.24), rgba(4, 28, 21, 0.72));
  border: 2px solid #E5C158;
  border-radius: 26px;
  padding: 22px 26px;
  min-width: 240px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
}

.synergy-score-num {
  font-family: var(--font-title);
  font-size: 2.8rem;
  font-weight: 900;
  color: #F4DC8B;
  line-height: 1.1;
}

.synergy-label {
  font-size: 0.85rem;
  color: rgba(250, 246, 235, 0.85);
  margin-bottom: 6px;
}

.synergy-title {
  font-size: 1rem;
  font-weight: 800;
  color: #FFFFFF;
}

.compare-section-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 30px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.compare-section-card h2 {
  font-size: 1.4rem;
  color: var(--ink);
  margin-bottom: 16px;
}

.compare-axis-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 14px;
}

.compare-axis-card:last-child { margin-bottom: 0; }

.compare-axis-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.compare-axis-poles-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 10px;
}

.compare-mini-pole {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
}

.compare-mini-pole strong {
  display: block;
  font-size: 0.84rem;
  color: var(--gold);
  margin-bottom: 2px;
}

.dual-advice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.advice-col-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-top: 4px solid var(--gold);
  border-radius: 16px;
  padding: 22px;
}

.advice-col-card h3 {
  font-size: 1.12rem;
  color: var(--gold);
  margin-bottom: 14px;
}

/* ==================== TRAINER & WORKSHOP PORTAL ==================== */
.workshop-banner {
  background: linear-gradient(135deg, rgba(8, 61, 47, 0.16), rgba(200, 155, 43, 0.18));
  border: 1.5px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 16px 22px;
  margin: 18px 0 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.locked-result-card {
  max-width: 720px;
  margin: 24px auto;
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 44px 34px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.locked-icon {
  width: 82px;
  height: 82px;
  margin: 0 auto 18px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--emerald-deep), var(--emerald-mid));
  border: 1.5px solid var(--gold);
  display: grid;
  place-items: center;
  font-size: 2.2rem;
}

.locked-result-card h2 {
  font-size: 1.7rem;
  margin-bottom: 12px;
  color: var(--ink);
}

.locked-result-card p {
  color: var(--ink-soft);
  margin-bottom: 24px;
}

.locked-unlock-box {
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 20px;
}

.locked-unlock-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}

.locked-unlock-row .royal-input {
  max-width: 260px;
}

.trainer-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.trainer-tab-btn {
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  color: var(--ink-soft);
  padding: 11px 20px;
  border-radius: 14px;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.trainer-tab-btn:hover {
  border-color: var(--gold);
  color: var(--ink);
}

.trainer-tab-btn.active {
  background: linear-gradient(135deg, var(--emerald-deep), var(--emerald-mid));
  color: #F6E6B4;
  border-color: var(--gold);
}

.trainer-panel { display: none; }
.trainer-panel.active { display: block; animation: fadeUp 0.25s ease; }

.trainer-link-box {
  margin-top: 24px;
  background: var(--surface-alt);
  border: 1.5px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 20px 22px;
}

.trainer-lookup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 14px;
  align-items: end;
}

.trainer-lookup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.kpi-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: linear-gradient(135deg, #031B14 0%, #083D2F 100%);
  color: #FAF6EB;
  border: 1.5px solid rgba(229, 193, 88, 0.45);
  border-radius: var(--radius-md);
  padding: 20px 18px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.kpi-card strong {
  display: block;
  font-family: var(--font-title);
  font-size: 1.75rem;
  color: #F4DC8B;
  line-height: 1.25;
  margin-bottom: 4px;
}

.kpi-card span {
  font-size: 0.86rem;
  color: rgba(250, 246, 235, 0.85);
}

.room-bars-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.room-bar-item {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}

.teams-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.team-card {
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  border-top: 4px solid var(--gold);
  border-radius: 14px;
  padding: 18px;
}

.team-card h4 {
  font-size: 1.04rem;
  color: var(--gold);
  margin-bottom: 10px;
}

.team-member-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.team-member-row:last-child { border-bottom: none; }

.participants-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.participants-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.participants-table th,
.participants-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}

.participants-table th {
  background: var(--surface-alt);
  color: var(--gold-ink);
  font-weight: 800;
}

.participants-table tr:hover td {
  background: var(--gold-soft);
}

/* ==================== TEAM & CANDIDATE FIT (COMPANIES) ==================== */
.tf-roster-add-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 0.85fr auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.tf-mgr-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
}

.tf-roster-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tf-member-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 0.88rem;
}

.tf-member-pill .tf-mgr-badge {
  background: var(--gold-soft);
  color: var(--gold);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.74rem;
  font-weight: 800;
}

.tf-member-remove {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  font-weight: 900;
  font-size: 0.95rem;
  padding: 2px 6px;
  border-radius: 6px;
}

.tf-member-remove:hover {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.12);
}

.tf-fit-bars-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.tf-fit-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
}

.tf-fit-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.tf-score-badge {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 1rem;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid var(--border-strong);
  padding: 2px 10px;
  border-radius: 999px;
}

.tf-shift-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.tf-shift-row:last-child { border-bottom: none; }

.tf-ethics-box {
  background: var(--gold-soft);
  border: 1px solid var(--border-strong);
  border-right: 4px solid var(--gold);
  border-radius: 14px;
  padding: 16px 20px;
  font-size: 0.92rem;
  color: var(--ink);
  margin-top: 18px;
}

.child-add-row {
  display: grid;
  grid-template-columns: 0.85fr 1fr 1.2fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1120px) {
  .navbar-inner { flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 10px 0; }
  .nav-links { flex-wrap: wrap; justify-content: center; gap: 6px; width: 100%; }
}

@media (max-width: 980px) {
  body { background-attachment: scroll; }
  .navbar-inner {
    flex-wrap: nowrap;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    min-height: 66px;
    padding: 8px 0;
  }
  .nav-menu-btn { display: inline-flex; }
  .nav-links {
    display: none;
    position: fixed;
    top: calc(var(--navbar-h, 68px) + 6px);
    right: 12px;
    left: 12px;
    width: auto;
    background: var(--surface-elevated);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 160;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
  }
  .nav-links.open {
    display: flex;
    animation: fadeUp 0.2s ease;
  }
  .nav-links .nav-btn,
  .nav-links .theme-toggle {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  .nav-links .zoom-controls {
    width: 100%;
    justify-content: center;
  }
  .tf-roster-add-row, .tf-fit-bars-grid { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; padding: 34px 24px; }
  .hero-showcase { grid-template-columns: repeat(4, 1fr); }
  .types-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .profile-layout { grid-template-columns: 1fr; }
  .profile-sidebar {
    position: sticky;
    top: calc(var(--navbar-h, 68px) + 4px);
    z-index: 75;
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding: 10px 14px;
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-mask-image: linear-gradient(to left, transparent, #000 18px, #000 calc(100% - 18px), transparent);
    mask-image: linear-gradient(to left, transparent, #000 18px, #000 calc(100% - 18px), transparent);
  }
  .profile-sidebar h3 { display: none; }
  .chapter-btn { width: auto; white-space: nowrap; margin-bottom: 0; }
  .workplace-cards, .trainer-lookup-grid, .teams-grid { grid-template-columns: 1fr; }
  .compare-dual-hero { grid-template-columns: 1fr; }
  .kpi-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .room-bars-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .brand-mark { width: 46px; height: 46px; border-radius: 12px; }
  .brand-text strong { font-size: 17.5px; }
  .hero-showcase { grid-template-columns: repeat(2, 1fr); }
  .steps-grid, .groups-overview-grid, .sw-grid, .theory-poles, .choice-grid-2,
  .compare-persons-grid, .compare-axis-poles-row, .dual-advice-grid, .child-add-row,
  .compare-modes-grid { grid-template-columns: 1fr; }
  .kpi-grid-4 { grid-template-columns: 1fr; }
  .profile-hero { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: 30px 18px; }
  .profile-traits-pills { justify-content: center; }
  .likert-label { display: none; }
  .likert-mobile-labels { display: flex; }
  .likert-circles { gap: 8px; }
  .likert-btn::after { content: ""; position: absolute; inset: -9px; }
  .likert-btn.size-lg { width: 44px; height: 44px; }
  .likert-btn.size-md { width: 37px; height: 37px; }
  .likert-btn.size-sm { width: 31px; height: 31px; }
  .likert-btn.size-xs { width: 25px; height: 25px; }
  .axis-bar-wrap { grid-template-columns: 1fr 1fr; gap: 8px 10px; }
  .axis-pole.right { grid-column: 1; text-align: right; }
  .axis-pole.left { grid-column: 2; text-align: left; }
  .axis-track { grid-column: 1 / -1; order: 3; }
  .types-grid-4 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .type-card { padding: 18px 12px; }
  .type-card-avatar { width: 88px; height: 88px; }
  .toast { left: 16px; right: 16px; bottom: 18px; text-align: center; max-width: calc(100vw - 32px); }
  .profile-content-card, .onboarding-card, .compare-builder-card, .compare-section-card { padding: 22px 16px; }
}

/* ==================== NATIVE VECTOR PRINT / SAVE AS PDF ==================== */
@page {
  size: A4 portrait;
  margin: 12mm;
}

@media print {
  :root,
  [data-theme="dark"] {
    --bg: #FFFFFF !important;
    --surface: #FFFFFF !important;
    --surface-elevated: #FFFFFF !important;
    --surface-alt: #F7F4EC !important;
    --ink: #0B261E !important;
    --ink-soft: #253D35 !important;
    --ink-muted: #4C635B !important;
    --gold: #9E7314 !important;
    --gold-ink: #8A6410 !important;
    --gold-soft: rgba(200, 155, 43, 0.14) !important;
    --border: rgba(180, 138, 34, 0.35) !important;
    --border-strong: rgba(180, 138, 34, 0.55) !important;
  }
  html {
    font-size: 13px !important;
  }
  body {
    background: #FFFFFF !important;
    background-image: none !important;
    color: #0B261E !important;
  }
  .navbar, .site-footer, .result-actions-bar, .profile-sidebar, .toast,
  .pdf-temp-container, .compare-builder-card, #compare-actions-bar,
  .trainer-tabs, .trainer-lookup-bar, #tr-panel-create, #tr-panel-setup,
  #tr-panel-dashboard:not(.active), #tr-panel-teamfit:not(.active), #tf-actions-bar,
  .workshop-banner, #btn-export-cohort-csv, #btn-print-cohort-report,
  #btn-tf-import-cohort, #btn-tf-fill-candidate, #btn-tf-seed-team, #btn-tf-clear-team,
  #btn-toggle-extra-chapters, .chapter-nav-footer, .result-breadcrumb,
  #tr-dashboard-output button, #tf-result-container button,
  .view:not(.active) {
    display: none !important;
  }
  #view-result.active, #view-compare.active, #view-trainer.active { display: block !important; padding: 0 !important; }
  #view-trainer.active #tr-panel-dashboard.active,
  #view-trainer.active #tr-panel-teamfit.active { display: block !important; }
  .profile-layout { display: block !important; }
  .profile-content-card, .compare-section-card { border: none !important; box-shadow: none !important; padding: 12px 0 !important; background: #FFFFFF !important; }
  .chapter-panel:not(.age-hidden) {
    display: block !important;
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid #E2DCCB;
  }
  .chapter-panel.age-hidden {
    display: none !important;
  }
  .workplace-cards { grid-template-columns: repeat(3, 1fr) !important; }
  .sw-grid, .dual-advice-grid, .teams-grid, .tf-fit-bars-grid { grid-template-columns: 1fr 1fr !important; }
  .kpi-grid-4 { grid-template-columns: repeat(4, 1fr) !important; }
  .participants-table-wrap { overflow: visible !important; }
  .participants-table th, .participants-table td {
    white-space: normal !important;
    font-size: 9.5px !important;
    padding: 5px 6px !important;
  }
  .profile-hero, .compare-dual-hero, .traits-dashboard, .sw-item, .playbook-card, .intensity-item,
  .compare-axis-card, .advice-col-card, .work-card, .quote-box, .personal-context-box, .tips-list li,
  .kpi-card, .team-card, .room-bar-item, .tf-score-card {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
  .profile-hero, .compare-dual-hero, .kpi-card, .axis-fill-a, .axis-fill-winner,
  .sw-col, .quote-box, .personal-context-box, .tips-list li, .intensity-badge {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}
