/* Kindred — warm, playful, self-contained (no external fonts/libs).
   Surface + buttons follow the ndirector.com house style: layered
   radial gradient washes with grain/scanline overlays, dark pill
   primary buttons, hairline-outline secondaries. Data marks keep the
   validated diverging pair violet #6E56CF (pole A) <-> terracotta
   #C4643B (pole B) — those encode the axis, not the brand. */

:root {
  --cream: #FAF7F2;
  --card: #FFFFFF;
  --ink: #26221E;
  --muted: #6B645C;
  --hairline: #E4DDD3;
  --violet: #6E56CF;
  --violet-soft: #EFEBFA;
  --terra: #C4643B;
  --terra-soft: #F8ECE5;
  --mid: #EFEAE3;
  --good: #3E7A46;
  --radius: 16px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  /* ndirector.com surface: layered warm/cool radial washes over a soft base */
  background:
    linear-gradient(rgba(255,255,255,0.2), rgba(255,255,255,0.2)),
    radial-gradient(ellipse 90% 70% at 15% 20%, rgba(245, 222, 195, 0.6) 0%, transparent 60%),
    radial-gradient(ellipse 80% 60% at 40% 15%, rgba(252, 245, 220, 0.5) 0%, transparent 55%),
    radial-gradient(ellipse 100% 90% at 50% 55%, rgba(200, 235, 220, 0.55) 0%, transparent 60%),
    radial-gradient(ellipse 70% 60% at 85% 85%, rgba(195, 215, 240, 0.5) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 10% 80%, rgba(195, 230, 225, 0.4) 0%, transparent 50%),
    linear-gradient(135deg, #f5efe6 0%, #eaf5ef 40%, #e8f0f5 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Cpath d='M0 0h1v1H0zM4 4h1v1H4z' fill='%23000' fill-opacity='0.018'/%3E%3Cpath d='M4 0h1v1H4zM0 4h1v1H0z' fill='%23000' fill-opacity='0.012'/%3E%3C/svg%3E");
  background-size: 8px 8px;
  pointer-events: none; z-index: 0;
}
body::after {
  content: '';
  position: fixed; inset: 0;
  background-image: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,0.012) 3px, rgba(0,0,0,0.012) 4px);
  background-size: 100% 4px;
  pointer-events: none; z-index: 0;
}

#app { max-width: 680px; margin: 0 auto; padding: 20px 18px 90px; position: relative; z-index: 1; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 4px 18px;
}
.wordmark {
  font-family: var(--serif); font-size: 1.35rem; font-weight: 700;
  letter-spacing: -0.01em; cursor: pointer; user-select: none;
}
.wordmark .tilde { color: var(--terra); }
.topnav { display: flex; gap: 14px; align-items: center; }
.topnav a { color: var(--muted); text-decoration: none; font-size: .9rem; cursor: pointer; }
.topnav a:hover { color: var(--ink); }
/* account chip: the persistent "this is yours" anchor + menu trigger */
.topnav-acct {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--hairline); border-radius: 100px;
  padding: 6px 14px 6px 12px; color: var(--ink); font-weight: 600;
  font-size: .9rem; font-family: var(--sans); background: transparent;
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: pointer; transition: border-color .3s, background .2s;
}
.topnav-acct:hover, .topnav-acct.open { border-color: #0C0C0C; }
.topnav-acct.open { background: var(--mid); }
.acct-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--terra);
  flex-shrink: 0;
}
.nav-burger {
  border: 1px solid var(--hairline); background: transparent; cursor: pointer;
  border-radius: 10px; padding: 4px 11px; font-size: 1.1rem; line-height: 1;
  color: var(--ink);
}
.nav-burger:hover, .nav-burger.open { border-color: #0C0C0C; }

/* dropdown menu */
.menu-wrap { position: relative; display: inline-block; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 210px; background: var(--card); border: 1px solid var(--hairline);
  border-radius: 14px; box-shadow: 0 10px 34px rgba(12,12,12,0.14);
  padding: 6px; display: none; z-index: 60;
}
.menu-panel.open { display: block; animation: cardIn .14s ease; }
.menu-item {
  display: block; padding: 10px 12px; border-radius: 9px;
  color: var(--ink); font-size: .92rem; cursor: pointer; text-decoration: none;
  white-space: nowrap;
}
.menu-item:hover { background: var(--mid); color: var(--ink); }
.menu-who { padding: 9px 12px 5px; font-size: .76rem; color: var(--muted); }
.menu-sep { height: 1px; background: var(--hairline); margin: 6px 6px; }
/* the in-menu nav + its separator only exist on mobile */
.menu-nav, .menu-sep-nav { display: none; }
.nav-burger { display: none; }

.keep-space { border-color: var(--hairline); }
.keep-space h3 { margin-bottom: 4px; }

@media (max-width: 640px) {
  /* fold the inline links into the menu; keep the wordmark + trigger */
  .topbar.has-menu .topnav > a { display: none; }
  .menu-nav, .menu-sep-nav { display: block; }
  .nav-burger { display: inline-flex; align-items: center; }
}

h1 { font-family: var(--serif); font-size: 2.1rem; line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-family: var(--serif); font-size: 1.4rem; margin-bottom: .5rem; letter-spacing: -0.01em; }
h3 { font-size: 1.02rem; }
p.lede { color: var(--muted); font-size: 1.06rem; margin: 12px 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
strong { font-weight: 650; }

.card {
  background: var(--card); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 20px; margin: 14px 0;
}
.card.tinted-a { background: var(--violet-soft); border-color: transparent; }
.card.tinted-b { background: var(--terra-soft); border-color: transparent; }

/* ndirector.com buttons: dark pill primary, hairline-outline secondary.
   Pills hug their label: modest padding, fixed line-height — the label,
   not the padding, decides the pill's size. */
.btn {
  display: inline-block; border: none; cursor: pointer; user-select: none;
  background: #0C0C0C; color: #FAFAFA;
  font-size: 1rem; font-weight: 600; font-family: var(--sans);
  line-height: 1.25;
  padding: 11px 24px; border-radius: 100px;
  transition: opacity .3s, transform .3s, border-color .3s;
}
.btn:hover { opacity: .8; transform: translateY(-1px); }
.btn:active { transform: scale(.97); }
.btn.secondary {
  background: transparent; color: #0C0C0C; border: 1px solid #DCDCDC;
  padding: 10px 23px; /* 1px border keeps the height equal to solid pills */
}
.btn.secondary:hover { opacity: 1; border-color: #0C0C0C; }
.btn.quiet {
  background: transparent; color: var(--muted); border: 1px solid var(--hairline);
  font-weight: 500; padding: 10px 23px;
}
.btn.terra { background: #0C0C0C; }
.btn:disabled { opacity: .35; cursor: default; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.btn-row-center { justify-content: center; text-align: center; }
/* hero CTA: blank (transparent) fill, dark text, white outline —
   the outline reads against the card's own surface via its shadow ring */
.btn-hero-outline {
  background: transparent; color: #0C0C0C;
  border: 1.5px solid #FFFFFF;
  box-shadow: 0 0 0 1.5px #0C0C0C, 0 1px 3px rgba(12,12,12,0.08);
  padding: 11.5px 26.5px;
}
.btn-hero-outline:hover { opacity: 1; background: #FAFAFA; }
/* a CTA that opens a card sits flush with the card's own padding —
   no stacked margins pushing it into the middle */
.card > .btn-row:first-child, .card > .btn:first-child { margin-top: 0; }
/* the caption under a button belongs to it: tight gap */
.btn-row + .small, .btn-row + p.small, .btn + .small { margin-top: 9px; }

input[type=text] {
  width: 100%; font-size: 1rem; font-family: var(--sans);
  padding: 10px 18px; line-height: 1.25; border: 1px solid var(--hairline); border-radius: 100px;
  background: var(--card); color: var(--ink); outline: none;
  transition: border-color .3s;
}
input[type=text]:focus { border-color: #0C0C0C; }

/* ---------------- mode picker ---------------- */
.mode-row { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.mode-chip {
  flex: 1 1 30%; min-width: 150px; text-align: left; cursor: pointer;
  border: 1.5px solid var(--hairline); border-radius: 12px; padding: 12px 14px;
  background: var(--card); transition: border-color .12s;
}
.mode-chip.active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.mode-chip .m-name { font-weight: 650; }
.mode-chip .m-sub { color: var(--muted); font-size: .82rem; }

/* ---------------- reflect flow ---------------- */
.progress-track {
  height: 5px; background: var(--hairline); border-radius: 3px;
  margin: 6px 0 26px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: var(--terra); border-radius: 3px;
  transition: width .25s ease;
}
.reflect-stage { min-height: 380px; display: flex; flex-direction: column; justify-content: center; }
.stmt-text {
  font-family: var(--serif); font-size: 1.45rem; line-height: 1.35;
  margin: 8px 0 30px; letter-spacing: -0.01em;
  animation: cardIn .28s ease;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.dot-scale { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin: 4px 0 8px; }
.dot {
  flex: 1; aspect-ratio: 1; max-width: 64px; border-radius: 50%;
  border: 2px solid var(--hairline); background: var(--card); cursor: pointer;
  transition: transform .1s, border-color .1s, background .1s;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; color: transparent;
}
.dot:hover { transform: scale(1.12); border-color: var(--ink); }
.dot.d1, .dot.d2 { border-color: #D9CBF3; }
.dot.d4, .dot.d5 { border-color: #EFD3C4; }
.dot.d1:hover, .dot.d2:hover { background: var(--violet-soft); border-color: var(--violet); }
.dot.d4:hover, .dot.d5:hover { background: var(--terra-soft); border-color: var(--terra); }
.dot.chosen { transform: scale(1.15); }
.scale-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; margin-bottom: 18px; }
.skip-row { text-align: center; margin-top: 18px; }
.skip-link { color: var(--muted); font-size: .85rem; background: none; border: none; cursor: pointer; text-decoration: underline; }

.img-frame {
  border-radius: var(--radius); overflow: hidden; margin: 4px 0 18px;
  aspect-ratio: 4 / 3; background: var(--mid); position: relative;
}
.img-frame img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  animation: kenburns 6s ease-out forwards;
}
@keyframes kenburns { from { transform: scale(1.06); } to { transform: scale(1.0); } }
.img-dots .dot { max-width: 48px; }
.img-caption {
  text-align: center; color: var(--muted); font-size: .86rem;
  margin: -8px 0 12px; font-style: italic;
}

.interstitial { text-align: center; }
.interstitial .big {
  font-family: var(--serif); font-size: 1.6rem; margin: 16px 0; line-height: 1.3;
}

/* ---------------- result ---------------- */
.hex-wrap { display: flex; flex-direction: column; align-items: center; }
.hex-svg { width: 100%; max-width: 430px; height: auto; }
.axis-label { font-size: 11.5px; fill: var(--ink); font-weight: 600; font-family: var(--sans); }
.axis-sublabel { font-size: 9.5px; fill: var(--muted); font-family: var(--sans); }
.legend-row { display: flex; gap: 16px; justify-content: center; margin: 8px 0 4px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); cursor: pointer; user-select: none; }
.legend-swatch { width: 18px; height: 4px; border-radius: 2px; }
.legend-item.off { opacity: .35; }
.signature {
  font-family: var(--serif); font-size: 1.18rem; line-height: 1.45;
  text-align: center; margin: 14px auto 6px; max-width: 480px;
}
.axis-rows { margin-top: 20px; }
.axis-legend {
  background: var(--cream); border-radius: 8px; padding: 7px 10px;
  margin: 8px 0 4px; font-size: .74rem; line-height: 1.5;
}
.axis-row {
  display: grid; grid-template-columns: 86px 1fr 86px 14px; gap: 10px; align-items: center;
  padding: 11px 6px; border-bottom: 1px solid var(--hairline); cursor: pointer;
}
.axis-mid { display: flex; flex-direction: column; gap: 5px; }
.wvg-pill {
  align-self: center; font-size: .66rem; font-weight: 650; color: var(--terra);
  background: var(--terra-soft); border-radius: 100px; padding: 1px 9px;
}
.axis-chevron {
  color: var(--muted); font-size: 1.1rem; line-height: 1;
  transition: transform .15s; user-select: none;
}
.axis-chevron.open { transform: rotate(90deg); }
.axis-row:hover { background: rgba(0,0,0,.02); }
.axis-pole { font-size: .8rem; color: var(--muted); }
.axis-pole.right { text-align: right; }
.axis-pole.dominant { color: var(--ink); font-weight: 650; }
.axis-track { position: relative; height: 8px; background: var(--mid); border-radius: 4px; }
.axis-center { position: absolute; left: 50%; top: -3px; width: 1.5px; height: 14px; background: var(--hairline); }
.axis-marker {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 25px; height: 25px; border-radius: 100px;
  background: var(--card); border: 1.5px solid var(--hairline);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; line-height: 1; box-shadow: 0 1px 3px rgba(0,0,0,.18);
  pointer-events: auto;
}
.axis-marker.said { z-index: 2; }
.axis-marker.gut { width: 21px; height: 21px; font-size: .64rem; opacity: .92; }
.mismatch-flag { font-size: .78rem; color: var(--terra); margin-left: 4px; }

.explainer { background: var(--cream); border-radius: 12px; padding: 14px 16px; margin: 8px 0; animation: cardIn .2s ease; }
.consult-card { border-left: 3px solid var(--terra); }
.consult-card.k-mismatch { border-left-color: var(--violet); }
.consult-card.k-question, .consult-card.k-bridge { border-left-color: var(--good); }
.consult-card h3 { margin-bottom: 6px; }
.consult-kicker { text-transform: uppercase; letter-spacing: .08em; font-size: .7rem; color: var(--muted); margin-bottom: 2px; }

/* ---------------- circles ---------------- */
.circle-item { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--hairline); }
.member-status { margin-left: auto; font-size: .85rem; color: var(--muted); }
.member-status .done { color: var(--good); font-weight: 650; }
.invite-box {
  display: flex; gap: 8px; align-items: center; background: var(--cream);
  border-radius: 10px; padding: 10px 12px; margin-top: 10px;
}
.group-code-band {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--terra-soft); border-radius: 12px; padding: 12px 16px; margin-top: 12px;
}
.group-code-label {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
}
.group-code {
  font-family: var(--serif); font-size: 1.7rem; font-weight: 700;
  letter-spacing: .12em; color: var(--ink);
}
.admin-circle-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.invite-box code { font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

.toggle-row { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.toggle-chip {
  border: 1px solid var(--hairline); background: transparent; border-radius: 100px;
  padding: 6px 14px; font-size: .82rem; line-height: 1.3; cursor: pointer; color: var(--muted);
  transition: border-color .3s, background .3s, color .3s;
}
.toggle-chip:hover { border-color: var(--ink); color: var(--ink); }
.toggle-chip.active {
  border-color: #0C0C0C; background: #0C0C0C; color: #FAFAFA; font-weight: 600;
}
.lang-row { margin: 4px 0 20px; }

.heatmap { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
.heatmap th { font-size: .74rem; font-weight: 600; color: var(--muted); padding: 4px 2px; overflow: hidden; text-overflow: ellipsis; }
.heatmap th.rowhead { text-align: left; width: 34%; font-weight: 500; }
.heatmap td {
  height: 44px; border-radius: 8px; text-align: center; font-size: .72rem;
  cursor: default; position: relative; color: var(--ink);
}
.heatmap td.gap-edge { outline: 2px solid var(--ink); outline-offset: -2px; }
.heatmap tr.row-muted td { opacity: .3; }
.heatmap td.paircell { cursor: pointer; }
.heatmap td.paircell:hover { outline: 2px solid var(--ink); outline-offset: -2px; }
.heatmap td.inert { background: var(--mid); opacity: .4; }
.hm-note { font-size: .8rem; color: var(--muted); margin-top: 8px; }
.hm-scale { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .76rem; color: var(--muted); }
.hm-scale .bar { flex: 1; height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, #6E56CF, #EFEAE3 50%, #C4643B); }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(38,34,30,.45); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: var(--cream); border-radius: 20px 20px 0 0; width: 100%; max-width: 680px;
  max-height: 86vh; overflow-y: auto; padding: 22px 20px 40px;
  animation: slideUp .22s ease;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.modal-close { float: right; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--muted); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--cream); border-radius: 100px;
  padding: 10px 22px; font-size: .9rem; z-index: 99; animation: cardIn .2s ease;
}

.footer-note { text-align: center; color: var(--muted); font-size: .78rem; margin-top: 40px; }
.footer-note a { color: var(--muted); }

/* ---------------- emoji chips + swipe ---------------- */
.chip-row { display: flex; justify-content: center; gap: 9px; margin: 4px 0 8px; }
.chip {
  min-width: 52px; height: 52px; padding: 0 10px; border-radius: 100px;
  border: 2px solid var(--hairline); background: var(--card); cursor: pointer;
  font-size: 1.35rem; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: transform .1s, border-color .1s, background .1s;
  letter-spacing: -2px;
}
.chip:hover { transform: scale(1.12); border-color: var(--ink); }
.chip.neg:hover { background: var(--violet-soft); border-color: var(--violet); }
.chip.pos:hover { background: var(--terra-soft); border-color: var(--terra); }
.chip.pending { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); transform: scale(1.12); }
.chip.chosen { transform: scale(1.22); border-color: var(--ink); }

.swipe-card {
  position: relative; touch-action: pan-y; user-select: none; cursor: grab;
  will-change: transform;
}
.swipe-card.dragging { cursor: grabbing; }
.swipe-card.dragging .stmt-text, .swipe-card.dragging img { pointer-events: none; }
.swipe-badge {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  background: var(--terra); color: #fff; border-radius: 100px;
  padding: 8px 18px; font-size: 1.05rem; font-weight: 700; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 5;
  box-shadow: 0 3px 10px rgba(0,0,0,.18);
}
.swipe-badge.show { opacity: 1; }
.swipe-badge.neg { background: var(--violet); }

.gesture-hint {
  text-align: center; color: var(--muted); font-size: .8rem; margin-top: 14px;
  animation: cardIn .3s ease;
}

/* ---------------- topic packs + atlas ---------------- */
.pack-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 11px 0; border-top: 1px solid var(--hairline); margin-top: 10px;
}
.pack-title { font-weight: 650; font-size: .95rem; }

.drow {
  display: grid; grid-template-columns: 118px 1fr; gap: 12px; align-items: center;
  padding: 10px 4px; border-bottom: 1px solid var(--hairline);
}
.drow:last-child { border-bottom: none; }
.drow-hot { background: var(--terra-soft); border-radius: 10px; }
.dlab { font-size: .8rem; line-height: 1.25; }
.dlab .small { display: block; }
.dtrack { position: relative; height: 10px; background: var(--mid); border-radius: 5px; }
.dline {
  position: absolute; top: 50%; height: 3px; transform: translateY(-50%);
  background: #D8CBBE; border-radius: 2px;
}
.ddot {
  position: absolute; top: 50%; width: 13px; height: 13px; border-radius: 50%;
  transform: translate(-50%, -50%); border: 2.5px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.ddot.pred {
  width: 11px; height: 11px; background: var(--card);
  border: 2.5px solid var(--muted); box-shadow: none;
}

.daily-grid {
  font-size: 1.6rem; letter-spacing: 4px; margin: 8px 0; user-select: all;
}

.predict-row { margin: 12px 0; }
.predict-labels {
  display: flex; justify-content: space-between; margin-bottom: 3px;
  font-weight: 600;
}
.predict-slider {
  width: 100%; accent-color: var(--terra); height: 22px; cursor: pointer;
}
.predict-btn { padding: 5px 12px; font-size: .78rem; margin: 0 8px; flex-shrink: 0; }
.reveal-row {
  width: 100%; padding: 10px 0; border-top: 1px solid var(--hairline);
}
.reveal-row > p { font-weight: 650; margin: 4px 0 6px; }

.shelves { width: 100%; margin-top: 14px; }
.shelves .consult-kicker { margin-top: 10px; }
.shelf { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.tcard {
  border: 1px solid var(--hairline); border-left: 4px solid var(--terra);
  background: var(--card); border-radius: 10px; padding: 7px 12px;
  font-size: .8rem; font-weight: 600;
}
.tcard.v { border-left-color: var(--violet); }

.erow {
  display: grid; grid-template-columns: 130px 1fr; gap: 10px; align-items: center;
  margin: 7px 0; width: 100%;
}
.elab { font-size: .8rem; font-weight: 650; text-align: right; }
.ebar { height: 15px; border-radius: 8px; display: flex; overflow: hidden; background: var(--mid); }
.eseg { height: 100%; }

.next-unlock {
  background: var(--violet-soft); border-radius: 100px; padding: 9px 18px;
  font-size: .8rem; margin-top: 14px; display: inline-block;
}

.heatmap td.defcell { cursor: pointer; }
.heatmap td.defcell:hover { outline: 2px solid var(--muted); outline-offset: -2px; }
.def-person {
  background: var(--cream); border-radius: 8px; padding: 8px 12px;
  font-weight: 650; font-size: .9rem; margin: 4px 0 10px;
}
.def-card { margin: 10px 0; padding: 14px 16px; }

/* topic drill-ins on the heat map */
.topic-section { margin-top: 12px; border: 1px solid var(--hairline); border-radius: 12px; overflow: hidden; }
.topic-head {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  background: var(--cream); border: none; padding: 11px 14px; cursor: pointer;
  font-size: .9rem; font-family: var(--sans); color: var(--ink); text-align: left;
}
.topic-head:hover { background: var(--mid); }
.topic-chevron { color: var(--muted); font-size: 1.1rem; transition: transform .15s; }
.topic-chevron.open { transform: rotate(90deg); }
.topic-body { padding: 10px 12px 12px; }

/* ---------------- UX pass additions ---------------- */
.btn-big { font-size: 1.05rem; padding: 13px 28px; }

.depth-details { margin-top: 16px; }
.depth-details summary {
  cursor: pointer; color: var(--muted); font-size: .88rem; user-select: none;
  list-style-position: inside;
}
.depth-details summary:hover { color: var(--ink); }

.invite-banner h2 { margin-bottom: 4px; }

.progress-parts { display: flex; gap: 14px; align-items: flex-end; margin: 4px 0 24px; }
.progress-seg { flex: 1; }
.progress-seg.dim { opacity: .38; }
.progress-label {
  font-size: .68rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 5px;
}
.progress-parts .progress-track { margin: 0; }
.undo-btn {
  border: 1px solid var(--hairline); background: var(--card); color: var(--muted);
  border-radius: 100px; font-size: .78rem; padding: 5px 12px; cursor: pointer;
  white-space: nowrap; align-self: center;
}
.undo-btn:hover { color: var(--ink); border-color: var(--ink); }

.halfway-note {
  text-align: center; color: var(--terra); font-size: .85rem; font-weight: 600;
  margin-bottom: 10px; animation: cardIn .3s ease;
}
.key-hint { text-align: center; color: var(--muted); font-size: .74rem; margin-top: 14px; }

.scale-wrap { transition: opacity .45s ease; }
.scale-wrap.scale-hidden { opacity: 0; pointer-events: none; }

.name-card { border-color: var(--terra); }
.name-row { display: flex; gap: 12px; margin-top: 12px; align-items: center; }
.name-row input { flex: 1; min-width: 0; max-width: 460px; }

/* result reveal: fingerprint draws itself, then the words arrive */
.hex-reveal .series-poly, .hex-reveal .series-dot {
  transform-box: view-box; transform-origin: 50% 52%;
  animation: hexGrow .95s cubic-bezier(.2, .8, .3, 1) .15s both;
}
@keyframes hexGrow {
  from { transform: scale(.05); opacity: 0; }
  60% { opacity: 1; }
  to { transform: scale(1); opacity: 1; }
}
.hex-reveal .legend-row, .hex-reveal .signature, .hex-reveal > p {
  animation: fadeUp .5s ease .85s both;
}
.card-stagger { animation: fadeUp .45s ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.share-modal { text-align: center; }
.share-preview {
  width: 100%; max-width: 360px; border: 1px solid var(--hairline);
  border-radius: 12px; margin: 10px auto; display: block;
}
.share-modal .btn-row { justify-content: center; }

/* ---------------- responsive: mobile tightening ---------------- */
@media (max-width: 480px) {
  h1 { font-size: 1.7rem; }
  .stmt-text { font-size: 1.25rem; }
  .axis-row { grid-template-columns: 70px 1fr 70px 12px; }
  .progress-label { font-size: .6rem; }
}

/* ---------------- responsive: desktop layout ---------------- */
@media (min-width: 920px) {
  #app { max-width: 960px; padding: 28px 32px 90px; }
  h1 { font-size: 2.5rem; }
  p.lede { max-width: 620px; }
  .card { padding: 26px 28px; border-radius: 18px; margin: 18px 0; }
  .btn { padding: 12px 26px; }
  .btn.secondary, .btn.quiet { padding: 11px 25px; }
  .btn-big { padding: 14px 30px; }

  /* result: fingerprint and axis detail side by side */
  .result-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start;
  }
  .result-grid .card { margin: 14px 0 0; }
  .hex-svg { max-width: 500px; }
  .signature { font-size: 1.24rem; }

  /* reflect flow stays a focused column even on wide screens */
  .reflect-stage, .progress-parts { max-width: 640px; margin-left: auto; margin-right: auto; }
  .progress-parts { margin-bottom: 26px; }

  /* consultation cards flow two-up */
  .consult-card { display: inline-block; width: calc(50% - 8px); vertical-align: top; }
  .consult-card + .consult-card { margin-left: 0; }
  div:has(> .consult-card) { display: flex; flex-wrap: wrap; gap: 14px; }
  div:has(> .consult-card) .consult-card { width: calc(50% - 7px); margin: 0; }
  div:has(> .consult-card) h2 { width: 100%; margin-bottom: 0; }

  /* heat map gets room to breathe */
  .heatmap td { height: 52px; font-size: .8rem; }
  .heatmap th { font-size: .8rem; }

  /* modals center on desktop instead of bottom-sheeting */
  .modal-overlay { align-items: center; }
  .modal { border-radius: 20px; max-width: 720px; max-height: 82vh; }
}
