/* ============================================
   Trust Ramp Prototype
   Responsive: iPhone (390×844) → iPad Mini (744×1133)
   ============================================ */

@font-face {
  font-family: 'Gilroy';
  font-weight: 300;
  font-style: normal;
  font-display: swap;
  src: url('assets/fonts/Gilroy-Light.otf') format('opentype');
}

@font-face {
  font-family: 'Gilroy';
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  src: url('assets/fonts/Gilroy-ExtraBold.otf') format('opentype');
}

:root {
  --bg: transparent;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #FFFFFF;
  --text-primary: #F5F5F5;
  --text-secondary: #A1A1AA;
  --text-muted: #71717A;
  --border: rgba(255, 255, 255, 0.12);
  --border-light: rgba(255, 255, 255, 0.06);

  /* Phase palette */
  --phase1: #D5347A;
  --phase1-light: #FFF0F6;
  --phase2: #22C55E;
  --phase2-light: #F0FDF4;
  --phase3: #4ECDC4;
  --phase3-light: #F0FDFA;

  /* Current phase — set via JS */
  --phase-color: var(--phase1);
  --phase-bg: var(--phase1-light);

  /* Actions */
  --nah: #9CA3AF;
  --tweak: #D5347A;
  --thatsus: #22C55E;

  /* AI */
  --ai-purple: #A78BFA;
  --ai-purple-dim: rgba(167, 139, 250, 0.15);

  /* Brand */
  --brand: #EC4899;

  /* System */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow-card: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-elevated: 0 8px 32px rgba(0,0,0,0.12);

  /* Responsive layout tokens — mobile-first defaults (375px+) */
  --app-max-width: 480px;
  --card-gap: 24px;
  --card-padding-x: 16px;
  --card-padding-top: 32px;
  --action-btn-size: 80px;
  --action-btn-gap: 32px;
  --action-btn-emoji: 24px;
  --action-btn-label: 11px;
  --action-bar-pad-top: 12px;
  --action-bar-pad-bottom: 24px;
  --card-area-bottom-pad: 32px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
  background: #080808;
  color: var(--text-primary);
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
  position: fixed;
  inset: 0;
  width: 100%;
}

/* ---- Welcome Screen (pre-sandbox primer) ---- */

.welcome-screen {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 32px 32px;
  padding-top: max(64px, calc(env(safe-area-inset-top) + 48px));
  padding-bottom: max(32px, env(safe-area-inset-bottom));
  background: transparent;
  font-family: 'Gilroy', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  opacity: 1;
  transition: opacity 0.4s ease;
}

.welcome-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.welcome-logo {
  flex-shrink: 0;
  width: 180px;
  max-width: 45%;
  color: var(--text-primary);
  margin-bottom: 18vh;
}

.welcome-logo svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Empty logo placeholder: collapse reserved spacing until a future logo fills it */
.welcome-logo:empty {
  margin-bottom: 0;
}

.welcome-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  max-width: 520px;
}

.welcome-brand-logo {
  width: 200px;
  height: auto;
  margin-bottom: 25px;
  opacity: 1;
}

.welcome-heading {
  font-family: 'Gilroy', sans-serif;
  font-weight: 800;
  font-size: clamp(36px, 8vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  margin: 0;
}

.welcome-greeting {
  position: relative;
  font-family: 'Gilroy', sans-serif;
  font-weight: 800;
  font-size: clamp(28px, 5vw, 35px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #FFFFFF;
  margin: 0;
}

.welcome-subhead {
  font-family: 'Gilroy', sans-serif;
  font-weight: 300;
  font-size: clamp(17px, 4vw, 22px);
  line-height: 1.5;
  color: rgba(245, 245, 245, 0.6);
  margin: 0;
  max-width: 28ch;
}

.welcome-underline {
  position: absolute;
  left: 0;
  bottom: -0.4em;
  width: 100%;
  height: 0.4em;
  z-index: 0;
  pointer-events: none;
  transform: rotate(-1deg);
  transform-origin: left center;

  /* Initial state: fully clipped, invisible */
  clip-path: inset(0 100% 0 0);
  opacity: 1;
}

.welcome-greeting.is-measured .welcome-underline {
  animation:
    welcome-underline-draw 800ms cubic-bezier(0.4, 0, 0.2, 1) 200ms forwards,
    welcome-underline-fade 1400ms ease-out 1600ms forwards;
}

@keyframes welcome-underline-draw {
  0% {
    clip-path: inset(0 100% 0 0);
  }
  100% {
    clip-path: inset(0 0% 0 0);
  }
}

@keyframes welcome-underline-fade {
  0% { opacity: 1; }
  100% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-underline { display: none; }
}

.welcome-start {
  margin-top: 48px;
  padding: 18px 35px;
  border: none;
  border-radius: 14px;
  background: #D5347A;
  color: #FFFFFF;
  font-family: 'Gilroy', sans-serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(213, 52, 122, 0.25);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.welcome-start:hover {
  background: #E14C8D;
  box-shadow: 0 6px 22px rgba(213, 52, 122, 0.35);
}

.welcome-start:active {
  transform: scale(0.97);
}

.welcome-footer {
  margin-top: auto;
  padding-top: 32px;
  font-family: 'Gilroy', sans-serif;
  font-weight: 300;
  font-size: 15px;
  color: rgba(245, 245, 245, 0.31);
  letter-spacing: 0.02em;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 5px;
}

/* Welcome screen: center the content block in the canvas (equal auto-margin
   slack above the body and below the button), footer pinned at the bottom. */
#welcomeScreen .welcome-body { order: 1; margin-top: auto; }
#welcomeScreen .welcome-start { order: 2; }
#welcomeScreen .welcome-logo {
  order: 3;
  margin-top: auto;
  margin-bottom: 16px;
  width: 140px;
}
#welcomeScreen .welcome-footer { order: 4; margin-top: 0; padding-top: 0; }

/* ---- Sandbox → Copilot Transition (quiet held moment) ---- */

.sandbox-transition {
  position: fixed;
  inset: 0;
  z-index: 290;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: #080808;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.sandbox-transition.visible {
  opacity: 1;
}

.sandbox-transition.fading {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.transition-emoji {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 24px;
}

.transition-headline {
  font-family: 'Gilroy', sans-serif;
  font-weight: 800;
  font-size: clamp(24px, 6vw, 36px);
  line-height: 1.15;
  color: #FFF8F0;
  text-align: center;
  margin: 0 0 16px;
}

.transition-subline {
  font-family: 'Gilroy', sans-serif;
  font-weight: 300;
  font-size: clamp(15px, 3.5vw, 19px);
  line-height: 1.35;
  color: rgba(255, 248, 240, 0.55);
  text-align: center;
  max-width: 28ch;
  margin: 0;
}

.transition-cta {
  margin-top: 48px;
  padding: 18px 48px;
  border: none;
  border-radius: 14px;
  background: var(--ai-purple);
  color: #FFFFFF;
  font-family: 'Gilroy', sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(167, 139, 250, 0.25);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.transition-cta:active {
  transform: scale(0.97);
}

/* Confidence meter pulse during transition */
.confidence-meter.confidence-pulse .confidence-fill {
  animation: confidencePulse 0.8s ease-in-out 2;
}

@keyframes confidencePulse {
  0%, 100% { box-shadow: 0 0 4px rgba(213, 52, 122, 0.3); }
  50% { box-shadow: 0 0 16px rgba(213, 52, 122, 0.7); }
}

/* ---- Graduation Beat (sandbox -> copilot) ---- */

.graduation-beat {
  position: fixed;
  inset: 0;
  z-index: 290;
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 64px 32px 32px;
  padding-top: max(64px, calc(env(safe-area-inset-top) + 48px));
  padding-bottom: max(32px, env(safe-area-inset-bottom));
  background: #080808;
  font-family: 'Gilroy', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.graduation-beat.active {
  display: flex;
  opacity: 1;
}

.graduation-dots {
  display: flex;
  gap: 14px;
  margin-top: 48px;
}

.graduation-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #D5347A;
  opacity: 0.3;
  animation: graduation-pulse 1.2s ease-in-out infinite;
}

.graduation-dots span:nth-child(2) { animation-delay: 0.2s; }
.graduation-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes graduation-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.9); }
  40% { opacity: 1; transform: scale(1.15); }
}

.graduation-status {
  min-height: 1.4em;
  transition: opacity 0.25s ease;
}

.graduation-status.fading {
  opacity: 0;
}

/* ---- Phase Frame (viewport border + label) ---- */

.phase-frame {
  position: fixed;
  inset: 0;
  border: none;
  pointer-events: none;
  z-index: 200;
}

.phase-frame-label { display: none; }

/* ---- App Shell ---- */

.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
}

/* ---- Header ---- */

.header {
  padding: 12px 20px;
  padding-top: max(12px, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  flex-shrink: 0;
  z-index: 55;
  width: 100%;
  max-width: var(--app-max-width);
  margin: 0 auto;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.header-brand {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.header-brand:hover { opacity: 0.75; }
.header-brand:active { opacity: 0.6; }

.brand-logo {
  height: 16px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.65;
}


.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dev-menu-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  position: relative;
  z-index: 60;
}

.dev-menu-btn .hamburger-line {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.2s ease;
  position: absolute;
}

.dev-menu-btn .hamburger-line:nth-child(1) { transform: translateY(-5px); }
.dev-menu-btn .hamburger-line:nth-child(2) { transform: translateY(0); }
.dev-menu-btn .hamburger-line:nth-child(3) { transform: translateY(5px); }

.dev-menu-btn.active .hamburger-line:nth-child(1) { transform: rotate(45deg); }
.dev-menu-btn.active .hamburger-line:nth-child(2) { opacity: 0; }
.dev-menu-btn.active .hamburger-line:nth-child(3) { transform: rotate(-45deg); }
.dev-menu-btn.active { color: var(--text-primary); z-index: 60; }

/* ---- Voice Confidence Meter ---- */

.confidence-meter {
  padding: 12px 0 0;
  background: transparent;
  flex-shrink: 0;
  width: 100%;
}

.confidence-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: var(--app-max-width);
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.confidence-divider {
  position: relative;
  width: 100%;
  height: 3px;
  margin-top: 14px;
  background-color: #D5347A;
  border-radius: 2px;

  /* Initial: clipped from both sides toward center (invisible) */
  clip-path: inset(0 50% 0 50%);
  opacity: 1;
}

.confidence-meter.sandbox .confidence-divider,
.confidence-meter.copilot .confidence-divider {
  animation:
    confidence-divider-draw 800ms cubic-bezier(0.4, 0, 0.2, 1) 200ms forwards,
    confidence-divider-fade 1400ms ease-out 1600ms forwards;
}

.confidence-meter.copilot .confidence-divider {
  background-color: var(--ai-purple);
}

@keyframes confidence-divider-draw {
  0% { clip-path: inset(0 50% 0 50%); }
  100% { clip-path: inset(0 0% 0 0%); }
}

@keyframes confidence-divider-fade {
  0% { opacity: 1; }
  100% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .confidence-divider {
    clip-path: none;
    opacity: 0.35;
  }
}

.confidence-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.confidence-track {
  flex: 1;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  border-radius: 5px;
  background: #D5347A;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.confidence-picks {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-left: -4px;
}

.confidence-meter.copilot .confidence-picks {
  color: var(--ai-purple);
}

.confidence-pct {
  font-size: 13px;
  font-weight: 700;
  color: #D5347A;
  font-variant-numeric: tabular-nums;
  min-width: 32px;
  text-align: right;
}

.confidence-meter.copilot .confidence-fill {
  background: var(--ai-purple);
}

.confidence-meter.copilot .confidence-pct {
  color: var(--ai-purple);
}

.confidence-meter.copilot .confidence-label {
  color: var(--ai-purple);
}

/* ---- Progress Counter (hidden — now in action bar) ---- */

.progress-row {
  display: none;
}

/* ---- AI Learning Bar (Copilot) — inside action bar ---- */

.ai-learning-bar {
  display: none;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.ai-learning-bar.visible {
  display: flex;
}

.ai-learning-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ai-purple);
  text-align: center;
  letter-spacing: 0.02em;
}

.ai-learning-track {
  width: 100%;
  height: 6px;
  border-radius: var(--radius-pill);
  background: rgba(167, 139, 250, 0.15);
  overflow: hidden;
}

.ai-learning-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--ai-purple);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Phase Status Banner (color-coded per phase) ---- */

.sent-banner {
  position: relative;
  align-self: center;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: 8px auto 4px;
  padding: 7px 14px;
  background: rgba(213, 52, 122, 0.12);
  border: 1px solid rgba(213, 52, 122, 0.28);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  color: #D5347A;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-shrink: 0;
  max-height: 60px;
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  transition: opacity 0.25s ease, max-height 0.3s ease, padding 0.3s ease, margin 0.3s ease;
}

.sent-banner.visible { display: flex; margin: 20px auto 4px; }

.sent-banner.copilot {
  background: rgba(167, 139, 250, 0.12);
  border-color: rgba(167, 139, 250, 0.32);
  color: var(--ai-purple);
}

.sent-banner.vitals {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.32);
  color: #22C55E;
}

.sent-banner.dismissing {
  opacity: 0;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.sent-banner-text {
  font-weight: 500;
  flex: 1;
  min-width: 0;
}

.sent-banner-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.sent-banner-link {
  font-weight: 600;
  cursor: pointer;
  padding: 2px 0;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
  letter-spacing: 0.02em;
}

.sent-banner-dismiss {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #D5347A;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}

.sent-banner-dismiss:hover { opacity: 1; }

/* ---- Card Area ---- */

.card-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: var(--card-padding-top) var(--card-padding-x) 0;
  padding-bottom: calc(var(--card-area-bottom-pad) + env(safe-area-inset-bottom));
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: var(--app-max-width);
  margin: 0 auto;
}

/* ---- Comment Card ---- */

.comment-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
  animation: cardIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  touch-action: pan-y;
  --swipe-tint: transparent;
}

.comment-bubble-container {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

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

.comment-card.exit {
  animation: cardOut 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes cardOut {
  to { opacity: 0; transform: translateY(-20px) scale(0.97); }
}

/* Swipe gesture tint overlay */
.comment-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  pointer-events: none;
  z-index: 2;
  background: var(--swipe-tint);
}

/* Directional entry after swipe */
.comment-card.enter-from-left {
  animation: cardInFromLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.comment-card.enter-from-right {
  animation: cardInFromRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes cardInFromLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes cardInFromRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Live badge (copilot) */
.card-live-badge {
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #22C55E;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-live-badge .live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22C55E;
  animation: livePulse 1.5s infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Comment content */
.comment-bubble {
  padding: 16px 16px 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: white;
  position: relative;
}

.comment-avatar .platform-icon {
  position: absolute;
  bottom: -2px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.comment-avatar .platform-icon img {
  width: 12px;
  height: 12px;
}

.comment-body { flex: 1; min-width: 0; }

.comment-username {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.comment-text {
  font-size: 16px;
  line-height: 1.45;
  color: var(--text-primary);
}

/* ---- Reply Options (Sandbox) ---- */

.reply-options {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.reply-options-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0;
}

.reply-option {
  width: 100%;
  padding: 20px 20px;
  border-radius: var(--radius);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  transition: all 0.15s ease;
  text-align: left;
  font-family: inherit;
  color: var(--text-primary);
}

.reply-option:active {
  transform: scale(0.98);
}

.reply-option.selected {
  border-color: var(--phase-color);
  background: rgba(213, 52, 122, 0.12);
}

.reply-option-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.reply-option.ai-drafted .reply-option-label {
  color: var(--ai-purple);
}

.reply-option.ai-drafted.selected {
  border-color: var(--ai-purple);
  background: var(--ai-purple-dim);
}

.reply-option.selected .reply-option-label {
  color: var(--phase-color);
}

.reply-option-text {
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 8;
  overflow: hidden;
}

.reply-option.editing .reply-option-text {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.reply-option-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reply-option-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.reply-option-more,
.reply-option-pencil {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.5);
  background: transparent;
  border: none;
  cursor: pointer;
  line-height: 1;
}

.reply-option-more:hover,
.reply-option-pencil:hover {
  color: rgba(255, 255, 255, 0.85);
}

.reply-option-pencil .material-symbols-rounded {
  font-size: 18px;
  line-height: 1;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

.reply-option-pencil-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reply-card-action {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
  color: rgba(255, 255, 255, 0.78);
  padding: 0;
  transition: transform 0.1s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.reply-card-action:hover {
  color: rgba(255, 255, 255, 1);
  border-color: rgba(255, 255, 255, 0.22);
}

.reply-card-action:active {
  transform: scale(0.94);
}

.reply-card-action .material-symbols-rounded {
  font-size: 24px;
  line-height: 1;
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

.reply-card-action.nah,
.reply-card-action.thatsus {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Swipe affordance: the target action lights up as the row drags toward it */
.reply-card-action.swipe-affirm {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.85);
  color: #22c55e;
}

.reply-card-action.swipe-reject {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.85);
  color: #ef4444;
}

/* Pick confirmation: phase-aware border color (sandbox = pink, copilot = purple) */
.reply-card-action.picked {
  border-width: 2px;
  border-color: #D5347A;
  color: #D5347A;
}

.reply-option.ai-drafted .reply-card-action.picked {
  border-color: var(--ai-purple);
  color: var(--ai-purple);
}

/* Bottom sheet for full reply text */
.reply-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.reply-sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.reply-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  max-width: var(--app-max-width);
  margin: 0 auto;
  background: #141414;
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  padding: 12px 24px 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  max-height: 70vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
  touch-action: pan-y;
}

.reply-sheet.open {
  transform: translateY(0);
}

.reply-sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
  margin: 0 auto 16px;
}

.reply-sheet-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.reply-sheet.ai-drafted .reply-sheet-label {
  color: var(--ai-purple);
}

.reply-sheet-text {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
  width: 100%;
  min-height: 140px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

.reply-sheet-text:focus {
  border-color: var(--ai-purple);
}

.reply-sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.reply-sheet-btn {
  flex: 1;
  padding: 13px 16px;
  border-radius: 12px;
  border: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: transform 0.1s ease, background 0.2s ease;
}

.reply-sheet-btn:active {
  transform: scale(0.98);
}

.reply-sheet-btn.close {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.reply-sheet-btn.save {
  background: #D5347A;
  color: #FFFFFF;
}

/* Inline edit mode (Tweak) */
.reply-edit-field {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-primary);
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  overflow: hidden;
}

.reply-option.editing {
  border-color: var(--tweak);
  background: rgba(213, 52, 122, 0.08);
  border-style: dashed;
}

.reply-edit-confirm {
  display: none;
  margin-top: 10px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--tweak);
  color: white;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  -webkit-user-select: none;
  user-select: none;
}

.reply-edit-confirm:active {
  transform: scale(0.96);
}

.reply-option.editing .reply-edit-confirm {
  display: inline-block;
}

/* ---- AI Draft (Copilot) ---- */

.ai-draft {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  padding: 14px 16px;
}

.ai-draft-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 8px;
}

.ai-draft-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ai-purple);
}

.ai-draft-confidence {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--ai-purple-dim);
  color: var(--ai-purple);
}

.ai-draft-text {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-primary);
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
}

.ai-draft-edit {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-primary);
  padding: 14px 14px 14px 16px;
  background: rgba(213, 52, 122, 0.08);
  border-radius: var(--radius-sm);
  border: none;
  border-left: 3px solid var(--tweak);
  outline: none;
  resize: none;
  overflow: hidden;
  box-sizing: border-box;
}

.ai-draft-sent {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-primary);
  padding: 14px;
  background: var(--phase3-light);
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(78, 205, 196, 0.3);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.ai-draft-sent .sent-check {
  color: var(--phase3);
  font-size: 16px;
  flex-shrink: 0;
}

/* ---- Action Buttons (fixed bottom, revealed on selection) ---- */

.action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: transparent;
  border-top: none;
  padding: var(--action-bar-pad-top) var(--card-padding-x) var(--action-bar-pad-bottom);
  padding-bottom: calc(var(--action-bar-pad-bottom) + env(safe-area-inset-bottom));
  max-width: var(--app-max-width);
  margin: 0 auto;
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.action-bar.visible {
  transform: translateY(0);
}

.action-pick-counter {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-top: 22px;
}

.action-pick-counter strong {
  color: #FFFFFF;
}

.action-pick-progress {
  margin: 10px auto 0;
  max-width: 180px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.action-pick-progress-fill {
  height: 100%;
  background: #D5347A;
  border-radius: inherit;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-buttons {
  display: flex;
  gap: var(--action-btn-gap);
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  width: 100%;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: var(--action-btn-size);
  height: var(--action-btn-size);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--action-btn-label);
  font-weight: 600;
  gap: 2px;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-card);
}

.action-btn .action-emoji {
  font-size: var(--action-btn-emoji);
  line-height: 1;
}

.action-btn .action-label {
  font-size: var(--action-btn-label);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.action-btn:active { transform: scale(0.95); }

.action-btn:disabled {
  opacity: 1;
}


.btn-nah {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.btn-tweak {
  background: rgba(213, 52, 122, 0.15);
  color: #D5347A;
}

.btn-thatsus {
  background: var(--thatsus);
  color: white;
}

/* ---- Hover States (desktop) ---- */

@media (hover: hover) {
  .action-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  }

  .btn-nah:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.14);
    color: var(--text-primary);
  }

  .btn-tweak:hover:not(:disabled) {
    background: rgba(213, 52, 122, 0.25);
  }

  .btn-thatsus:hover:not(:disabled) {
    background: #16A34A;
  }

  .reply-option:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
  }

  .reply-option.selected:hover {
    background: rgba(213, 52, 122, 0.15);
  }

  .dev-menu-btn:hover {
    border-color: rgba(255,255,255,0.3);
    color: var(--text-primary);
  }

  .dev-btn:hover {
    border-color: rgba(255,255,255,0.25);
    color: var(--text-primary);
    background: rgba(255,255,255,0.1);
  }

  .dev-panel-close:hover {
    background: rgba(255,255,255,0.15);
    color: var(--text-primary);
  }

  .phase-transition-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
  }

  .sent-banner-link:hover {
    opacity: 0.7;
  }

  .vitals-alert-action:hover {
    text-decoration: underline;
    cursor: pointer;
  }

  .feedback-reason:hover {
    border-color: rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.06);
  }
}

/* ---- Footer (inside toolbar) ---- */

.phase-footer {
  text-align: center;
  padding-top: 8px;
}

.phase-footer-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--phase-color);
  transition: color 0.4s ease;
}

.phase-footer-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ---- Vitals Dashboard (Phase 3) ---- */

.vitals-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: transparent;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.vitals-screen.active { display: flex; }

.vitals-placeholder {
  color: #FFF8F0;
  font-family: 'Gilroy', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 22px;
  font-weight: 300;
  line-height: 1.4;
  text-align: center;
  width: 100%;
  height: 100%;
  position: relative;
}

.vitals-placeholder-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 56px;
  width: 100%;
}

.orbital-map {
  width: clamp(260px, 68vw, 460px);
  aspect-ratio: 1 / 1;
  opacity: 0;
  animation: orbital-emerge 1.6s ease 0.2s forwards;
}

.orbital-map svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.orbital-tilt {
  transform-origin: 300px 300px;
  transform-box: fill-box;
  transform: scaleY(0.62);
}

.orbit {
  transform-origin: 300px 300px;
  transform-box: fill-box;
  animation: orbit-spin 45s linear infinite;
}

.orbit-path {
  fill: none;
  stroke: rgba(255, 248, 240, 0.07);
  stroke-width: 1;
}

.satellite {
  fill: rgba(225, 220, 230, 0.78);
}

.orbital-center {
  fill: rgba(255, 248, 240, 0.95);
  filter: drop-shadow(0 0 14px rgba(255, 248, 240, 0.22));
}

@keyframes orbit-spin {
  to { transform: rotate(360deg); }
}

@keyframes orbital-emerge {
  to { opacity: 1; }
}

.vitals-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.vitals-brand-health {
  font-family: 'Gilroy', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
  color: rgba(255, 248, 240, 0.95);
  margin: 0;
  opacity: 0;
  animation: orbital-emerge 1.4s ease 1.1s forwards;
}

@media (prefers-reduced-motion: reduce) {
  .orbit { animation: none; }
  .orbital-map,
  .vitals-brand-health {
    animation: none;
    opacity: 1;
  }
}

/* ---- Wrap Screen (customer-tied brand orbit) ---- */

.wrap-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: transparent;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.wrap-screen.active { display: flex; }

.wrap-placeholder {
  color: #FFF8F0;
  font-family: 'Gilroy', -apple-system, BlinkMacSystemFont, sans-serif;
  text-align: center;
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: clamp(24px, 5vh, 56px) 24px clamp(20px, 3vh, 40px);
}

.wrap-heading-group,
.wrap-footer {
  position: relative;
  z-index: 2;
}

.wrap-heading-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  /* Roomy enough for the headline to stay on one line on desktop; vw-bounded so
     it still wraps naturally when there isn't horizontal space. Subhead caps
     itself at 44ch, so the extra width only benefits the headline. */
  max-width: min(92vw, 820px);
}

.wrap-headline {
  font-family: 'Gilroy', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: rgba(255, 248, 240, 0.96);
  line-height: 1.2;
  margin: 0;
  opacity: 0;
  animation: orbital-emerge 1.4s ease 0.4s forwards;
}

/* Scopes the underline to just the "Brand's Health" phrase. inline-block keeps
   the phrase from breaking internally, so the underline always spans it cleanly. */
.wrap-headline-mark {
  position: relative;
  display: inline-block;
}

.wrap-headline-underline {
  position: absolute;
  left: 0;
  bottom: -0.12em;
  width: 100%;
  height: 0.34em;
  z-index: 0;
  pointer-events: none;
  transform: rotate(-1deg);
  transform-origin: left center;
  /* Initial state: fully clipped, invisible — mirrors .welcome-underline */
  clip-path: inset(0 100% 0 0);
  opacity: 1;
  /* Same draw + slight-fade as the welcome "Hi, we're Murmur" underline
     (identical durations, easings and 1400ms draw→fade gap), delayed to begin
     once the headline has emerged (headline emerges at 0.4s). */
  animation:
    welcome-underline-draw 800ms cubic-bezier(0.4, 0, 0.2, 1) 1.2s forwards,
    welcome-underline-fade 1400ms ease-out 2.6s forwards;
}

@media (prefers-reduced-motion: reduce) {
  .wrap-headline-underline {
    animation: none;
    clip-path: inset(0 0% 0 0);
    opacity: 0.35;
  }
}

.wrap-subhead {
  font-family: 'Gilroy', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(15px, 1.7vw, 17px);
  font-weight: 400;
  letter-spacing: 0.01em;
  color: rgba(255, 248, 240, 0.72);
  line-height: 1.45;
  margin: 0;
  max-width: 44ch;
  opacity: 0;
  animation: orbital-emerge 1.4s ease 0.7s forwards;
}

.orbital-map--wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, 80vw, 80vh);
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  opacity: 0;
  animation: orbital-emerge 1.6s ease 0.2s forwards;
  z-index: 1;
  pointer-events: none;
}

.wrap-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.4vh, 18px);
  width: 100%;
}

.wrap-footer .wrap-version,
.wrap-footer .vitals-placeholder-logo {
  position: static;
  transform: none;
  inset: auto;
}

.wrap-footer .vitals-placeholder-logo {
  width: clamp(140px, 14vw, 180px);
}

.orbital-map--wrap svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.brand-orbit {
  transform-origin: 300px 300px;
  transform-box: fill-box;
  animation: orbit-spin var(--orbit-duration, 50s) linear infinite;
  animation-direction: var(--orbit-direction, normal);
}

.brand-orbit--inner  { --orbit-duration: 38s; --orbit-direction: normal;  --counter-direction: reverse; }
.brand-orbit--middle { --orbit-duration: 52s; --orbit-direction: reverse; --counter-direction: normal;  }
.brand-orbit--outer  { --orbit-duration: 64s; --orbit-direction: normal;  --counter-direction: reverse; }

.brand-satellite-counter {
  transform-origin: center;
  transform-box: fill-box;
  animation: orbit-spin var(--orbit-duration, 50s) linear infinite;
  animation-direction: var(--counter-direction, reverse);
}

/* The healthy center doubles as the restart control. The map is pointer-events:
   none, so re-enable just this group. Scales the bbox center for a press feel. */
.brand-orbital-button {
  pointer-events: auto;
  cursor: pointer;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-orbital-button .brand-orbital-center--healthy {
  transition: fill 0.3s ease, filter 0.3s ease;
}

.brand-orbital-button:hover {
  transform: scale(1.04);
}

.brand-orbital-button:hover .brand-orbital-center--healthy {
  fill: rgba(126, 214, 156, 1);
  filter: drop-shadow(0 0 30px rgba(126, 214, 156, 0.52));
}

.brand-orbital-button:active {
  transform: scale(0.98);
}

.brand-orbital-button:focus-visible {
  outline: none;
}

.brand-orbital-button:focus-visible .brand-orbital-center--healthy {
  fill: rgba(126, 214, 156, 1);
  filter: drop-shadow(0 0 0 3px rgba(255, 248, 240, 0.85)) drop-shadow(0 0 30px rgba(126, 214, 156, 0.52));
}

.brand-orbital-center {
  fill: rgba(255, 248, 240, 0.95);
  filter: drop-shadow(0 0 18px rgba(255, 248, 240, 0.28));
}

.brand-orbital-center--healthy {
  fill: rgba(126, 214, 156, 0.95);
  filter: drop-shadow(0 0 22px rgba(126, 214, 156, 0.38));
}

.brand-orbital-label {
  font-family: 'Gilroy', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 36px;
  font-weight: 700;
  fill: rgba(15, 32, 22, 0.92);
  letter-spacing: 0.01em;
  user-select: none;
  pointer-events: none;
}

.brand-satellite {
  opacity: 0.5;
}

.satellite-body {
  fill: rgba(15, 14, 18, 0.85);
  stroke: rgba(255, 248, 240, 0.5);
  stroke-width: 1.25;
  r: 34;
}

.satellite-label {
  font-family: 'Gilroy', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 30px;
  font-weight: 700;
  fill: rgba(255, 248, 240, 0.92);
  letter-spacing: 0.02em;
  user-select: none;
  pointer-events: none;
}

.satellite-label--single {
  font-size: 35px;
}

@media (min-width: 900px) {
  .satellite-body {
    r: 17;
  }
  .satellite-label {
    font-size: 15px;
  }
  .satellite-label--single {
    font-size: 17.5px;
  }
  /* Satellite shrinks on desktop — scale the logo to match (centered on origin) */
  .wrap-sat-icon {
    transform: scale(0.5);
  }
}

/* Platform logos on the brand-orbit satellites */
.wrap-sat-icon {
  pointer-events: none;
  user-select: none;
  transform-box: fill-box;
  transform-origin: center;
}

/* TikTok mark is authored black for light chips; flip it white for the dark satellite */
.wrap-sat-icon--invert {
  filter: invert(1);
}

.wrap-brand-mark {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .brand-orbit,
  .brand-satellite-counter {
    animation: none;
  }
  .orbital-map--wrap,
  .wrap-headline,
  .wrap-subhead {
    animation: none;
    opacity: 1;
  }
}

/* ---- Shared bottom wordmark ---- */

.vitals-placeholder-logo {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  color: var(--text-primary);
}

button.vitals-placeholder-logo {
  background: none;
  border: none;
  padding: 0;
  display: block;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

button.vitals-placeholder-logo:hover {
  opacity: 0.7;
}

button.vitals-placeholder-logo:active {
  opacity: 0.55;
}

.wrap-version {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Gilroy', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 300;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(245, 245, 245, 0.32);
  white-space: nowrap;
  text-align: center;
  line-height: 1.5;
  margin: 0;
  pointer-events: none;
}

.vitals-placeholder-logo svg {
  display: block;
  width: 100%;
  height: auto;
}

.vitals-health-ring {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(78, 205, 196, 0.08);
  border: 4px solid var(--phase3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 8px auto;
  box-shadow: 0 0 0 10px rgba(78, 205, 196, 0.06);
}

.vitals-health-label {
  font-size: 22px;
  font-weight: 700;
  color: var(--phase3);
}

.vitals-health-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

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

.vitals-channel {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vitals-channel-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: capitalize;
}

.vitals-channel-header img {
  width: 14px;
  height: 14px;
}

.vitals-channel-stat {
  font-size: 11px;
  color: var(--text-muted);
}

.vitals-channel-stat strong {
  color: var(--text-primary);
}

.vitals-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.vitals-status-dot.healthy { background: var(--phase3); }
.vitals-status-dot.concern { background: #D5347A; }
.vitals-status-dot.critical { background: #EF4444; }

/* Alert Cards */
.vitals-alerts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vitals-alert {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.vitals-alert-body { flex: 1; }

.vitals-alert-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.vitals-alert-title img {
  width: 14px;
  height: 14px;
}

.vitals-alert-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 6px;
}

.vitals-alert-status {
  font-size: 11px;
  color: var(--text-muted);
}

.vitals-alert-action {
  font-size: 12px;
  font-weight: 600;
  color: var(--phase3);
  white-space: nowrap;
  align-self: center;
}

/* Recent auto-replies */
.vitals-recent {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 14px;
}

.vitals-recent-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.vitals-recent-item {
  padding: 8px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 12px;
  line-height: 1.4;
}

.vitals-recent-item:first-of-type { border-top: none; }

.vitals-recent-comment {
  color: var(--text-secondary);
  margin-bottom: 3px;
}

.vitals-recent-reply {
  color: var(--text-primary);
  padding-left: 10px;
  border-left: 2px solid var(--phase3);
}

/* ---- Phase Transition ---- */

.phase-transition {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.phase-transition.active { display: flex; }

.phase-transition-card {
  background: rgba(20, 20, 28, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 32px 24px;
  text-align: center;
  max-width: 320px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  animation: transIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes transIn {
  from { transform: scale(0.92) translateY(16px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.phase-transition-icon { font-size: 40px; margin-bottom: 12px; }

.phase-transition-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.phase-transition-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

.phase-transition-btn {
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  background: var(--phase-color);
}

.phase-transition-btn:active { transform: scale(0.96); }

/* Round Notice meter */
.round-notice-meter {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin: 16px 0 6px;
}

.round-notice-meter-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--phase-color);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.round-notice-meter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--phase-color);
  margin-bottom: 20px;
}

/* ---- Review Overlay (sent-while-away) ---- */

.review-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  flex-direction: column;
  z-index: 50;
  padding: 80px 20px 40px;
}

.review-overlay.open { display: flex; }

.review-panel {
  width: 100%;
  max-width: var(--app-max-width);
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
}

.review-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.review-panel-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.review-panel-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.review-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 20px;
}

.review-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: opacity 0.2s ease;
}

.review-item.overridden {
  opacity: 0.5;
}

.review-item-comment {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.review-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: white;
  position: relative;
}

.review-avatar .platform-icon {
  position: absolute;
  bottom: -2px;
  right: -4px;
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.review-avatar .platform-icon img {
  width: 9px;
  height: 9px;
}

.review-comment-body { flex: 1; min-width: 0; }

.review-username {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.review-comment-text {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-secondary);
}

.review-item-reply {
  padding: 10px 12px;
  background: rgba(34, 197, 94, 0.08);
  border-left: 3px solid var(--phase2);
  border-radius: var(--radius-sm);
}

.review-reply-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--phase2);
  margin-bottom: 4px;
}

.review-reply-text {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-primary);
}

.review-disagree {
  align-self: flex-start;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(236, 72, 153, 0.4);
  background: rgba(236, 72, 153, 0.12);
  color: var(--brand);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.review-disagree:disabled {
  cursor: default;
  opacity: 0.6;
}

/* ---- Dev Panel ---- */

.dev-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  flex-direction: column;
  z-index: 50;
  padding: 120px 32px 80px;
}

.dev-overlay.open { display: flex; }

.dev-panel {
  width: 100%;
  max-width: var(--app-max-width);
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
}

.dev-panel-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

.dev-signals {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dev-signal {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dev-signal-label {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  width: 80px;
  flex-shrink: 0;
}

.dev-signal-bar {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
}

.dev-signal-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--phase-color);
  transition: width 0.5s ease;
}

.dev-signal-fill.met { background: var(--thatsus); }

.dev-signal-value {
  font-size: 14px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  width: 48px;
  text-align: right;
  color: var(--text-primary);
}

.dev-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.dev-btn {
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  color: var(--text-secondary);
}

.dev-btn:active { transform: scale(0.96); }

#devRestart {
  background: #D5347A;
  border-color: #D5347A;
  color: #FFFFFF;
}

/* ============================================
   Breakpoint System
   --bp-mobile-sm: 375px (iPhone SE, minimum supported)
   --bp-mobile:    390px (iPhone 14/15, primary target)
   --bp-tablet-sm: 744px (iPad Mini portrait)
   --bp-tablet:    834px (iPad Air portrait)
   Above 834px: cap at max-width, center in viewport.
   ============================================ */

/* 390px+ — iPhone 14/15 primary target */
@media (min-width: 390px) {
  :root {
    --action-btn-size: 88px;
    --action-btn-gap: 40px;
    --action-btn-emoji: 26px;
    --card-gap: 28px;
    --card-area-bottom-pad: 40px;
  }
}

/* 744px+ — iPad Mini portrait */
@media (min-width: 744px) {
  :root {
    --app-max-width: 560px;
    --action-btn-size: 96px;
    --action-btn-gap: 48px;
    --action-btn-emoji: 28px;
    --action-btn-label: 12px;
    --card-gap: 32px;
    --card-padding-x: 24px;
    --card-padding-top: 48px;
    --action-bar-pad-top: 16px;
    --card-area-bottom-pad: 48px;
  }
}

/* 834px+ — iPad Air portrait and above */
@media (min-width: 834px) {
  :root {
    --app-max-width: 600px;
    --card-padding-x: 28px;
    --card-padding-top: 56px;
  }
}

/* ---- Utility ---- */

.hidden { display: none !important; }
