/* Tell Me Things: styles. Mobile first. Flat colour, no gradients, no shadows. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque-latin-800-normal.woff2") format("woff2");
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --paper: #FFFFFF;
  --ink: #1C2554;
  --ink-soft: #555C80;
  --rose: #D1356A;
  --rose-dark: #A8234F;
  --cobalt: #2F5BEA;
  --blush: #FFD9E6;
  --blush-light: #FFEEF4;
  --sky: #DCE6FF;
  --sky-light: #EEF3FF;
  --mist: #EEF0F7;
  --line: #C9CDE0;

  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-code: ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", monospace;

  --r-slab: 24px;
  --r-card: 20px;
  --r-chip: 14px;
  --r-tag: 8px;
  --r-pill: 999px;

  --pad: clamp(16px, 5vw, 24px);
  --col: 480px;
  --tap: 48px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

img, svg { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { touch-action: manipulation; }
[hidden] { display: none !important; }

:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}

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

.noscript { padding: var(--pad); }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--col);
  margin: 0 auto;
  padding: calc(8px + var(--safe-top)) var(--pad) 8px;
  background: var(--paper);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: auto; height: 32px; flex: none; }
.wordmark { display: flex; flex-direction: column; line-height: 1; }
.wm-big {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.02em;
}
.wm-small {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* Logo lockup used on the start screen, loading screen and PDF */
.lockup { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.lockup-mark { width: clamp(132px, 42vw, 180px); height: auto; }
.lockup .wm-big { font-size: clamp(56px, 18vw, 76px); letter-spacing: 0.01em; line-height: 0.9; }
.lockup .wm-small { font-size: clamp(17px, 4.8vw, 20px); margin-top: 6px; color: var(--ink); }
.lockup-center { align-items: center; text-align: center; }
.lockup-center .wordmark { align-items: center; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  margin-right: -8px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.icon-btn .i-on { display: none; }
.icon-btn[aria-pressed="true"] .i-on { display: inline; }
.icon-btn[aria-pressed="true"] .i-off { display: none; }
@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover { background: var(--mist); }
}

.progress {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  bottom: 0;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--mist);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 100%;
  background: var(--rose);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 300ms var(--ease-out);
}

/* ---------- screens ---------- */

.app {
  max-width: var(--col);
  margin: 0 auto;
  padding: 8px var(--pad) calc(32px + var(--safe-bottom));
  min-height: calc(100dvh - 64px - var(--safe-top));
}
.app:focus { outline: none; }
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }
body[data-screen="welcome"] .brand { visibility: hidden; }
.center { text-align: center; }

.screen { display: flex; flex-direction: column; gap: 20px; }
.screen-fill { min-height: calc(100dvh - 104px - var(--safe-top) - var(--safe-bottom)); }
.screen-enter { animation: enter 220ms var(--ease-out) both; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.push-bottom { margin-top: auto; }

h1, h2, h3 { margin: 0; font-family: var(--font-display); color: var(--ink); }
.h1 {
  font-weight: 800;
  font-size: clamp(28px, 8vw, 34px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.h2 {
  font-weight: 800;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.h3 { font-weight: 600; font-size: 18px; line-height: 1.25; }
p { margin: 0; }
.lead { font-size: 18px; }
.muted { color: var(--ink-soft); }
.small { font-size: 15px; }
.tight { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; gap: 12px; align-items: center; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 0 24px;
  border: 2px solid transparent;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 160ms ease, color 160ms ease;
  user-select: none;
  -webkit-user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn[disabled], .btn[aria-disabled="true"] { cursor: not-allowed; opacity: 0.45; transform: none; }
.btn-block { width: 100%; }
.btn-primary { background: var(--rose); color: var(--paper); }
.btn-secondary { background: var(--paper); color: var(--ink); border-color: var(--ink); }
.btn-soft { background: var(--sky); color: var(--ink); }
.btn-danger { background: var(--ink); color: var(--paper); }
.btn-text {
  min-height: var(--tap);
  padding: 0 12px;
  background: transparent;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--rose-dark); }
  .btn-secondary:hover, .btn-soft:hover { background: var(--mist); }
  .btn-text:hover { color: var(--rose-dark); }
}
.btn-row { display: flex; gap: 12px; }
.btn-row > .btn { flex: 1; }
.actions { display: flex; flex-direction: column; gap: 12px; }

/* ---------- forms ---------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; }
.field .hint { font-size: 15px; color: var(--ink-soft); }
.input, .textarea {
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  border: 2px solid var(--ink);
  border-radius: var(--r-chip);
  background: var(--paper);
  font-size: 18px;
}
.textarea { min-height: 96px; resize: vertical; font-family: var(--font-code); letter-spacing: 0.04em; }
.input:focus-visible, .textarea:focus-visible { outline-offset: 2px; }
.error {
  padding: 12px 14px;
  border-radius: var(--r-tag);
  background: var(--blush);
  font-weight: 700;
}

/* ---------- welcome ---------- */

.welcome { padding-top: 12px; }
.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(44px, 14vw, 64px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 0;
}
.hero-wheel {
  width: min(100%, 360px);
  margin: 4px auto -8px;
  aspect-ratio: 2 / 1;
  overflow: hidden;
}
.hero-wheel svg { width: 100%; height: auto; }
.pill-note {
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--sky);
  font-size: 15px;
  font-weight: 700;
}

/* ---------- mood ---------- */

.mood-wrap { display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; align-items: stretch; }
.mood-axis-y {
  display: flex; flex-direction: column; justify-content: space-between;
  font-size: 13px; font-weight: 700; color: var(--ink-soft);
  writing-mode: vertical-rl; transform: rotate(180deg);
  text-align: center;
}
.mood-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mood-cell {
  min-height: 76px;
  padding: 8px;
  border: 2px solid var(--ink);
  border-radius: var(--r-chip);
  background: var(--paper);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 160ms ease;
}
.mood-cell[data-v="-1"] { background: var(--sky-light); }
.mood-cell[data-v="1"] { background: var(--blush-light); }
.mood-cell:active { transform: scale(0.96); }
.mood-cell[aria-pressed="true"] { background: var(--rose); color: var(--paper); border-color: var(--rose); }
.mood-axis-x {
  grid-column: 2;
  display: flex; justify-content: space-between;
  font-size: 13px; font-weight: 700; color: var(--ink-soft);
}

/* ---------- wheel ---------- */

.wheel-wrap {
  position: relative;
  width: min(100%, 340px);
  margin: 0 auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.wheel-wrap:focus-visible { outline-offset: 6px; border-radius: 50%; }
.wheel-svg { width: 100%; height: auto; overflow: visible; }
.wheel-rotor { transform-origin: 0 0; }
.seg { stroke: var(--ink); stroke-width: 1.5; }
.seg-blush { fill: var(--blush); }
.seg-sky { fill: var(--sky); }
.seg-white { fill: var(--paper); }
.seg-done { fill: var(--mist); }
.seg-active { fill: var(--rose); }
.seg-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 9.5px;
  fill: var(--ink);
  pointer-events: none;
}
.seg-label-done { fill: var(--ink-soft); }
.seg-label-active { fill: var(--paper); }
.wheel-rim { fill: none; stroke: var(--ink); stroke-width: 3; }
.wheel-hub { fill: var(--ink); }
.wheel-hub-text { font-family: var(--font-display); font-weight: 800; font-size: 11px; fill: var(--paper); pointer-events: none; }
.wheel-hub-dot { fill: var(--rose); }
.wheel-pointer { fill: var(--rose); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.wheel-hit { cursor: pointer; }

.wheel-list { display: flex; flex-direction: column; gap: 8px; }
.wheel-list .btn { justify-content: space-between; }

.round-sheet {
  display: flex; flex-direction: column; gap: 12px;
  padding: 20px;
  border: 2px solid var(--ink);
  border-radius: var(--r-card);
  background: var(--paper);
}
.round-sheet .h2 { font-size: 24px; }
.round-count { font-size: 15px; font-weight: 700; color: var(--ink-soft); }

/* ---------- card screens ---------- */

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.round-name { margin: 0; font-family: var(--font-body); font-weight: 700; font-size: 15px; line-height: 1.4; color: var(--ink-soft); }
.dots { display: flex; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink); background: transparent; }
.dot-done { background: var(--ink); }
.dot-now { background: var(--rose); border-color: var(--rose); }

.slab {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 188px;
  padding: 28px 24px;
  border-radius: var(--r-slab);
  background: var(--blush);
}
.slab-sky { background: var(--sky); }
.slab-white { background: var(--paper); border: 2px solid var(--ink); }
.slab-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(22px, 6.4vw, 27px);
  line-height: 1.22;
  letter-spacing: -0.01em;
}
.slab:focus-visible { outline-offset: 4px; border-radius: var(--r-slab); }
.card-enter { animation: enter 200ms var(--ease-out) both; }
.prompt { font-weight: 700; }

.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }

/* faces */
.faces { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.face-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-height: 82px;
  padding: 8px 2px 6px;
  border: 0;
  border-radius: var(--r-chip);
  background: transparent;
  cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 160ms ease;
}
.face-btn svg { width: 46px; height: 46px; }
.face-btn span { font-size: 14px; font-weight: 700; }
.face-btn:active { transform: scale(0.94); }
.face-btn[aria-pressed="true"] { background: var(--blush); }
.face-btn[aria-pressed="true"] .face-bg { fill: var(--rose); }
.face-btn[aria-pressed="true"] .face-line { stroke: var(--paper); }
.face-btn[aria-pressed="true"] .face-fill { fill: var(--paper); }
.face-bg { fill: var(--paper); stroke: var(--ink); stroke-width: 2.4; }
.face-line { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.face-fill { fill: var(--ink); }
.face-cheek { fill: var(--rose); }
.face-heart { fill: var(--rose); }
.face-btn[aria-pressed="true"] .face-cheek, .face-btn[aria-pressed="true"] .face-heart { fill: var(--blush); }
@media (hover: hover) and (pointer: fine) { .face-btn:hover { background: var(--blush-light); } }

/* drag card */
.drag-zone { position: relative; touch-action: pan-y; }
.drag-card {
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
  transition: background-color 120ms ease;
}
.drag-card.dragging { cursor: grabbing; transition: none; }
.drag-card.settle { transition: transform 220ms var(--ease-out), opacity 200ms ease, background-color 120ms ease; }
.drag-card[data-step="0"] { background: var(--sky); }
.drag-card[data-step="1"] { background: var(--sky-light); }
.drag-card[data-step="2"] { background: var(--paper); }
.drag-card[data-step="3"] { background: var(--blush-light); }
.drag-card[data-step="4"] { background: var(--blush); }
.drag-hint { font-size: 15px; color: var(--ink-soft); text-align: center; }
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.step-btn {
  min-height: 56px;
  padding: 6px 4px;
  border: 2px solid var(--ink);
  border-radius: var(--r-chip);
  background: var(--paper);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;
  cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 120ms ease, color 120ms ease;
}
.step-btn:active { transform: scale(0.95); }
.step-btn.lit, .step-btn[aria-pressed="true"] { background: var(--rose); border-color: var(--rose); color: var(--paper); }

/* that's me scale */
.me-scale { display: flex; flex-direction: column; gap: 8px; }
.me-row { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.me-btn {
  display: grid; place-items: center;
  width: 60px; height: 60px;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
}
.me-btn i {
  display: block;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  background: var(--paper);
  transition: transform 140ms var(--ease-out), background-color 140ms ease;
}
.me-btn:nth-child(1) i, .me-btn:nth-child(5) i { width: 50px; height: 50px; }
.me-btn:nth-child(2) i, .me-btn:nth-child(4) i { width: 40px; height: 40px; }
.me-btn:nth-child(3) i { width: 30px; height: 30px; }
.me-btn:nth-child(1) i, .me-btn:nth-child(2) i { background: var(--sky-light); }
.me-btn:nth-child(4) i, .me-btn:nth-child(5) i { background: var(--blush-light); }
.me-btn:active i { transform: scale(0.9); }
.me-btn[aria-pressed="true"] i { background: var(--rose); border-color: var(--rose); }
.me-ends { display: flex; justify-content: space-between; font-size: 15px; font-weight: 700; }

/* chips and reactions */
.chip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chip {
  display: flex; align-items: center; gap: 10px;
  min-height: 60px;
  padding: 10px 14px;
  border: 2px solid var(--ink);
  border-radius: var(--r-chip);
  background: var(--paper);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 140ms ease, color 140ms ease, opacity 140ms ease;
}
.chip:active { transform: scale(0.97); }
.chip .tick {
  flex: none; width: 22px; height: 22px;
  border-radius: 6px; border: 2px solid currentColor;
  display: grid; place-items: center;
}
.chip .tick svg { width: 14px; height: 14px; opacity: 0; }
.chip[aria-pressed="true"] { background: var(--rose); border-color: var(--rose); color: var(--paper); }
.chip[aria-pressed="true"] .tick svg { opacity: 1; }
.chip[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; }
.chip-count { font-size: 15px; font-weight: 700; color: var(--ink-soft); }

/* duel */
.duel { display: flex; flex-direction: column; gap: 12px; }
.duel-card {
  min-height: 120px;
  padding: 20px;
  border: 2px solid var(--ink);
  border-radius: var(--r-card);
  background: var(--blush);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 21px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 140ms ease, color 140ms ease;
}
.duel-card + .duel-or + .duel-card { background: var(--sky); }
.duel-card:active { transform: scale(0.98); }
.duel-card[aria-pressed="true"] { background: var(--rose); color: var(--paper); border-color: var(--rose); }
.duel-or { text-align: center; font-weight: 700; color: var(--ink-soft); }

/* ---------- reveal ---------- */

.reveal { align-items: center; justify-content: center; text-align: center; }
.reveal .lockup-mark { width: clamp(150px, 48vw, 200px); }
.typing { display: flex; gap: 10px; justify-content: center; }
.typing span {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--rose);
  animation: bounce 900ms var(--ease-in-out) infinite;
}
.typing span:nth-child(2) { background: var(--cobalt); animation-delay: 120ms; }
.typing span:nth-child(3) { animation-delay: 240ms; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-8px); } }

/* ---------- dashboard ---------- */

.dash-head { display: flex; flex-direction: column; gap: 10px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: var(--mist);
  font-size: 15px;
  font-weight: 700;
}
.tag-sky { background: var(--sky); }
.tag-blush { background: var(--blush); }
.tag-line { background: var(--paper); border: 2px solid var(--ink); }

.arch-list { display: flex; flex-direction: column; gap: 12px; }
.arch {
  border-radius: var(--r-card);
  background: var(--blush);
}
.arch:nth-child(2n) { background: var(--paper); box-shadow: inset 0 0 0 2px var(--ink); }
.arch summary {
  display: flex; flex-direction: column; gap: 6px;
  padding: 20px 20px 18px;
  list-style: none;
  cursor: pointer;
  border-radius: var(--r-card);
}
.arch summary::-webkit-details-marker { display: none; }
.arch-kind { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.arch-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(24px, 7vw, 30px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.arch-term { font-size: 15px; font-weight: 700; color: var(--ink-soft); }
.arch-more { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.arch-more svg { width: 14px; height: 14px; transition: transform 200ms var(--ease-out); }
.arch[open] .arch-more svg { transform: rotate(180deg); }
.arch-body { display: flex; flex-direction: column; gap: 12px; padding: 0 20px 20px; }
.arch-body h3 { font-size: 16px; font-family: var(--font-body); font-weight: 700; }
.conf {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  background: var(--paper);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.conf i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); display: block; }
.conf-medium i { background: transparent; border: 2px solid var(--ink); }
.conf-loose i { background: transparent; border: 2px dashed var(--ink); }

.section { display: flex; flex-direction: column; gap: 14px; padding-top: 12px; border-top: 2px solid var(--ink); }
.section-note { font-size: 15px; color: var(--ink-soft); }

.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: flex; flex-direction: column; gap: 6px; }
.bar-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; font-weight: 700; }
.bar-top .lvl { margin-left: auto; text-align: right; }
.bar-top .lvl { color: var(--ink-soft); font-size: 15px; }
.track { position: relative; height: 14px; border-radius: var(--r-pill); background: var(--mist); }
.fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--r-pill); background: var(--rose); }
.fill-them { background: var(--cobalt); }
.track-pair { display: flex; flex-direction: column; gap: 4px; }
.track-pair .track { height: 10px; }
.range {
  position: absolute; top: -4px; bottom: -4px;
  border-left: 2px solid var(--ink); border-right: 2px solid var(--ink);
}
.range::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px solid var(--ink); }

.bipolar { display: flex; flex-direction: column; gap: 6px; }
.bipolar-ends { display: flex; justify-content: space-between; font-size: 15px; color: var(--ink-soft); font-weight: 700; }
.bi-track { position: relative; height: 14px; border-radius: var(--r-pill); background: var(--mist); }
.bi-mid { position: absolute; left: 50%; top: -4px; bottom: -4px; border-left: 2px solid var(--ink); }
.bi-fill { position: absolute; top: 0; bottom: 0; background: var(--rose); border-radius: var(--r-pill); }
.bi-dot {
  position: absolute; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border-radius: 50%; border: 2px solid var(--paper); background: var(--rose);
}
.bi-dot-them { background: var(--cobalt); }
.bi-track.pair { height: 26px; }
.bi-track.pair .bi-dot { width: 16px; height: 16px; margin: -8px 0 0 -8px; top: 30%; }
.bi-track.pair .bi-dot-them { top: 70%; }

.moments { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.moment { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: var(--r-chip); background: var(--mist); }
.moment-name { font-weight: 700; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  display: inline-flex; align-items: center;
  min-height: 30px; padding: 3px 12px;
  border-radius: var(--r-pill);
  background: var(--rose); color: var(--paper);
  font-size: 15px; font-weight: 700;
}
.pill-them { background: var(--cobalt); }
.pill-none { background: transparent; color: var(--ink-soft); padding-left: 0; }

.map { width: min(100%, 320px); margin: 0 auto; }
.map-zone { fill: var(--paper); stroke: var(--line); stroke-width: 1; }
.map-zone-you { fill: var(--blush-light); }
.map-axis { fill: none; stroke: var(--ink); stroke-width: 2; }
.map-label { font-family: var(--font-body); font-size: 12px; font-weight: 700; fill: var(--ink); }
.map-axis-label { font-family: var(--font-body); font-size: 11px; font-weight: 700; fill: var(--ink-soft); }
.map-conf { fill: none; stroke: var(--rose); stroke-width: 2; stroke-dasharray: 4 4; }
.map-conf-them { stroke: var(--cobalt); }
.map-dot { fill: var(--rose); stroke: var(--paper); stroke-width: 3; }
.map-dot-them { fill: var(--cobalt); }

.notes { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.note { padding: 16px; border-radius: var(--r-chip); border: 2px solid var(--ink); }
.note h3 { font-family: var(--font-body); font-size: 17px; font-weight: 700; margin-bottom: 4px; }

/* explorer */
.tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tab {
  min-height: var(--tap);
  padding: 8px 12px;
  border: 2px solid var(--ink);
  border-radius: var(--r-pill);
  background: var(--paper);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.explore-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 20px;
  border-radius: var(--r-card);
  border: 2px solid var(--ink);
}
.explore-card h3 { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
.explore-card dl { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.explore-card dt { font-weight: 700; }
.explore-card dd { margin: 0; }
.you-here { display: flex; flex-wrap: wrap; gap: 6px; }
.explore-tools { display: flex; justify-content: center; }

/* share */
.toggles { display: flex; flex-direction: column; gap: 8px; }
.toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px;
  padding: 8px 14px;
  border-radius: var(--r-chip);
  background: var(--sky-light);
  font-weight: 700;
  cursor: pointer;
}
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch {
  position: relative; flex: none;
  width: 52px; height: 32px;
  border-radius: var(--r-pill);
  background: var(--line);
  transition: background-color 160ms ease;
}
.switch::after {
  content: ""; position: absolute; top: 4px; left: 4px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--paper);
  transition: transform 180ms var(--ease-out);
}
.toggle input:checked + .switch { background: var(--rose); }
.toggle input:checked + .switch::after { transform: translateX(20px); }
.toggle input:focus-visible + .switch { outline: 3px solid var(--ink); outline-offset: 3px; }
.code-box {
  padding: 18px 16px;
  border-radius: var(--r-chip);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-code);
  font-size: clamp(16px, 4.6vw, 19px);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.6;
  user-select: all;
  -webkit-user-select: all;
}
.code-group { display: inline-block; white-space: nowrap; }
.warn { padding: 12px 14px; border-radius: var(--r-tag); background: var(--blush-light); font-size: 15px; font-weight: 700; }

/* compare */
.legend { display: flex; gap: 16px; font-weight: 700; font-size: 15px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 50%; display: block; }
.legend .you i { background: var(--rose); }
.legend .them i { background: var(--cobalt); }
.list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.list li { padding: 12px 14px; border-radius: var(--r-chip); background: var(--mist); }
.talk { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.talk li { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--r-card); background: var(--paper); box-shadow: inset 0 0 0 2px var(--ink); }
.talk li.who-you { background: var(--blush); box-shadow: none; }
.talk li.who-them { background: var(--sky); box-shadow: none; }
.talk .q { font-family: var(--font-display); font-weight: 600; font-size: 19px; line-height: 1.25; }

/* about */
.about p + p { margin-top: 14px; }

/* ---------- toast and dialog ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + var(--safe-bottom));
  z-index: 40;
  max-width: calc(100% - 2 * var(--pad));
  padding: 12px 20px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  transform: translateX(-50%);
  pointer-events: none;
  animation: toast-in 200ms var(--ease-out) both;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

.dialog {
  width: min(calc(100% - 32px), 420px);
  padding: 24px;
  border: 2px solid var(--ink);
  border-radius: var(--r-card);
  background: var(--paper);
  color: var(--ink);
}
.dialog::backdrop { background: rgba(28, 37, 84, 0.45); }
.dialog-title { font-family: var(--font-display); font-weight: 800; font-size: 22px; margin-bottom: 8px; }
.dialog-actions { display: flex; gap: 10px; margin-top: 20px; }
.dialog-actions .btn { flex: 1; min-height: 52px; padding: 0 12px; }

/* ---------- breakpoints ---------- */

@media (max-width: 359px) {
  body { font-size: 16px; }
  .faces { gap: 2px; }
  .face-btn svg { width: 40px; height: 40px; }
  .face-btn span { font-size: 13px; }
  .steps { gap: 4px; }
  .step-btn { font-size: 13px; }
  .me-btn { width: 52px; height: 52px; }
  .me-btn:nth-child(1) i, .me-btn:nth-child(5) i { width: 44px; height: 44px; }
  .chip-grid { grid-template-columns: 1fr; }
  .tabs { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 430px) {
  .slab { min-height: 208px; }
}

@media (min-width: 600px) {
  :root { --col: 520px; }
  .app { padding-top: 24px; }
  .tabs { grid-template-columns: repeat(4, 1fr); }
  .wheel-wrap { width: 380px; }
}

@media (min-width: 1024px) {
  :root { --col: 560px; }
  .topbar { padding-top: 20px; }
}

@media (orientation: landscape) and (max-height: 500px) {
  .slab { min-height: 120px; }
  .wheel-wrap { width: min(60vh, 300px); }
  .screen-fill { min-height: auto; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
  .screen-enter, .card-enter { animation: fade 160ms ease both !important; }
  .btn, .chip, .face-btn, .step-btn, .duel-card, .mood-cell, .me-btn i { transition: background-color 120ms ease, color 120ms ease !important; }
  .btn:active, .chip:active, .face-btn:active, .step-btn:active, .duel-card:active, .mood-cell:active, .me-btn:active i { transform: none !important; }
  .typing span { animation: none !important; }
  .progress-fill { transition: none; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- print ---------- */

@media print {
  @page { margin: 14mm; }
  body { font-size: 12pt; }
  .topbar, .toast, .dialog, .no-print, .explore-tools, .tabs, .wheel-wrap { display: none !important; }
  .app { max-width: none; padding: 0; min-height: 0; }
  .section, .arch, .note, .moment { break-inside: avoid; }
  .arch, .moment, .talk li, .list li { border: 1.5pt solid var(--ink); }
  .fill, .bi-fill, .pill, .bi-dot { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
