/* ===================================================================
   MDP Insights v5 — Modern Gen-Z + Manager Design System
   Balanced light/dark, card-based, glassmorphism, minimal scroll
=================================================================== */

/* ── Google Fonts injected via HTML ── */

:root {
  /* Brand Color Palette */
  --clr-red:    #EF4444;
  --clr-yellow: #F59E0B;
  --clr-green:  #22C55E;
  --clr-blue:   #3B82F6;

  /* Neutral System (Light) */
  --bg:            #f4f6fb;
  --bg-card:       #ffffff;
  --glass-bg:      rgba(255,255,255,0.72);
  --glass-border:  rgba(0,0,0,0.07);
  --border:        rgba(0,0,0,0.09);
  --text-primary:  #0f172a;
  --text-secondary:#374151;
  --text-muted:    #94a3b8;
  --accent:        #6366f1;
  --accent-glow:   rgba(99,102,241,0.18);
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg:     0 8px 32px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);
  --header-h:      56px;
  --bnav-h:        64px;
  --radius-sm:     10px;
  --radius-md:     16px;
  --radius-lg:     22px;
  --radius-xl:     28px;
  --font-heading:  'Outfit', sans-serif;
  --font-body:     'Plus Jakarta Sans', sans-serif;
  --transition:    0.2s cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"] {
  --bg:            #0f1117;
  --bg-card:       #1a1f2e;
  --glass-bg:      rgba(26,31,46,0.80);
  --glass-border:  rgba(255,255,255,0.07);
  --border:        rgba(255,255,255,0.09);
  --text-primary:  #f1f5f9;
  --text-secondary:#cbd5e1;
  --text-muted:    #64748b;
  --accent:        #818cf8;
  --accent-glow:   rgba(129,140,248,0.18);
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg:     0 8px 32px rgba(0,0,0,0.5);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100dvh;
  overscroll-behavior: none;
  overflow-x: hidden;
  padding-top: var(--header-h);
  padding-bottom: calc(var(--bnav-h) + env(safe-area-inset-bottom,0px));
  transition: background var(--transition), color var(--transition);
}
button { cursor: pointer; border: none; background: none; font-family: inherit; }
img, svg { display: block; }
ul { list-style: none; padding: 0; }
.hidden { display: none !important; }

/* ── ANIMATED MESH BACKGROUND ── */
.mesh-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.mesh-orb {
  position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.25;
  animation: orb-drift 14s ease-in-out infinite alternate;
}
[data-theme="dark"] .mesh-orb { opacity: 0.18; }
.mesh-red    { width:380px; height:380px; background:#EF4444; top:-80px; left:-80px; animation-delay:0s; }
.mesh-yellow { width:300px; height:300px; background:#F59E0B; top:20%; right:-60px; animation-delay:-3s; }
.mesh-green  { width:260px; height:260px; background:#22C55E; bottom:20%; right:10%; animation-delay:-6s; }
.mesh-blue   { width:350px; height:350px; background:#3B82F6; bottom:-60px; left:10%; animation-delay:-9s; }
@keyframes orb-drift { from { transform: translate(0,0) scale(1); } to { transform: translate(30px,30px) scale(1.08); } }

/* ── HEADER ── */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  padding: 0 max(16px, env(safe-area-inset-left,0px));
  transition: background var(--transition);
}
.header-inner {
  max-width: 1100px; margin: 0 auto;
  height: var(--header-h);
  display: flex; align-items: center; gap: 14px;
}
/* Push controls to the far right on mobile (no desktop nav) */
@media (max-width:700px) {
  .header-inner { justify-content: space-between; }
  .header-controls { margin-left: auto; }
}

/* Brand */
.brand {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0; user-select: none;
}
.brand-icon {
  width: 28px; height: 28px;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 2.5px; border-radius: 8px; overflow: hidden;
}
.bi-dot { border-radius: 2px; }
.bi-r { background: #EF4444; }
.bi-y { background: #F59E0B; }
.bi-b { background: #3B82F6; }
.bi-g { background: #22C55E; }
.brand-name {
  font-family: var(--font-heading);
  font-size: 1.1rem; font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}
.brand-hi {
  background: linear-gradient(135deg, var(--clr-red), var(--clr-yellow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Desktop Nav */
.desk-nav {
  display: flex; gap: 4px; flex: 1; justify-content: center;
}
.dnav-btn {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--transition);
  letter-spacing: 0.2px;
}
.dnav-btn:hover { color: var(--text-primary); background: var(--border); }
.dnav-btn.active { background: var(--text-primary); color: var(--bg); }
@media (max-width:700px) { .desk-nav { display: none; } }

/* Header controls — always flex-shrink:0, pushed right via parent justify-content:space-between on mobile */
.header-controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ctrl-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  background: var(--border);
  transition: all var(--transition);
}
.ctrl-btn:hover { background: var(--text-primary); color: var(--bg); }

/* Theme icons */
.icon-sun, .icon-moon { transition: opacity var(--transition), transform var(--transition); }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"]  .icon-sun  { display: none; }

/* Hamburger: mobile only */
.hamburger-btn { display: none; }
@media (max-width:700px) { .hamburger-btn { display: flex; } }

/* Mobile Dropdown */
.mobile-dropdown {
  position: absolute; top: calc(var(--header-h) + 6px); right: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 220px;
  display: none; flex-direction: column; gap: 2px;
  z-index: 200;
  backdrop-filter: blur(20px);
  animation: dropdown-in 0.15s ease;
}
.mobile-dropdown.open { display: flex; }
@keyframes dropdown-in { from { opacity:0; transform:translateY(-6px) scale(.97); } to { opacity:1; transform:none; } }
.mdrop-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem; font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition); text-align: left;
}
.mdrop-item span { font-size: 1rem; }
.mdrop-item:hover { background: var(--border); color: var(--text-primary); }
.mdrop-item.active { background: var(--accent-glow); color: var(--accent); }

/* ── MAIN VIEWS ── */
.views-root { position: relative; z-index: 1; }
.view { display: none; animation: view-in 0.24s ease; }
.view.active { display: block; }
@keyframes view-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
.view-wrap {
  max-width: 860px; margin: 0 auto;
  padding: 20px 16px 24px;
}
@media (min-width:600px) { .view-wrap { padding: 28px 24px 32px; } }

/* ── GLASS CARD ── */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  transition: background var(--transition), box-shadow var(--transition);
}

/* ── ASSESSMENT VIEW ── */
.assess-topbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.frame-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.78rem; font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap; flex-shrink: 0;
}
.chip-pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--clr-red);
  animation: pulse-dot 1.6s ease infinite;
}
@keyframes pulse-dot {
  0%,100% { opacity:1; transform:scale(1); }
  50% { opacity:0.5; transform:scale(0.7); }
}
.progress-track {
  flex: 1; height: 5px;
  background: var(--border);
  border-radius: 3px; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--clr-red), var(--clr-yellow));
  transition: width 0.4s cubic-bezier(.4,0,.2,1);
}
.sample-link {
  font-size: 0.75rem; font-weight: 700;
  color: var(--accent); white-space: nowrap;
  padding: 4px 8px; border-radius: 8px;
  background: var(--accent-glow);
  transition: all var(--transition);
}
.sample-link:hover { opacity: 0.8; }

/* Question Card */
.q-card { padding: 20px; }
@media (min-width:500px) { .q-card { padding: 24px; } }

.q-header { margin-bottom: 16px; }
.q-title {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 4vw, 1.35rem);
  font-weight: 800; letter-spacing: -0.4px;
  color: var(--text-primary);
  line-height: 1.25;
}
.q-hint {
  margin-top: 6px;
  font-size: 0.78rem; color: var(--text-muted);
  line-height: 1.4;
}
.q-hint strong { color: var(--text-secondary); }

/* Options Grid */
.options-grid {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 16px;
}
/* q-hint secondary line */
.q-hint-eg {
  display: block; margin-top: 3px;
  font-size: 0.72rem; color: var(--text-muted);
}

/* ── OPTION ROWS (assessment cards) ── */

/* DESKTOP: horizontal — dot + text left, rank buttons right */
.opt-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg);
  transition: all var(--transition);
  cursor: default;
}
.opt-row:hover { border-color: var(--text-muted); }
.opt-row.ranked { border-color: var(--row-color, var(--accent)); background: var(--row-bg, var(--accent-glow)); }

/* Desktop inner layout helpers */
.opt-top {
  display: flex; align-items: center; gap: 8px;
  flex: 1; min-width: 0;
}
.opt-color-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0;
}
.opt-label {
  font-size: 0.85rem; font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  flex: 1; min-width: 0;
}
.opt-rank-badge {
  font-size: 0.72rem; font-weight: 800;
  padding: 2px 7px; border-radius: 6px;
  flex-shrink: 0;
}
/* Hide traits on desktop row (shown on mobile) */
.opt-traits {
  display: none;
}
.rank-btns {
  display: flex; gap: 4px; flex-shrink: 0;
}
.rank-btn {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  font-size: 0.82rem; font-weight: 700;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.rank-btn:hover:not(.taken) { border-color: var(--text-secondary); color: var(--text-primary); }
.rank-btn.selected {
  background: var(--row-color, var(--accent));
  border-color: var(--row-color, var(--accent));
  color: #fff;
  box-shadow: 0 0 0 2px var(--row-color, var(--accent)), 0 0 0 4px var(--row-bg, var(--accent-glow));
}
/* Taken = already used by another row — dim it, still tappable to swap */
.rank-btn.taken {
  opacity: 0.28;
  text-decoration: line-through;
  cursor: pointer;
}

/* MOBILE (≤520px): stack vertically — label top, description middle, buttons bottom */
@media (max-width: 520px) {
  .opt-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 14px;
  }
  .opt-top {
    margin-bottom: 4px;
  }
  .opt-traits {
    display: block;                    /* show full description */
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.45;
    margin-bottom: 10px;
  }
  .rank-btns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
  .rank-btn {
    width: 100%;                       /* stretch to fill column */
    height: 36px;
    border-radius: 10px;
    font-size: 0.85rem;
  }
  /* Show labels under each rank button on mobile */
  .rank-btn[data-rank="4"]::after { content: ' Most';  font-size: 0.55rem; font-weight: 500; display: block; line-height: 1; }
  .rank-btn[data-rank="1"]::after { content: ' Least'; font-size: 0.55rem; font-weight: 500; display: block; line-height: 1; }
  .rank-btn { flex-direction: column; justify-content: center; line-height: 1.1; }
}

/* Rank tracker strip */
.rank-tracker {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 2px 8px;
  flex-wrap: wrap;
}
.rank-tracker-label {
  font-size: 0.7rem; font-weight: 600;
  color: var(--text-muted); white-space: nowrap;
}
.rank-pip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border-radius: 7px;
  font-size: 0.78rem; font-weight: 800;
  transition: all var(--transition);
}
.rank-pip-free {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.rank-pip-used {
  background: var(--border);
  color: var(--text-muted);
  border: 1.5px solid transparent;
  text-decoration: line-through;
  opacity: 0.45;
}

/* Row colors */
.opt-row-red    { --row-color:#EF4444; --row-bg:rgba(239,68,68,0.07); }
.opt-row-yellow { --row-color:#F59E0B; --row-bg:rgba(245,158,11,0.07); }
.opt-row-green  { --row-color:#22C55E; --row-bg:rgba(34,197,94,0.07); }
.opt-row-blue   { --row-color:#3B82F6; --row-bg:rgba(59,130,246,0.07); }

/* Action bar */
.q-actions {
  display: flex; gap: 8px; align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.q-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem; font-weight: 700;
  transition: all var(--transition);
}
.q-btn-ghost {
  color: var(--text-secondary);
  background: var(--border);
}
.q-btn-ghost:hover { background: var(--text-primary); color: var(--bg); }
.q-btn-ghost:disabled { opacity: 0.35; pointer-events: none; }
.q-btn-clear { margin-left: auto; }
.q-btn-primary {
  margin-left: auto;
  background: var(--text-primary); color: var(--bg);
  box-shadow: var(--shadow-sm);
}
.q-btn-clear + .q-btn-primary { margin-left: 0; }
.q-btn-primary:hover { opacity: 0.88; }
.q-btn-primary:disabled { opacity: 0.35; pointer-events: none; }

/* Legend row */
.legend-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 12px; justify-content: center;
}
.leg-tag {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.72rem; font-weight: 600;
  color: var(--text-muted);
  padding: 4px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
}
.leg-tag span {
  width: 7px; height: 7px; border-radius: 50%;
}
.leg-r span { background: var(--clr-red); }
.leg-y span { background: var(--clr-yellow); }
.leg-g span { background: var(--clr-green); }
.leg-b span { background: var(--clr-blue); }

/* ── PROFILE VIEW — Locked State ── */
.locked-state {
  padding: 48px 32px;
  text-align: center;
  margin-bottom: 16px;
}
.lock-icon { font-size: 3rem; margin-bottom: 16px; }
.lock-title {
  font-family: var(--font-heading);
  font-size: 1.5rem; font-weight: 800;
  margin-bottom: 8px;
}
.lock-desc {
  font-size: 0.9rem; color: var(--text-muted);
  max-width: 320px; margin: 0 auto 20px;
  line-height: 1.6;
}
.sample-link-block {
  display: block; margin-top: 12px;
  font-size: 0.8rem; font-weight: 600;
  color: var(--accent);
  text-decoration: underline; background: none;
}

/* ── ARCHETYPE HERO ── */
.archetype-hero-card {
  padding: 20px; margin-bottom: 12px;
  position: relative; overflow: hidden;
}
.hero-top-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 8px; flex-wrap: wrap;
}
.dom-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.dom-chip {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.76rem; font-weight: 700;
  background: var(--border);
  color: var(--text-secondary);
}
.dom-chip-sec { opacity: 0.7; }
.hero-actions { display: flex; gap: 5px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--border);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.icon-btn:hover { background: var(--text-primary); color: var(--bg); }

.hero-label {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 6px;
}
.hero-name {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 6vw, 2.2rem);
  font-weight: 900; letter-spacing: -1px;
  color: var(--text-primary); line-height: 1.1;
  margin-bottom: 8px;
}
.hero-motto {
  font-size: 0.9rem; font-style: italic;
  color: var(--accent); font-weight: 600;
  margin-bottom: 8px;
}
.hero-desc {
  font-size: 0.85rem; color: var(--text-secondary);
  line-height: 1.6;
}

/* Sub-nav */
.subnav-row {
  display: flex; gap: 6px; margin-bottom: 12px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.subnav-row::-webkit-scrollbar { display: none; }
.stab {
  padding: 8px 16px; border-radius: 20px;
  font-size: 0.8rem; font-weight: 700;
  color: var(--text-muted); white-space: nowrap;
  background: var(--bg-card); border: 1px solid var(--border);
  transition: all var(--transition);
}
.stab:hover { color: var(--text-primary); }
.stab.active { background: var(--text-primary); color: var(--bg); border-color: var(--text-primary); }

/* Sub-panels */
.sub-panel { display: none; animation: view-in 0.2s ease; }
.sub-panel.active { display: block; }

/* Twin cards */
.twin-cards {
  display: grid; grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width:700px) { .twin-cards { grid-template-columns: 1fr 1fr; } }

.profile-card { padding: 18px; }
.card-title {
  font-family: var(--font-heading);
  font-size: 0.9rem; font-weight: 800;
  letter-spacing: -0.2px;
  color: var(--text-primary); margin-bottom: 14px;
}

/* Energy bars */
.energy-bars { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.ebar-item {}
.ebar-label {
  display: flex; justify-content: space-between;
  font-size: 0.78rem; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 5px;
}
.ebar-label strong { font-weight: 800; color: var(--text-primary); }
.ebar-track {
  height: 6px; background: var(--border);
  border-radius: 3px; overflow: hidden;
}
.ebar-fill {
  height: 100%; border-radius: 3px;
  transition: width 0.8s cubic-bezier(.4,0,.2,1);
}
.ebar-red    { background: linear-gradient(90deg,#EF4444,#f87171); }
.ebar-yellow { background: linear-gradient(90deg,#F59E0B,#fbbf24); }
.ebar-green  { background: linear-gradient(90deg,#22C55E,#4ade80); }
.ebar-blue   { background: linear-gradient(90deg,#3B82F6,#60a5fa); }

/* Persona toggle */
.persona-toggle {
  display: flex; gap: 4px;
  background: var(--border); padding: 3px;
  border-radius: 10px; margin-bottom: 8px;
}
.ptog {
  flex: 1; padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.75rem; font-weight: 700;
  color: var(--text-muted);
  transition: all var(--transition);
}
.ptog.active { background: var(--bg-card); color: var(--text-primary); box-shadow: var(--shadow-sm); }
.persona-note { font-size: 0.72rem; color: var(--text-muted); }

/* Wheel */
.wheel-card { display: flex; flex-direction: column; }
.wheel-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding-top: 4px; }
.wheel-svg { max-height: 240px; }

/* Cards Row (playbook / comms) */
.cards-row {
  display: grid; grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width:500px) { .cards-row { grid-template-columns: 1fr 1fr; } }
@media (min-width:860px) { .cards-row { grid-template-columns: 1fr 1fr 1fr; } }

.info-card { padding: 18px; }
.icard-icon { font-size: 1.5rem; margin-bottom: 10px; }
.icard-title {
  font-family: var(--font-heading);
  font-size: 0.85rem; font-weight: 800;
  color: var(--text-primary); margin-bottom: 10px;
}
.icard-list { display: flex; flex-direction: column; gap: 7px; }
.icard-list li {
  font-size: 0.8rem; color: var(--text-secondary);
  line-height: 1.45; padding-left: 12px; position: relative;
}
.icard-list li::before {
  content: ''; position: absolute; left: 0; top: 7px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--card-accent, var(--accent));
}

.strength-card { --card-accent: var(--clr-green); border-left: 3px solid var(--clr-green); }
.warn-card     { --card-accent: var(--clr-yellow); border-left: 3px solid var(--clr-yellow); }
.action-card   { --card-accent: var(--clr-blue); border-left: 3px solid var(--clr-blue); }
.dos-card      { --card-accent: var(--clr-green); border-left: 3px solid var(--clr-green); }
.donts-card    { --card-accent: var(--clr-red); border-left: 3px solid var(--clr-red); }

/* ── VIEW HEADERS ── */
.view-header { margin-bottom: 20px; }
.view-title {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem,5vw,1.8rem);
  font-weight: 900; letter-spacing: -0.5px;
  color: var(--text-primary);
}
.view-sub {
  font-size: 0.85rem; color: var(--text-muted);
  margin-top: 4px; line-height: 1.5;
}

/* ── TEAM DYNAMICS ── */
.color-selector-row {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
}
.color-selector-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  font-size: 0.82rem; font-weight: 700;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.color-selector-btn:hover { border-color: var(--text-muted); color: var(--text-primary); }
.color-selector-btn.active { color: var(--bg); }

.csel-dot {
  width: 9px; height: 9px; border-radius: 50%;
}
.csel-red    .csel-dot { background: var(--clr-red); }
.csel-yellow .csel-dot { background: var(--clr-yellow); }
.csel-green  .csel-dot { background: var(--clr-green); }
.csel-blue   .csel-dot { background: var(--clr-blue); }

.csel-red.active    { background: var(--clr-red);    border-color: var(--clr-red); }
.csel-yellow.active { background: var(--clr-yellow); border-color: var(--clr-yellow); }
.csel-green.active  { background: var(--clr-green);  border-color: var(--clr-green); }
.csel-blue.active   { background: var(--clr-blue);   border-color: var(--clr-blue); }

.team-guidance-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width:600px) { .team-guidance-grid { grid-template-columns: 1fr 1fr 1fr; } }

.tguide-card { padding: 18px; }
.tguide-icon { font-size: 1.4rem; margin-bottom: 10px; }
.tguide-title {
  font-family: var(--font-heading);
  font-size: 0.85rem; font-weight: 800;
  color: var(--text-primary); margin-bottom: 7px;
}
.tguide-text { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.55; }

/* ── ARCHETYPES ── */
.filter-row {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px;
}
.filter-btn {
  padding: 6px 14px; border-radius: 20px;
  font-size: 0.78rem; font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-card); border: 1px solid var(--border);
  transition: all var(--transition);
}
.filter-btn:hover { color: var(--text-primary); }
.filter-btn.active { background: var(--text-primary); color: var(--bg); border-color: var(--text-primary); }

.archetypes-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width:500px) { .archetypes-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width:800px) { .archetypes-grid { grid-template-columns: 1fr 1fr 1fr; } }

.arch-card {
  padding: 18px;
  position: relative; overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.arch-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.arch-color-bar {
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.arch-tagline {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 6px; margin-top: 10px;
}
.arch-name {
  font-family: var(--font-heading);
  font-size: 1.05rem; font-weight: 800;
  color: var(--text-primary); margin-bottom: 4px;
  letter-spacing: -0.3px;
}
.arch-motto {
  font-size: 0.75rem; font-style: italic;
  color: var(--accent); margin-bottom: 8px;
}
.arch-desc { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.5; }

/* ── THEORY / KNOWLEDGE HUB ── */
.theory-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width:600px) { .theory-grid { grid-template-columns: 1fr 1fr; } }

.theory-card { padding: 20px; }
.tc-icon { font-size: 1.5rem; margin-bottom: 10px; }
.tc-title {
  font-family: var(--font-heading);
  font-size: 0.95rem; font-weight: 800;
  color: var(--text-primary); margin-bottom: 8px;
}
.tc-body { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.6; }

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: calc(var(--bnav-h) + env(safe-area-inset-bottom,0px));
  padding-bottom: env(safe-area-inset-bottom,0px);
  display: flex; align-items: center;
  background: var(--glass-bg);
  border-top: 1px solid var(--glass-border);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  z-index: 100;
}
.bnav-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  height: 100%; padding: 6px 4px;
  font-size: 0.64rem; font-weight: 700;
  color: var(--text-muted);
  transition: color var(--transition);
  position: relative;
}
.bnav-btn::before {
  content: ''; position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 0; height: 2px; border-radius: 0 0 2px 2px;
  background: var(--text-primary);
  transition: width var(--transition);
}
.bnav-btn.active { color: var(--text-primary); }
.bnav-btn.active::before { width: 24px; }
.bnav-icon { transition: transform var(--transition); }
.bnav-btn.active .bnav-icon { transform: scale(1.12); }

/* Hide bottom nav on desktop */
@media (min-width:700px) { .bottom-nav { display: none; } }

/* ── TOAST ── */
.toast-root {
  position: fixed; bottom: calc(var(--bnav-h) + 16px + env(safe-area-inset-bottom,0px));
  left: 50%; transform: translateX(-50%);
  z-index: 300; display: flex; flex-direction: column; align-items: center; gap: 6px;
  pointer-events: none;
}
@media (min-width:700px) { .toast-root { bottom: 20px; } }
.toast {
  background: var(--text-primary); color: var(--bg);
  padding: 9px 18px; border-radius: 20px;
  font-size: 0.8rem; font-weight: 700;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.2s ease;
  white-space: nowrap;
}
@keyframes toast-in { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }

/* ── PRINT ── */
@media print {
  .app-header, .bottom-nav, .toast-root, .mesh-bg, .q-actions,
  .subnav-row, .stab, .persona-toggle, .filter-row, .hero-actions,
  .assess-topbar, .legend-row, .locked-state, .view:not(#view-results) { display: none !important; }
  .view#view-results { display: block !important; }
  .sub-panel { display: block !important; }
  body { padding: 0; background: #fff; }
  .glass-card { box-shadow: none; border: 1px solid #ddd; }
}
