:root {
  --ink: #211914;
  --muted: #76685a;
  --paper: #fff6e7;
  --panel: #fffaf0;
  --line: #dec9a8;
  --kraft: #b9824d;
  --cork: #9b673c;
  --cotton: #fffdf6;
  --tape: rgba(208, 157, 88, 0.56);
  --joe: #1687f7;
  --joe-dark: #0967c9;
  --emily: #ff6fae;
  --emily-dark: #d93c82;
  --mint: #2ec4b6;
  --yellow: #ffd166;
  --coral: #ff7a66;
  --shadow: 0 20px 60px rgba(73, 45, 23, 0.22);
  --soft-shadow: 0 12px 32px rgba(73, 45, 23, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
  min-width: 0;
}

html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.28), transparent 22%),
    radial-gradient(circle at 86% 78%, rgba(255, 111, 174, 0.18), transparent 28%),
    repeating-linear-gradient(8deg, rgba(73, 45, 23, 0.08) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(94deg, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 13px),
    linear-gradient(180deg, #b97c47, #e3c397 48%, #fbf1dc);
}

.desktop-stage,
.phone-preview {
  min-height: 100svh;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 86px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(141, 96, 52, 0.26);
  background:
    linear-gradient(180deg, rgba(255, 248, 232, 0.94), rgba(246, 229, 200, 0.88));
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 24px rgba(73, 45, 23, 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: "Segoe Print", "Bradley Hand ITC", "Comic Sans MS", cursive;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(117, 78, 38, 0.34);
  border-radius: 5px;
  background: linear-gradient(145deg, #fffaf0, #f1dcb8);
  box-shadow: 0 4px 10px rgba(73, 45, 23, 0.12);
  transform: rotate(-6deg);
}

.brand-mark::before {
  content: "\2661";
  color: var(--emily-dark);
  font-family: "Segoe Print", "Bradley Hand ITC", "Comic Sans MS", cursive;
  font-size: 19px;
  line-height: 1;
}

.brand-chat {
  position: relative;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(117, 78, 38, 0.34);
  border-radius: 5px;
  background: linear-gradient(145deg, #fffaf0, #f1dcb8);
  box-shadow: 0 4px 10px rgba(73, 45, 23, 0.12);
  transform: rotate(5deg);
}

.brand-chat::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  width: 15px;
  height: 11px;
  border-radius: 8px 8px 8px 3px;
  background: var(--joe);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.45),
    4px -4px 0 -1px var(--emily);
}

.brand-chat::after {
  content: "";
  position: absolute;
  left: 8px;
  bottom: 7px;
  width: 5px;
  height: 5px;
  background: var(--joe);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  filter: drop-shadow(8px -7px 0 var(--emily));
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  width: 100%;
  overflow-x: auto;
  padding: 0 8px 3px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 22px, #000 calc(100% - 22px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 22px, #000 calc(100% - 22px), transparent);
  scrollbar-width: none;
  scroll-behavior: smooth;
  scroll-padding-inline: 18px;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links a {
  flex: 0 0 auto;
  color: #5d4b3d;
  text-decoration: none;
  font-size: 11px;
  font-weight: 900;
  padding: 7px 9px;
  border: 1px solid rgba(161, 115, 65, 0.34);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.9);
  box-shadow: 0 4px 12px rgba(73, 45, 23, 0.08);
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a.active {
  color: var(--ink);
  border-color: rgba(255, 111, 174, 0.34);
  background: #fff3f7;
  outline: none;
}

.nav-links a.active {
  box-shadow:
    inset 0 0 0 1px rgba(255, 111, 174, 0.18),
    0 6px 16px rgba(73, 45, 23, 0.11);
  transform: translateY(-1px);
}

.section-band {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  min-height: 100svh;
  padding: 74px 28px;
}

.section-band::before,
.section-band::after {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  opacity: 0.36;
  filter: drop-shadow(0 10px 14px rgba(73, 45, 23, 0.12));
}

.section-band::before {
  content: "✿";
  right: 18px;
  top: 118px;
  color: #7ca4c7;
  font-size: 54px;
  transform: rotate(12deg);
}

.section-band::after {
  content: "❀";
  left: 22px;
  bottom: 44px;
  color: #d8a92f;
  font-size: 42px;
  transform: rotate(-15deg);
}

.section-band > * {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

.section-band:nth-of-type(4n)::before {
  content: "🎸";
  color: #7b5636;
  font-size: 48px;
}

.section-band:nth-of-type(4n + 1)::after {
  content: "✿";
  color: #719dce;
  font-size: 46px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 34px;
  min-height: calc(100svh - 64px);
  align-items: center;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 250, 240, 0.22), transparent 24%),
    radial-gradient(circle at 78% 18%, rgba(22, 135, 247, 0.10), transparent 22%),
    radial-gradient(circle at 88% 78%, rgba(255, 111, 174, 0.12), transparent 27%),
    repeating-linear-gradient(7deg, rgba(54, 34, 18, 0.09) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(96deg, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 14px),
    linear-gradient(135deg, #ad7644, #d7ad7a 54%, #efd9b4);
}

.section-band:nth-of-type(3n + 1) {
  background:
    linear-gradient(135deg, rgba(22, 135, 247, 0.08), transparent 38%),
    linear-gradient(315deg, rgba(255, 111, 174, 0.10), transparent 38%),
    linear-gradient(180deg, rgba(255, 250, 240, 0.92), rgba(248, 236, 214, 0.9));
}

.section-band:nth-of-type(3n + 2) {
  background:
    linear-gradient(160deg, rgba(255, 209, 102, 0.16), transparent 34%),
    linear-gradient(30deg, rgba(46, 196, 182, 0.12), transparent 46%),
    linear-gradient(180deg, rgba(255, 253, 246, 0.94), rgba(242, 231, 211, 0.88));
}

.hero::before,
.hero::after {
  display: none;
}

.hero-copy,
.phone-scene {
  position: relative;
  z-index: 1;
}

.hero-copy {
  max-width: 780px;
  padding: 26px 24px 24px;
  border: 1px solid rgba(117, 78, 38, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(0deg, rgba(117, 78, 38, 0.06) 1px, transparent 1px) 0 18px / 100% 28px,
    linear-gradient(145deg, rgba(255, 253, 246, 0.98), rgba(244, 225, 192, 0.96));
  box-shadow:
    0 26px 54px rgba(73, 45, 23, 0.24),
    inset 0 0 0 1px rgba(255, 255, 255, 0.48);
  transform: rotate(-0.8deg);
}

.hero-copy::before,
.hero-copy::after {
  display: none;
}

.date-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: #2a211b;
  text-align: center;
  font-weight: 950;
}

.date-card::before {
  display: none;
}

.date-card span {
  display: block;
  font-size: clamp(18px, 4vw, 30px);
  line-height: 1.15;
}

.date-card b {
  color: #8b3e62;
  font-family: "Segoe Print", "Bradley Hand ITC", "Comic Sans MS", cursive;
  font-size: 20px;
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 12px;
  color: #8b3e62;
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.hero .eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  padding: 6px 10px;
  color: #4d3221;
  background: rgba(218, 169, 102, 0.44);
  box-shadow: 0 3px 10px rgba(73, 45, 23, 0.08);
  transform: rotate(1deg);
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  color: #1d1714;
  font-family: "Segoe Print", "Bradley Hand ITC", "Comic Sans MS", cursive;
  font-size: 74px;
  font-weight: 500;
  line-height: 1.02;
}

h1 span {
  color: var(--emily-dark);
  font-size: 0.74em;
}

h2 {
  margin: 0;
  font-size: 38px;
  line-height: 1.05;
}

h3 {
  margin: 0 0 18px;
  font-size: 18px;
}

.hero-line {
  max-width: 630px;
  margin: 18px 0 0;
  color: #554234;
  font-family: "Segoe Print", "Bradley Hand ITC", "Comic Sans MS", cursive;
  font-size: 20px;
  line-height: 1.5;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.hero-stats > div,
.stat-card,
.peak-card,
.milestone-card,
.response-card,
.flow-card,
.mini-stat,
.panel {
  border: 1px solid rgba(153, 107, 58, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.92);
  box-shadow: var(--soft-shadow);
}

.hero-stats > div {
  position: relative;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 253, 246, 0.98), rgba(252, 240, 218, 0.94));
}

.hero-stats > div::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 22px;
  display: block;
  width: 64px;
  height: 16px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.16), transparent 36% 64%, rgba(255, 255, 255, 0.12)),
    var(--tape);
  opacity: 0.68;
  box-shadow: 0 2px 8px rgba(73, 45, 23, 0.10);
  transform: rotate(-4deg);
}

.hero-stats > div:nth-child(2)::before {
  left: 50%;
  transform: translateX(-50%) rotate(2deg);
}

.hero-stats > div:nth-child(3)::before {
  left: auto;
  right: 24px;
  transform: rotate(3deg);
}

.stat-number {
  display: block;
  font-size: 34px;
  line-height: 1;
  font-weight: 900;
}

.stat-label {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.phone-scene {
  display: flex;
  justify-content: center;
}

.phone-shell {
  position: relative;
  width: 340px;
  height: 640px;
  padding: 38px 18px 20px;
  border: 10px solid #17171f;
  border-radius: 42px;
  background:
    linear-gradient(180deg, #fbfcff, #eef3fa);
  box-shadow:
    0 22px 54px rgba(73, 45, 23, 0.28),
    0 0 0 8px rgba(255, 250, 240, 0.18);
  animation: floatPhone 5s ease-in-out infinite;
}

.phone-notch {
  position: absolute;
  top: 14px;
  left: 50%;
  width: 112px;
  height: 24px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #17171f;
}

.phone-thread {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: flex-end;
  height: 100%;
  padding: 16px 8px 12px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 54px, #000 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 54px, #000 100%);
}

.bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 18px;
  color: #ffffff;
  font-weight: 750;
  line-height: 1.35;
  box-shadow: 0 8px 22px rgba(23, 23, 31, 0.10);
  transition:
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 420ms ease,
    margin 520ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}

.bubble[role="button"] {
  cursor: pointer;
}

.bubble[role="button"]:focus-visible {
  outline: 3px solid rgba(255, 209, 102, 0.95);
  outline-offset: 3px;
}

.bubble.joe {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--joe), var(--joe-dark));
  border-bottom-right-radius: 6px;
}

.bubble.emily {
  align-self: flex-start;
  background: linear-gradient(135deg, var(--emily), var(--emily-dark));
  border-bottom-left-radius: 6px;
}

.bubble.mini {
  animation: slideIn 900ms ease both;
}

.bubble.live {
  animation: messageIn 520ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.bubble.removing {
  opacity: 0;
  transform: translateY(-28px) scale(0.96);
  margin-top: -58px;
  transition-duration: 650ms;
  pointer-events: none;
}

.typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  width: 62px;
  padding: 12px 13px;
  border-radius: 18px;
  border-bottom-left-radius: 6px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(23, 23, 31, 0.08);
  transition:
    align-self 260ms ease,
    transform 360ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 240ms ease,
    background 240ms ease;
}

.typing.joe {
  align-self: flex-end;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 6px;
}

.typing.emily {
  align-self: flex-start;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 18px;
}

.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: typing 1.2s ease-in-out infinite;
}

.typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing span:nth-child(3) {
  animation-delay: 0.3s;
}

.section-heading {
  display: grid;
  place-items: center;
  margin-bottom: 26px;
  width: fit-content;
  min-width: min(320px, 100%);
  padding: 16px 34px;
  border: 1px solid rgba(153, 107, 58, 0.28);
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(0deg, rgba(117, 78, 38, 0.06) 1px, transparent 1px) 0 14px / 100% 24px,
    rgba(255, 250, 240, 0.94);
  box-shadow: var(--soft-shadow);
  text-align: center;
}

.section-heading h2 {
  color: var(--ink);
  font-family: "Segoe Print", "Bradley Hand ITC", "Comic Sans MS", cursive;
  font-size: clamp(34px, 8vw, 54px);
  font-weight: 700;
  line-height: 1;
}

.section-heading .eyebrow {
  margin: 0;
  color: #8b3e62;
  letter-spacing: 0;
}

.wrapped-band {
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 111, 174, 0.14), transparent 27%),
    radial-gradient(circle at 92% 76%, rgba(22, 135, 247, 0.12), transparent 29%),
    repeating-linear-gradient(7deg, rgba(73, 45, 23, 0.05) 0 2px, transparent 2px 12px),
    linear-gradient(180deg, rgba(255, 250, 240, 0.94), rgba(246, 229, 200, 0.92));
  color: var(--ink);
}

.wrapped-band .eyebrow {
  color: #8b3e62;
}

.wrapped-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  position: relative;
  min-height: 210px;
  padding: 22px;
  color: var(--ink);
  overflow: hidden;
  transform: translateY(24px);
  opacity: 0;
  animation: revealUp 700ms ease forwards;
  background:
    linear-gradient(180deg, rgba(255, 253, 246, 0.98), rgba(251, 238, 213, 0.95));
}

.stat-card-label,
.stat-card > span:first-child {
  display: block;
  margin-bottom: 8px;
}

.stat-card strong {
  margin-bottom: 14px;
}

.person-compare {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.person-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.88);
  font-size: 14px;
  font-weight: 850;
}

.person-row.joe {
  border-left: 3px solid var(--joe);
}

.person-row.emily {
  border-left: 3px solid var(--emily);
}

.person-name {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.person-value {
  color: var(--ink);
  font-weight: 950;
  text-align: right;
}

.stat-detail {
  margin: 0 0 14px;
  color: #333743;
  line-height: 1.45;
  font-size: 14px;
}

.stat-card-chart {
  display: grid;
  place-items: center;
  margin-top: 2px;
}

.axis-compare-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
}

.axis-compare {
  display: block;
  width: min(280px, 100%);
  height: auto;
  overflow: visible;
}

.axis-compare .axis-line {
  stroke: rgba(117, 78, 38, 0.42);
  stroke-width: 2;
  stroke-linecap: round;
}

.axis-compare .axis-tick-line {
  stroke: rgba(117, 78, 38, 0.28);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.axis-compare .axis-tick-label {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.axis-compare .axis-dot-name {
  fill: var(--ink);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.stat-card:nth-child(2n) {
  background: #fff1f6;
}

.stat-card:nth-child(3n) {
  background: #eef8ff;
}

.stat-card:nth-child(4n) {
  background: #f5fff5;
}

.stat-card:nth-child(3n + 1)::before,
.peak-card:nth-child(2n)::before,
.milestone-card:nth-child(3n)::before,
.response-card:nth-child(2)::before,
.panel:nth-of-type(2n)::before,
.month-block:nth-child(4n + 1)::before {
  display: none;
}

.stat-card:nth-child(3n + 1)::before {
  left: 22px;
}

.peak-card:nth-child(2n)::before,
.milestone-card:nth-child(3n)::before,
.response-card:nth-child(2)::before {
  right: 24px;
  transform: rotate(4deg);
}

.stat-card strong,
.peak-card strong,
.milestone-card strong,
.response-card strong,
.flow-card strong,
.mini-stat strong {
  display: block;
  margin-bottom: 12px;
  font-size: 42px;
  line-height: 0.95;
  font-weight: 950;
}

.stat-card span,
.peak-card span,
.milestone-card span,
.response-card span,
.flow-card span,
.mini-stat span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.stat-card p,
.peak-card p,
.milestone-card p,
.response-card p,
.flow-card p,
.left-read p {
  margin: 12px 0 0;
  color: #333743;
  line-height: 1.45;
}

.peak-grid,
.milestone-grid,
.flow-grid,
.timeline-grid,
.emoji-totals,
.sessions-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

#milestones .milestone-grid {
  grid-template-columns: minmax(0, 1fr);
}

.milestone-pair-card {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(153, 107, 58, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.92);
  box-shadow: var(--soft-shadow);
  text-align: left;
}

.milestone-pair-card--featured {
  grid-column: 1 / -1;
  padding: 22px;
}

.milestone-pair-title {
  margin: 0;
  text-align: center;
  font-size: 19px;
  font-weight: 950;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.milestone-pair-card--featured .milestone-pair-title {
  font-size: 19px;
}

.milestone-pair-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.milestone-person {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 132px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  text-align: left;
}

.milestone-person.emily {
  background:
    linear-gradient(180deg, rgba(255, 236, 245, 0.98), rgba(255, 220, 236, 0.94));
  border-color: rgba(255, 111, 174, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.milestone-person.joe {
  background:
    linear-gradient(180deg, rgba(232, 244, 255, 0.98), rgba(210, 232, 255, 0.94));
  border-color: rgba(22, 135, 247, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.milestone-person-name {
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.milestone-person.emily .milestone-person-name {
  color: var(--emily-dark);
}

.milestone-person.joe .milestone-person-name {
  color: var(--joe-dark);
}

.milestone-person strong {
  font-size: 15px;
  line-height: 1.25;
}

.milestone-person p {
  margin: 0;
  color: #4d4a45;
  font-size: 13px;
  line-height: 1.45;
}

.milestone-person[data-receipt]:hover,
.milestone-person[data-receipt]:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  outline: none;
}

.milestone-person[data-receipt]::after {
  content: "tap for receipt";
  position: absolute;
  right: 10px;
  bottom: 8px;
  padding: 4px 6px;
  border-radius: 6px;
  color: #ffffff;
  background: linear-gradient(90deg, var(--emily), var(--joe));
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.milestone-person[data-receipt] {
  position: relative;
}

.milestone-person[data-receipt]:hover::after,
.milestone-person[data-receipt]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

#timing .timing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.timing-pair-card,
.timing-single-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(153, 107, 58, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.92);
  box-shadow: var(--soft-shadow);
  text-align: left;
}

.timing-single-card--featured {
  grid-column: 1 / -1;
  padding: 22px;
  text-align: center;
}

.timing-pair-title,
.timing-single-title {
  margin: 0;
  text-align: center;
  font-size: 19px;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.timing-single-card--featured .timing-single-title {
  font-size: 22px;
}

.timing-pair-caption {
  margin: -4px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.timing-pair-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.timing-person {
  position: relative;
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 108px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  text-align: left;
}

.timing-person.emily {
  background:
    linear-gradient(180deg, rgba(255, 236, 245, 0.98), rgba(255, 220, 236, 0.94));
  border-color: rgba(255, 111, 174, 0.34);
}

.timing-person.joe {
  background:
    linear-gradient(180deg, rgba(232, 244, 255, 0.98), rgba(210, 232, 255, 0.94));
  border-color: rgba(22, 135, 247, 0.34);
}

.timing-person-name {
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.timing-person.emily .timing-person-name {
  color: var(--emily-dark);
}

.timing-person.joe .timing-person-name {
  color: var(--joe-dark);
}

.timing-person strong,
.timing-single-card strong {
  display: block;
  font-size: 28px;
  line-height: 1;
  font-weight: 950;
}

.timing-person p,
.timing-single-card p {
  margin: 0;
  color: #4d4a45;
  font-size: 13px;
  line-height: 1.45;
}

.timing-panel--full h3 {
  margin-bottom: 8px;
  text-align: center;
}

.timing-panel--full .timing-pair-caption {
  margin: 0 0 14px;
  text-align: center;
}

.timing-person[data-receipt],
.timing-single-card[data-receipt] {
  cursor: pointer;
}

.timing-person[data-receipt]:hover,
.timing-person[data-receipt]:focus-visible,
.timing-single-card[data-receipt]:hover,
.timing-single-card[data-receipt]:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  outline: none;
}

#activity .peak-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

#activity .activity-ranks {
  width: 100%;
  margin-bottom: 0;
}

.peak-card,
.milestone-card,
.response-card,
.flow-card,
.mini-stat {
  position: relative;
  padding: 22px;
  overflow: hidden;
}

.peak-card,
.milestone-card,
.response-card,
.flow-card,
.mini-stat {
  display: grid;
  align-content: center;
  text-align: center;
}

.peak-card {
  gap: 10px;
  justify-items: center;
}

.peak-card strong,
.peak-card p {
  margin: 0;
}

.timeline-grid,
.activity-ranks,
.emoji-totals,
.sessions-grid {
  margin-bottom: 16px;
}

#starters .starter-grid,
.starter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.stat-card,
.peak-card,
.milestone-card,
.response-card,
.flow-card,
.mini-stat,
.chip,
.emoji-cell,
.tapback-cell,
.punctuation-cell,
.day-cell {
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.stat-wheel {
  display: none;
}

.split-pie-wrap {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 100%;
}

.split-pie {
  position: relative;
  display: block;
  width: min(142px, 100%);
  aspect-ratio: 1;
  border: 1px solid rgba(117, 78, 38, 0.18);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(255, 250, 240, 0.96) 0 46%, transparent 47%),
    conic-gradient(var(--joe) 0deg var(--joe-deg), var(--emily) var(--joe-deg) 360deg);
  box-shadow:
    inset 0 0 0 6px rgba(255, 255, 255, 0.36),
    0 10px 22px rgba(73, 45, 23, 0.12);
}

[data-receipt] {
  cursor: pointer;
  position: relative;
}

[data-receipt]:hover,
[data-receipt]:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(255, 111, 174, 0.42);
  box-shadow: var(--shadow);
  outline: none;
}

.stat-card[data-receipt]::after,
.peak-card[data-receipt]::after,
.milestone-card[data-receipt]::after,
.response-card[data-receipt]::after,
.flow-card[data-receipt]::after {
  content: "tap to view data";
  position: absolute;
  right: 12px;
  bottom: 10px;
  padding: 5px 7px;
  border-radius: 6px;
  color: #ffffff;
  background: linear-gradient(90deg, var(--emily), var(--joe));
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.stat-card[data-receipt]:hover::after,
.stat-card[data-receipt]:focus-visible::after,
.peak-card[data-receipt]:hover::after,
.peak-card[data-receipt]:focus-visible::after,
.milestone-card[data-receipt]:hover::after,
.milestone-card[data-receipt]:focus-visible::after,
.response-card[data-receipt]:hover::after,
.response-card[data-receipt]:focus-visible::after,
.flow-card[data-receipt]:hover::after,
.flow-card[data-receipt]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.heatmap-wrap,
.archive-layout {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 253, 246, 0.96), rgba(247, 233, 207, 0.92));
  box-shadow: var(--soft-shadow);
}

.heatmap-wrap {
  width: 100%;
  padding: 22px;
  overflow-x: hidden;
}

.heatmap-months {
  display: none;
}

.heatmap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(228px, 1fr));
  gap: 16px;
  width: 100%;
}

.month-block {
  position: relative;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.82);
}

.month-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.month-title span:last-child {
  color: var(--muted);
  font-weight: 850;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 5px;
}

.day-cell {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  align-self: start;
  border-radius: 6px;
  background: #ebedf0;
  border: 1px solid rgba(23, 23, 31, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.day-cell::before {
  content: "";
  display: block;
  width: 100%;
  padding-top: 100%;
}

.day-cell:not(.blank):not(.level-0):hover,
.day-cell:not(.blank):not(.level-0):focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.72);
  outline-offset: 1px;
}

.day-cell.blank {
  visibility: hidden;
  pointer-events: none;
}

.level-0 {
  background: #ebedf0;
  border-color: rgba(23, 23, 31, 0.06);
}

.level-1 {
  background: #f4d2ce;
  border-color: rgba(155, 24, 20, 0.14);
}

.level-2 {
  background: #e89890;
  border-color: rgba(155, 24, 20, 0.18);
}

.level-3 {
  background: #dc5048;
  border-color: rgba(150, 38, 16, 0.22);
}

.level-4 {
  background: #ef7f28;
  border-color: rgba(190, 88, 20, 0.24);
}

.level-5 {
  background: #f5a032;
  border-color: rgba(200, 110, 18, 0.24);
}

.level-6 {
  background: #f5c43a;
  border-color: rgba(190, 130, 16, 0.24);
}

.level-7 {
  background: #e8d84a;
  border-color: rgba(160, 140, 20, 0.22);
}

.level-8 {
  background: #b8db62;
  border-color: rgba(110, 140, 36, 0.2);
}

.level-9 {
  background: #7ecf72;
  border-color: rgba(56, 130, 52, 0.22);
}

.level-10 {
  background: #52b85a;
  border-color: rgba(42, 120, 48, 0.24);
}

.level-11 {
  background: #3da852;
  border-color: rgba(36, 110, 44, 0.28);
}

.level-12 {
  background: #2d9444;
  border-color: rgba(30, 100, 40, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.heat-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.heat-legend i {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  border: 1px solid rgba(23, 23, 31, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.response-layout,
.word-layout,
.emoji-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.panel {
  position: relative;
  padding: 20px;
  min-width: 0;
}

.panel:nth-of-type(2n)::before {
  left: 22px;
}

.month-block:nth-child(4n + 1)::before {
  left: 18px;
  width: 54px;
  height: 14px;
  top: -7px;
}

.rank-chart-frame {
  width: 100%;
  padding: 16px 14px 12px;
}

.rank-chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: stretch;
}

.rank-chart-block {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  width: 100%;
}

.rank-chart-block h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.bar-list {
  display: grid;
  gap: 8px;
  align-content: start;
  width: 100%;
  max-height: min(320px, 42vh);
  overflow-y: auto;
  padding-right: 6px;
}

.bar-list,
.receipt-thread {
  scrollbar-width: thin;
  scrollbar-color: #c49560 rgba(222, 201, 168, 0.42);
}

.bar-list::-webkit-scrollbar,
.receipt-thread::-webkit-scrollbar {
  width: 11px;
}

.bar-list::-webkit-scrollbar-track,
.receipt-thread::-webkit-scrollbar-track {
  margin: 4px 0;
  border: 1px solid rgba(185, 124, 71, 0.2);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.72), rgba(247, 233, 207, 0.88));
  box-shadow: inset 0 1px 3px rgba(73, 45, 23, 0.08);
}

.bar-list::-webkit-scrollbar-thumb,
.receipt-thread::-webkit-scrollbar-thumb {
  border: 2px solid rgba(255, 250, 240, 0.72);
  border-radius: 999px;
  background:
    linear-gradient(180deg, #e0b47a 0%, #c49560 48%, #b9824d 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 2px 6px rgba(73, 45, 23, 0.14);
}

.bar-list::-webkit-scrollbar-thumb:hover,
.receipt-thread::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(180deg, #e8c08a 0%, #d0a56a 48%, #c49560 100%);
}

.bar-list::-webkit-scrollbar-thumb:active,
.receipt-thread::-webkit-scrollbar-thumb:active {
  background:
    linear-gradient(180deg, #b9824d 0%, #9b673c 100%);
}

.bar-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  width: 100%;
}

.bar-row[data-receipt] {
  padding: 3px 4px;
  margin: -3px -4px;
  border-radius: 6px;
}

.bar-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.bar-label {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
  color: var(--ink);
  white-space: nowrap;
}

.bar-value {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.bar-track {
  width: 100%;
  height: 16px;
  border-radius: 999px;
  background: rgba(117, 78, 38, 0.1);
  overflow: hidden;
}

.bar-stack {
  display: flex;
  height: 100%;
  width: var(--w);
  min-width: 4px;
  border-radius: 999px;
  overflow: hidden;
  animation: fillBar 820ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: calc(var(--rank) * 28ms);
}

.bar-seg {
  display: block;
  height: 100%;
  min-width: 0;
}

.bar-seg.joe {
  background: linear-gradient(90deg, #4f8fd9, var(--joe));
}

.bar-seg.emily {
  background: linear-gradient(90deg, var(--emily), #ff98c8);
}

.bar-legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border-radius: 3px;
  vertical-align: -2px;
}

.legend-swatch.joe {
  background: var(--joe);
}

.legend-swatch.emily {
  background: var(--emily);
}

.response-layout {
  grid-template-columns: 1.1fr 1fr;
}

.response-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.left-read {
  min-height: 100%;
}

.read-item {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.read-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.read-item strong {
  display: block;
  margin-bottom: 6px;
}

.quote-line {
  display: block;
  margin-top: 8px;
  color: #3a3d48;
  font-size: 14px;
  line-height: 1.45;
}

.word-layout {
  grid-template-columns: 1.4fr 1fr;
}

.word-cloud-panel {
  grid-row: span 3;
}

.panel-tabs,
.segmented {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.78);
}

.seg {
  border: 0;
  border-radius: 6px;
  padding: 8px 11px;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
}

.seg.active {
  color: var(--ink);
  background: #fffaf0;
  box-shadow: 0 3px 10px rgba(73, 45, 23, 0.10);
}

.word-cloud-tabs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  width: min(100%, 320px);
  margin-inline: auto;
}

.word-cloud-tabs .seg.cloud-emily.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--emily), var(--emily-dark));
  box-shadow: 0 4px 14px rgba(255, 111, 174, 0.28);
}

.word-cloud-tabs .seg.cloud-joe.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--joe), var(--joe-dark));
  box-shadow: 0 4px 14px rgba(22, 135, 247, 0.28);
}

.word-cloud-tabs .seg.cloud-both.active {
  color: #ffffff;
  background: linear-gradient(90deg, var(--emily) 0 50%, var(--joe) 50% 100%);
  box-shadow:
    0 4px 14px rgba(255, 111, 174, 0.18),
    0 4px 14px rgba(22, 135, 247, 0.18);
}

.word-cloud-stage {
  position: relative;
  margin-top: 22px;
  border: 1px solid rgba(153, 107, 58, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.72);
  overflow: hidden;
}

.word-cloud-heart {
  position: absolute;
  inset: 10% 7% 8%;
  background:
    radial-gradient(circle at 36% 30%, rgba(255, 255, 255, 0.92), transparent 28%),
    linear-gradient(135deg, rgba(255, 111, 174, 0.14), rgba(22, 135, 247, 0.12));
  clip-path: polygon(50% 11%, 61% 3%, 75% 4%, 88% 14%, 95% 29%, 92% 47%, 82% 64%, 50% 94%, 18% 64%, 8% 47%, 5% 29%, 12% 14%, 25% 4%, 39% 3%);
  pointer-events: none;
  z-index: 0;
}

.word-cloud-viewport {
  position: relative;
  z-index: 1;
  min-height: 420px;
  max-height: 460px;
  overflow: auto;
  cursor: grab;
  scrollbar-width: thin;
  scrollbar-color: #c49560 rgba(222, 201, 168, 0.42);
}

.word-cloud-viewport.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.word-cloud-viewport::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.word-cloud-viewport::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, #e0b47a, #b9824d);
}

.word-cloud-canvas {
  display: flex;
  align-content: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  min-width: 180%;
  min-height: 180%;
  padding: 72px 64px;
  transform-origin: center center;
  transition: transform 140ms ease;
}

.word-cloud-canvas span {
  font-size: var(--size);
  font-weight: 950;
  line-height: 1.15;
  cursor: pointer;
}

.word-cloud-canvas span.tone-emily {
  color: var(--emily-dark);
}

.word-cloud-canvas span.tone-joe {
  color: var(--joe-dark);
}

.word-cloud-canvas span.tone-both {
  background: linear-gradient(90deg, var(--emily-dark), var(--joe-dark));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.word-cloud-zoom-controls {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(153, 107, 58, 0.22);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.94);
  box-shadow: var(--soft-shadow);
}

.word-cloud-zoom-btn {
  min-width: 34px;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.word-cloud-zoom-btn:hover,
.word-cloud-zoom-btn:focus-visible {
  background: rgba(255, 255, 255, 0.88);
  outline: none;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.panel h3 {
  text-align: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.92);
  font-weight: 850;
}

.chip b {
  color: var(--emily-dark);
}

#phraseList .chip b.phrase-count.joe {
  color: var(--joe);
}

#phraseList .chip b.phrase-count.emily {
  color: var(--emily);
}

#phraseList .chip b.phrase-count.tie {
  color: var(--muted);
}

.opening-lines-panel h3 {
  margin-bottom: 6px;
}

.opening-lines-note {
  margin: 0 0 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.opening-lines-list {
  display: grid;
  gap: 10px;
}

.opening-lines-empty {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.opening-line-slot {
  position: relative;
  min-height: 96px;
}

.opening-line-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  transition:
    opacity 560ms ease,
    transform 560ms cubic-bezier(0.2, 0.9, 0.2, 1);
  pointer-events: none;
}

.opening-line-layer.is-active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  z-index: 2;
}

.opening-line-layer.is-entering,
.opening-line-layer.is-leaving {
  z-index: 1;
}

.opening-line-layer.is-leaving {
  opacity: 0;
  transform: translateY(-8px) scale(0.985);
}

.opening-line-card {
  display: grid;
  gap: 6px;
  height: 100%;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgba(255, 250, 240, 0.92);
  text-align: left;
}

.opening-line-card.emily {
  background:
    linear-gradient(180deg, rgba(255, 236, 245, 0.98), rgba(255, 220, 236, 0.94));
  border-color: rgba(255, 111, 174, 0.3);
}

.opening-line-card.joe {
  background:
    linear-gradient(180deg, rgba(232, 244, 255, 0.98), rgba(210, 232, 255, 0.94));
  border-color: rgba(22, 135, 247, 0.3);
}

.opening-line-person {
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.opening-line-card.emily .opening-line-person {
  color: var(--emily-dark);
}

.opening-line-card.joe .opening-line-person {
  color: var(--joe-dark);
}

.opening-line-text {
  margin: 0;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.4;
  color: var(--ink);
}

.opening-line-time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.opening-line-card[data-receipt]:hover,
.opening-line-card[data-receipt]:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--soft-shadow);
  outline: none;
}

.emoji-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.emoji-layout {
  grid-template-columns: 1fr 1fr;
}

.reaction-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tapback-cell {
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.88);
  text-align: center;
}

.tapback-icon {
  display: block;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 850;
}

.tapback-icon--emphasized {
  font-size: 34px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.tapback-cell-count {
  position: relative;
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  isolation: isolate;
}

.tapback-cell-count::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--joe) 92%, white) 0%,
    color-mix(in srgb, var(--joe) 92%, white) var(--joe-pct),
    color-mix(in srgb, var(--emily) 92%, white) var(--joe-pct),
    color-mix(in srgb, var(--emily) 92%, white) 100%
  );
  z-index: -1;
}

.emoji-cell,
.punctuation-cell,
.mini-stat {
  min-height: 72px;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.88);
  text-align: center;
}

.emoji-cell strong {
  display: block;
  font-size: 24px;
  line-height: 1.1;
}

.emoji-cell-count {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  padding: 3px 6px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  isolation: isolate;
}

.emoji-cell-count::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--joe) 72%, white) 0%,
    color-mix(in srgb, var(--joe) 72%, white) var(--joe-pct),
    color-mix(in srgb, var(--emily) 72%, white) var(--joe-pct),
    color-mix(in srgb, var(--emily) 72%, white) 100%
  );
  z-index: -1;
}

.punctuation-cell span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.punctuation-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.question-stat-body {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}

.question-stat-body .person-compare {
  width: 100%;
}

.punctuation-cell strong {
  display: block;
  font-size: 30px;
}

.archive-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  height: min(68vh, calc(100svh - 128px));
  max-height: min(68vh, calc(100svh - 128px));
  min-height: 0;
  overflow: hidden;
}

#archive.section-band {
  max-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#archive .section-heading {
  flex: 0 0 auto;
}

#archive .archive-layout {
  flex: 1 1 auto;
}

.search-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  border-right: 1px solid var(--line);
  background: #fbfcff;
  overflow: auto;
}

.random-memory-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(185, 124, 71, 0.28);
  border-radius: 999px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 253, 246, 0.98), rgba(251, 238, 213, 0.94));
  box-shadow: 0 8px 18px rgba(73, 45, 23, 0.08);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.random-memory-button:hover,
.random-memory-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 111, 174, 0.42);
  box-shadow: var(--soft-shadow);
  outline: none;
}

.search-icon,
.random-memory-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--muted);
}

.random-memory-icon {
  color: var(--emily-dark);
}

.archive-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  padding: 6px 6px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.48);
}

.search-box,
.date-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.search-box input,
.date-grid input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #ffffff;
  outline: none;
}

.archive-search-row .search-box {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 0;
  text-transform: none;
}

.search-field-leading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.archive-search-row .search-box input {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 4px 8px 4px 0;
  background: transparent;
}

.archive-filter {
  align-self: stretch;
  align-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(247, 238, 221, 0.92);
  box-shadow: inset 0 0 0 1px rgba(185, 124, 71, 0.14);
}

.archive-filter.compact {
  padding: 3px;
  gap: 2px;
}

.archive-filter.compact .seg {
  padding: 5px 8px;
  font-size: 10px;
  border-radius: 999px;
}

.archive-filter .seg.active {
  border-radius: 999px;
}

.search-box input:focus,
.date-grid input:focus {
  border-color: var(--joe);
  box-shadow: 0 0 0 3px rgba(22, 135, 247, 0.15);
}

.archive-search-row:focus-within {
  border-color: var(--joe);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.48),
    0 0 0 3px rgba(22, 135, 247, 0.15);
}

.archive-search-row .search-box input:focus {
  border-color: transparent;
  box-shadow: none;
}

.date-grid,
.toggle-row,
.primary-button {
  margin-top: 0;
}

.date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #343844;
  font-weight: 850;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--emily);
}

.primary-button {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(90deg, var(--joe), var(--emily));
  font-weight: 900;
}

.results-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 253, 246, 0.72), rgba(241, 231, 214, 0.86));
}

.message-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 111, 174, 0.65) rgba(117, 78, 38, 0.12);
}

.message-results::-webkit-scrollbar {
  width: 9px;
}

.message-results::-webkit-scrollbar-track {
  margin: 4px 0;
  border-radius: 999px;
  background: rgba(117, 78, 38, 0.1);
}

.message-results::-webkit-scrollbar-thumb {
  border: 2px solid rgba(255, 250, 240, 0.75);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--joe), var(--emily));
}

.message-results .message-row {
  gap: 3px;
  max-width: min(380px, 96%);
  border-radius: 12px;
}

.message-results .message-meta {
  font-size: 10px;
  line-height: 1.2;
}

.message-results .message-bubble {
  max-width: min(340px, 100%);
  padding: 6px 9px;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1.34;
  box-shadow: 0 4px 12px rgba(23, 23, 31, 0.1);
}

.message-results .message-row.joe .message-bubble {
  border-bottom-right-radius: 4px;
}

.message-results .message-row.emily .message-bubble {
  border-bottom-left-radius: 4px;
}

.message-results .message-tags {
  gap: 4px;
  font-size: 10px;
}

.message-results .message-reaction {
  font-size: 12px;
}

.message-row {
  display: grid;
  gap: 5px;
  max-width: 760px;
  border-radius: 18px;
}

.message-results .message-row[role="button"] {
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease;
}

.message-results .message-row[role="button"]:hover,
.message-results .message-row[role="button"]:focus-visible {
  transform: translateY(-2px);
  filter: drop-shadow(0 10px 18px rgba(73, 45, 23, 0.14));
  outline: none;
}

.message-row.joe {
  justify-self: end;
  justify-items: end;
}

.message-row.emily {
  justify-self: start;
  justify-items: start;
}

.message-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.message-bubble {
  max-width: min(680px, 100%);
  padding: 11px 14px;
  border-radius: 18px;
  color: #ffffff;
  line-height: 1.42;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: 0 8px 22px rgba(23, 23, 31, 0.10);
}

.message-row.joe .message-bubble {
  background: var(--joe);
  border-bottom-right-radius: 6px;
}

.message-row.emily .message-bubble {
  background: var(--emily);
  border-bottom-left-radius: 6px;
}

.message-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.message-row.joe .message-reactions {
  justify-content: flex-end;
}

.message-row.emily .message-reactions {
  justify-content: flex-start;
}

.message-reaction {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 1px solid rgba(117, 78, 38, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 14px rgba(23, 23, 31, 0.12);
  font-size: 16px;
  line-height: 1;
}

.message-reaction.joe {
  background: rgba(22, 135, 247, 0.16);
  border-color: rgba(22, 135, 247, 0.38);
}

.message-reaction.emily {
  background: rgba(255, 111, 174, 0.16);
  border-color: rgba(255, 111, 174, 0.38);
}

.message-tags span {
  padding: 4px 6px;
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.76);
  font-size: 11px;
  font-weight: 850;
}

.load-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 34px;
  margin: 10px auto 14px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(90deg, var(--joe), var(--emily));
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  justify-self: center;
}

.init-error-banner {
  margin: 12px 16px 0;
  padding: 12px 14px;
  border: 1px solid rgba(200, 60, 60, 0.35);
  border-radius: 8px;
  background: rgba(255, 236, 236, 0.95);
  color: #7a1f1f;
  font-weight: 800;
  text-align: center;
}

.receipt-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
}

.receipt-modal.open {
  display: block;
}

.receipt-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 14, 24, 0.54);
  backdrop-filter: blur(14px);
}

.receipt-sheet {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  max-width: 980px;
  height: min(86svh, 780px);
  max-height: calc(100% - 24px);
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid rgba(117, 78, 38, 0.24);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 253, 246, 0.98), rgba(242, 226, 199, 0.96));
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.32);
  overflow: hidden;
  animation: sheetIn 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.receipt-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
  background: #fffaf0;
}

.receipt-head-copy {
  min-width: 0;
}

.receipt-head h2 {
  margin: 0;
  font-size: clamp(18px, 3.6vw, 24px);
  line-height: 1.1;
}

.receipt-head p:last-child {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.receipt-head p:empty {
  display: none;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: #ffffff;
  font-size: 28px;
  line-height: 1;
}

.receipt-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--line);
  background: #fff6e7;
}

.receipt-foot .secondary-button {
  flex-shrink: 0;
}

.secondary-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #ffffff;
  font-weight: 900;
}

#receiptMeta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.receipt-thread {
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-height: 0;
  padding: 14px 12px 14px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: #f5ead5;
}

.receipt-thread .message-row {
  width: min(760px, 100%);
}

.receipt-anchor .message-bubble {
  outline: 4px solid rgba(255, 209, 102, 0.92);
  outline-offset: 3px;
  box-shadow:
    0 0 0 8px rgba(255, 250, 240, 0.86),
    0 14px 30px rgba(73, 45, 23, 0.20);
}

.receipt-divider {
  align-self: center;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 900;
}

@keyframes sheetIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes floatPhone {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-14px) rotate(1deg);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  70% {
    opacity: 1;
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes typing {
  0%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

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

@keyframes statSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fillBar {
  from {
    width: 0;
  }
  to {
    width: var(--w);
  }
}

@media (min-width: 900px) and (pointer: fine) {
  body {
    overflow: hidden;
    background:
      radial-gradient(circle at 16% 18%, rgba(255, 250, 240, 0.22), transparent 28%),
      radial-gradient(circle at 82% 76%, rgba(255, 111, 174, 0.20), transparent 31%),
      repeating-linear-gradient(8deg, rgba(255, 255, 255, 0.06) 0 2px, transparent 2px 12px),
      linear-gradient(135deg, #281d17, #8f5c35 56%, #cf9b63);
  }

  .desktop-stage {
    position: relative;
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: 28px;
  }

  .phone-preview {
    position: relative;
    height: min(932px, calc(100svh - 56px));
    aspect-ratio: 1290 / 2796;
    width: auto;
    max-width: calc(100vw - 64px);
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    border: 14px solid #07080d;
    border-radius: 42px;
    background: var(--paper);
    box-shadow:
      0 34px 120px rgba(0, 0, 0, 0.42),
      inset 0 0 0 1px rgba(255, 255, 255, 0.35);
    scrollbar-width: thin;
  }

  .phone-preview::before {
    content: "";
    position: sticky;
    top: 8px;
    left: calc(50% - 60px);
    z-index: 90;
    display: block;
    width: 120px;
    height: 18px;
    margin: 8px auto -26px;
    border-radius: 999px;
    background: #07080d;
    pointer-events: none;
  }

  .phone-preview .topbar {
    min-height: 86px;
    padding: 10px 12px;
    gap: 8px;
    overflow-x: auto;
  }

  .phone-preview .brand-mark {
    width: 22px;
    height: 22px;
  }

  .phone-preview .brand {
    font-size: 15px;
  }

  .phone-preview .nav-links a {
    flex: 0 0 auto;
    padding: 7px 10px;
    font-size: 12px;
  }

  .phone-preview .section-band {
    min-height: calc(100% - 86px);
    padding: 34px 18px;
    overflow-x: hidden;
  }

  .phone-preview .hero {
    grid-template-columns: 1fr;
    gap: 20px;
    min-height: calc(100% - 86px);
  }

  .phone-preview .hero::before {
    width: 86px;
    height: 104px;
    top: 28px;
    right: 18px;
    opacity: 0.42;
  }

  .phone-preview .hero::after {
    width: 140px;
    height: 24px;
    left: 20px;
    bottom: 20px;
  }

  .phone-preview .phone-scene {
    order: -1;
  }

  .phone-preview .hero-copy {
    width: 100%;
    padding: 24px 18px 20px;
    transform: rotate(-0.6deg);
  }

  .phone-preview .hero-copy::before {
    left: 26px;
    width: 88px;
    height: 22px;
  }

  .phone-preview .hero-copy::after {
    right: 28px;
    width: 72px;
    height: 18px;
  }

  .phone-preview h1 {
    font-size: 40px;
  }

  .phone-preview h2 {
    font-size: 28px;
  }

  .phone-preview h3 {
    font-size: 15px;
    margin-bottom: 10px;
  }

  .phone-preview .hero-line {
    margin-top: 12px;
    font-size: 15px;
  }

  .phone-preview .hero-stats {
    grid-template-columns: 1fr;
    margin-top: 16px;
  }

  .phone-preview .date-card span {
    font-size: 18px;
  }

  .phone-preview .phone-shell {
    width: 300px;
    max-width: 82%;
    height: 520px;
    border-width: 8px;
    border-radius: 32px;
    padding: 30px 12px 14px;
    margin: 0 auto;
  }

  .phone-preview .wrapped-grid,
  .phone-preview .peak-grid,
  .phone-preview .milestone-grid,
  .phone-preview .flow-grid,
  .phone-preview .starter-grid,
  .phone-preview .emoji-totals,
  .phone-preview .sessions-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .phone-preview #starters .starter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .phone-preview .timeline-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .phone-preview .rank-chart-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .phone-preview .rank-chart-frame .bar-list {
    max-height: 260px;
  }

  .phone-preview #activity .activity-ranks {
    width: 100%;
  }

  .phone-preview .response-layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .phone-preview .response-cards {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .phone-preview .word-layout,
  .phone-preview .emoji-layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .phone-preview .word-cloud-panel {
    grid-row: span 2;
  }

  .phone-preview .word-cloud-viewport {
    min-height: 250px;
    max-height: 340px;
  }

  .phone-preview .word-cloud-canvas {
    min-width: 200%;
    min-height: 200%;
    padding: 56px 44px;
  }

  .phone-preview .heatmap {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .phone-preview .month-grid {
    gap: 5px;
  }

  .phone-preview .hero-stats > div,
  .phone-preview .stat-card,
  .phone-preview .peak-card,
  .phone-preview .milestone-card,
  .phone-preview .response-card,
  .phone-preview .flow-card,
  .phone-preview .mini-stat,
  .phone-preview .panel {
    padding: 13px;
  }

  .phone-preview .stat-card,
  .phone-preview .peak-card,
  .phone-preview .milestone-card,
  .phone-preview .response-card,
  .phone-preview .flow-card,
  .phone-preview .mini-stat {
    min-height: 136px;
  }

  .phone-preview .stat-card strong,
  .phone-preview .peak-card strong,
  .phone-preview .milestone-card strong,
  .phone-preview .response-card strong,
  .phone-preview .flow-card strong,
  .phone-preview .mini-stat strong {
    font-size: 25px;
    margin-bottom: 7px;
  }

  .phone-preview .stat-card p,
  .phone-preview .peak-card p,
  .phone-preview .milestone-card p,
  .phone-preview .response-card p,
  .phone-preview .flow-card p,
  .phone-preview .mini-stat p {
    margin-top: 7px;
    font-size: 12px;
  }

  .phone-preview .archive-layout {
    grid-template-columns: 1fr;
    height: min(62vh, calc(100% - 130px));
    max-height: min(62vh, calc(100% - 130px));
    min-height: 0;
  }

  .phone-preview .search-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .phone-preview .message-results {
    padding: 12px;
  }

  .receipt-sheet {
    inset: auto 0 0;
    width: 100%;
    height: min(88%, calc(100% - 14px));
    border-radius: 20px 20px 0 0;
  }
}

@media (orientation: landscape) and (max-height: 620px) {
  .topbar {
    min-height: 48px;
    padding: 7px 18px;
  }

  .nav-links a {
    padding: 5px 7px;
    font-size: 12px;
  }

  .section-band {
    min-height: 100svh;
    padding: 22px 18px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 24px;
    min-height: calc(100svh - 48px);
  }

  h1 {
    font-size: 44px;
  }

  h2 {
    font-size: 28px;
  }

  h3 {
    font-size: 15px;
    margin-bottom: 10px;
  }

  .hero-line {
    margin-top: 12px;
    font-size: 15px;
  }

  .hero-stats {
    margin-top: 16px;
  }

  .phone-shell {
    width: 210px;
    height: 360px;
    border-width: 8px;
    border-radius: 32px;
    padding: 30px 12px 14px;
  }

  .wrapped-grid,
  .peak-grid,
  .milestone-grid,
  .flow-grid,
  .timeline-grid,
  .emoji-totals,
  .sessions-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .starter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .rank-chart-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .rank-chart-frame .bar-list {
    max-height: 240px;
  }

  .response-layout {
    grid-template-columns: 1.2fr 1fr;
    gap: 10px;
  }

  .response-cards {
    gap: 10px;
  }

  .word-layout,
  .emoji-layout {
    grid-template-columns: 1.2fr 0.9fr 0.9fr;
    gap: 10px;
  }

  .word-cloud-panel {
    grid-row: span 2;
  }

  .word-cloud-viewport {
    min-height: 180px;
    max-height: 240px;
  }

  .word-cloud-canvas {
    min-width: 200%;
    min-height: 200%;
    padding: 48px 40px;
  }

  .hero-stats > div,
  .stat-card,
  .peak-card,
  .milestone-card,
  .response-card,
  .flow-card,
  .mini-stat,
  .panel {
    padding: 13px;
  }

  .stat-card,
  .peak-card,
  .milestone-card,
  .response-card,
  .flow-card,
  .mini-stat {
    min-height: 136px;
  }

  .stat-card strong,
  .peak-card strong,
  .milestone-card strong,
  .response-card strong,
  .flow-card strong,
  .mini-stat strong {
    font-size: 25px;
    margin-bottom: 7px;
  }

  .stat-card p,
  .peak-card p,
  .milestone-card p,
  .response-card p,
  .flow-card p,
  .mini-stat p {
    margin-top: 7px;
    font-size: 12px;
  }

  .archive-layout {
    grid-template-columns: 260px minmax(0, 1fr);
    height: min(68vh, calc(100svh - 128px));
    max-height: min(68vh, calc(100svh - 128px));
    min-height: 0;
  }

  .message-results {
    padding: 12px;
  }

  .receipt-sheet {
    height: calc(100svh - 24px);
    right: 12px;
    bottom: 12px;
    left: 12px;
  }
}

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

  .phone-scene {
    order: -1;
  }

  .phone-shell {
    width: 300px;
    height: 520px;
  }

  h1 {
    font-size: 58px;
  }

  .wrapped-grid,
  .peak-grid,
  .milestone-grid,
  .flow-grid,
  .timeline-grid,
  .emoji-totals,
  .sessions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  #milestones .milestone-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #timing .timing-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .rank-grid,
  .word-layout,
  .response-layout,
  .emoji-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  :root {
    --mobile-topbar-height: 112px;
  }

  .topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    width: 100%;
    flex-direction: column;
    align-items: center;
    padding: 10px 12px 12px;
  }

  .phone-preview {
    overflow-x: clip;
  }

  main {
    padding-top: var(--mobile-topbar-height);
  }

  .section-band {
    min-height: auto;
    padding: 44px 16px;
  }

  .hero.section-band {
    min-height: calc(100svh - var(--mobile-topbar-height));
    padding-top: 28px;
  }

  .phone-preview,
  main,
  .panel,
  .archive-layout,
  .heatmap-wrap {
    max-width: 100%;
    overflow-x: clip;
  }

  .section-heading {
    text-align: center;
    min-width: min(280px, 100%);
    padding: 14px 26px;
  }

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

  h1 {
    font-size: 42px;
  }

  .hero-copy {
    width: 100%;
    padding: 24px 18px 20px;
    transform: rotate(-0.5deg);
  }

  .hero::before {
    width: 84px;
    height: 102px;
    top: 28px;
    right: 16px;
    opacity: 0.38;
  }

  .hero::after {
    width: 136px;
    height: 22px;
    left: 18px;
    bottom: 18px;
  }

  h2 {
    font-size: 30px;
  }

  .hero-stats,
  .wrapped-grid,
  .peak-grid,
  .milestone-grid,
  .flow-grid,
  .emoji-totals,
  .sessions-grid,
  .response-cards {
    grid-template-columns: 1fr;
  }

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

  #milestones .milestone-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #timing .timing-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .milestone-pair-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  #activity .activity-ranks {
    width: 100%;
  }

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

  .archive-layout {
    grid-template-columns: 1fr;
    height: min(72vh, calc(100svh - 116px));
    max-height: min(72vh, calc(100svh - 116px));
  }

  .search-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .emoji-layout {
    grid-template-columns: 1fr;
  }

  .receipt-sheet {
    inset: auto 0 0;
    width: 100%;
    height: 88svh;
    border-radius: 20px 20px 0 0;
  }

  .receipt-head,
  .receipt-foot {
    padding-left: 16px;
    padding-right: 16px;
  }

  .receipt-thread {
    padding: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
