:root {
  color-scheme: light dark;
  --canvas: #f5f5f7;
  --card: #ffffff;
  --card-border: rgba(0, 0, 0, 0.07);
  --card-shadow:
    0 20px 50px -12px rgba(0, 0, 0, 0.08),
    0 4px 16px -4px rgba(0, 0, 0, 0.04);
  --platter: #f2f2f7;
  --platter-hover: #e5e5ea;
  --platter-border: rgba(0, 0, 0, 0.06);
  --glass: rgba(255, 255, 255, 0.84);
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #a1a1a6;
  --accent: #0071e3;
  --active-fill: #1d1d1f;
  --active-text: #ffffff;

  /* Apple iOS Light Mode Vivid Accents for Common & Not */
  --common-tint: rgba(22, 163, 74, 0.09);
  --common-tint-hover: rgba(22, 163, 74, 0.16);
  --common-border: rgba(22, 163, 74, 0.3);
  --common-solid: #16a34a;
  --common-text: #0f5128;

  --not-tint: rgba(225, 29, 72, 0.08);
  --not-tint-hover: rgba(225, 29, 72, 0.15);
  --not-border: rgba(225, 29, 72, 0.28);
  --not-solid: #e11d48;
  --not-text: #7f1027;

  --spring: cubic-bezier(0.32, 0.72, 0, 1);
  --spring-pop: cubic-bezier(0.28, 1.24, 0.38, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #000000;
    --card: #141416;
    --card-border: rgba(255, 255, 255, 0.09);
    --card-shadow:
      0 28px 70px -12px rgba(0, 0, 0, 0.75),
      0 4px 20px -4px rgba(0, 0, 0, 0.5);
    --platter: #1f1f22;
    --platter-hover: #2a2a2e;
    --platter-border: rgba(255, 255, 255, 0.07);
    --glass: rgba(28, 28, 30, 0.82);
    --text: #f5f5f7;
    --text-secondary: #86868b;
    --text-tertiary: #636366;
    --accent: #2997ff;
    --active-fill: #f5f5f7;
    --active-text: #000000;

    /* Apple iOS Dark Mode Luminous Accents for Common & Not */
    --common-tint: rgba(48, 209, 88, 0.13);
    --common-tint-hover: rgba(48, 209, 88, 0.22);
    --common-border: rgba(48, 209, 88, 0.35);
    --common-solid: #1fb854;
    --common-text: #86efac;

    --not-tint: rgba(255, 69, 58, 0.13);
    --not-tint-hover: rgba(255, 69, 58, 0.22);
    --not-border: rgba(255, 69, 58, 0.35);
    --not-solid: #ff453a;
    --not-text: #fda4af;
  }
}

[hidden] {
  display: none !important;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

body {
  position: fixed;
  inset: 0;
  background-color: var(--canvas);
  color: var(--text);
  font-family: var(--font);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding:
    max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Open Minimal Header (No Box / No Card) */
.glass-nav {
  width: 100%;
  max-width: 560px;
  height: 44px;
  background: transparent;
  border: none;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Wordmark: commonornot.com with each part highlighted (Non-clickable) */
.brand-wordmark {
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
  min-width: 0;
  flex-shrink: 1;
  pointer-events: none;
  user-select: none;
  cursor: default;
}

.wm-common {
  color: var(--common-solid);
}

.wm-or {
  color: var(--text-secondary);
  font-weight: 500;
  margin: 0 2px;
}

.wm-not {
  color: var(--not-solid);
}

.wm-tld {
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 1.02rem;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.sound-btn {
  background: transparent;
  border: none;
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s ease, opacity 0.15s ease;
}

.sound-btn.is-muted {
  color: var(--text-secondary);
  opacity: 0.55;
}

.sound-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

@media (hover: hover) {
  .sound-btn:hover {
    color: var(--text);
    opacity: 1;
  }
}

/* Custom Language Label + Invisible Native Select Overlay (Never truncates, never shows focus box) */
.lang-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 0 6px 6px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease;
}

.lang-picker-label {
  white-space: nowrap;
}

.lang-picker-arrow {
  flex-shrink: 0;
  opacity: 0.8;
}

.lang-select-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1rem; /* Prevents iOS zoom */
}

.lang-select-native option {
  background-color: var(--card);
  color: var(--text);
}

@media (hover: hover) {
  .lang-picker:hover {
    color: var(--text);
  }
}

.seg-btn {
  border: none;
  font-family: inherit;
  font-size: 0.8125rem;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.15s ease, transform 0.12s ease;
}

.seg-btn-primary {
  background: var(--active-fill);
  color: var(--active-text);
  font-weight: 600;
}

@media (hover: hover) {
  .seg-btn-primary:hover {
    opacity: 0.9;
  }
}

/* Main Stage */
.stage {
  width: 100%;
  max-width: 560px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 14px 0;
}

.challenge-pill {
  background: var(--card);
  border: 1.5px solid var(--card-border);
  border-radius: 999px;
  padding: 8px 16px;
  margin: 0 auto 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  max-width: 100%;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.challenge-pill p {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Elevated Apple Hardware-Like Card */
.apple-card {
  width: 100%;
  background: var(--card);
  border: 1.5px solid var(--card-border);
  border-radius: 28px;
  padding: 30px 32px;
  box-shadow: var(--card-shadow);
  position: relative;
  transition: transform 0.28s var(--spring), opacity 0.22s ease, background-color 0.2s ease;
}

.apple-card.slide-out {
  opacity: 0;
  transform: scale(0.97) translateY(-6px);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 24px;
  height: 28px;
}

.type-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
}

.back-pill {
  background: var(--platter);
  border: 1.5px solid var(--card-border);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1;
  padding: 5px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, transform 0.15s var(--spring);
}

@media (hover: hover) {
  .back-pill:hover {
    background: var(--platter-hover);
    color: var(--text);
  }
}

.back-pill:active {
  transform: scale(0.96);
}

.card-top-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* Subtle iOS Page Dots */
.apple-dots {
  display: flex;
  align-items: center;
  gap: 4px;
}

.a-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--platter-hover);
  transition: width 0.28s var(--spring-pop), background-color 0.25s ease, transform 0.25s var(--spring-pop);
}

.a-dot.done-common {
  background: var(--common-solid);
}

.a-dot.done-not {
  background: var(--not-solid);
}

.a-dot.just-completed {
  animation: dotPop 0.38s var(--spring-pop);
}

@keyframes dotPop {
  0% {
    transform: scale(0.8);
  }
  55% {
    transform: scale(1.48);
  }
  100% {
    transform: scale(1);
  }
}

.a-dot.active {
  width: 15px;
  background: var(--text);
}

/* Apple Editorial Headline (Locked 4-line height so buttons never shift vertically) */
.apple-headline {
  font-size: clamp(1.5rem, 4.2vw, 2.15rem);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 26px;
  min-height: 4.88em;
  display: flex;
  align-items: center;
  text-wrap: balance;
  overflow-wrap: break-word;
  will-change: transform, opacity;
}

/* Fixed-Height Self-Animating Action Zone (Buttons & Statistic Bar share exact top 86px slot) */
.card-action-zone {
  display: grid;
  grid-template-columns: 100%;
  height: 142px;
  width: 100%;
  position: relative;
  will-change: transform, opacity;
}

/* Directional Staggered Content Transitions inside Stationary Card */
.apple-card.nav-out-forward .apple-headline {
  opacity: 0;
  transform: translateX(-26px) scale(0.985);
  transition: opacity 0.15s ease, transform 0.17s ease-in;
}

.apple-card.nav-out-forward .card-action-zone {
  opacity: 0;
  transform: translateX(-18px) scale(0.985);
  transition: opacity 0.14s ease 0.015s, transform 0.16s ease-in 0.015s;
}

.apple-card.nav-in-forward .apple-headline {
  animation: contentInFromRight 0.38s var(--spring-pop) both;
}

.apple-card.nav-in-forward .card-action-zone {
  animation: contentInFromRight 0.42s var(--spring-pop) 0.035s both;
}

.apple-card.nav-out-back .apple-headline {
  opacity: 0;
  transform: translateX(26px) scale(0.985);
  transition: opacity 0.15s ease, transform 0.17s ease-in;
}

.apple-card.nav-out-back .card-action-zone {
  opacity: 0;
  transform: translateX(18px) scale(0.985);
  transition: opacity 0.14s ease 0.015s, transform 0.16s ease-in 0.015s;
}

.apple-card.nav-in-back .apple-headline {
  animation: contentInFromLeft 0.38s var(--spring-pop) both;
}

.apple-card.nav-in-back .card-action-zone {
  animation: contentInFromLeft 0.42s var(--spring-pop) 0.035s both;
}

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

@keyframes contentInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-30px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* [ Common ]  or  [ Not ] Platter Layout — exact same 86px height & top position as .widget-bar */
.platter-grid {
  grid-area: 1 / 1;
  align-self: start;
  height: 86px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  width: 100%;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity 0.2s ease,
    visibility 0s linear 0s;
}

.card-action-zone.is-verdict .platter-grid {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.16s ease,
    visibility 0s linear 0.16s;
}

.or-bridge {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  user-select: none;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.15s ease;
}

.card-action-zone.is-verdict .or-bridge {
  opacity: 0;
  transform: scale(0.6);
}

.or-text {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.platter-btn {
  min-width: 0;
  height: 100%;
  border-radius: 22px;
  padding: 15px 20px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  transition:
    opacity 0.24s ease,
    filter 0.24s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    transform 0.22s var(--spring-pop),
    box-shadow 0.18s ease;
}

.platter-common {
  background: var(--common-tint);
  border: 1.5px solid var(--common-border);
  color: var(--text);
}

.platter-not {
  background: var(--not-tint);
  border: 1.5px solid var(--not-border);
  color: var(--text);
}

@media (hover: hover) {
  .platter-grid:not(.reading-lock) .platter-common:hover {
    background: var(--common-solid);
    border-color: var(--common-solid);
    color: #ffffff;
    box-shadow: 0 8px 24px -4px rgba(22, 163, 74, 0.35);
  }

  .platter-grid:not(.reading-lock) .platter-not:hover {
    background: var(--not-solid);
    border-color: var(--not-solid);
    color: #ffffff;
    box-shadow: 0 8px 24px -4px rgba(225, 29, 72, 0.35);
  }

  .platter-grid:not(.reading-lock) .platter-btn:hover .platter-title {
    color: #ffffff;
  }

  .platter-grid:not(.reading-lock) .platter-btn:hover .platter-sub {
    color: rgba(255, 255, 255, 0.86);
  }

  .platter-grid:not(.reading-lock) .platter-btn:hover .platter-icon {
    background: rgba(255, 255, 255, 0.24);
    color: #ffffff;
  }
}

.platter-grid:not(.reading-lock) .platter-common:active {
  background: var(--common-solid);
  border-color: var(--common-solid);
  color: #ffffff;
  transform: scale(0.985);
}

.platter-grid:not(.reading-lock) .platter-not:active {
  background: var(--not-solid);
  border-color: var(--not-solid);
  color: #ffffff;
  transform: scale(0.985);
}

.platter-grid:not(.reading-lock) .platter-btn:active .platter-title {
  color: #ffffff;
}

.platter-grid:not(.reading-lock) .platter-btn:active .platter-sub {
  color: rgba(255, 255, 255, 0.86);
}

.platter-grid:not(.reading-lock) .platter-btn:active .platter-icon {
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

.platter-grid.reading-lock .platter-btn {
  opacity: 0.35;
  filter: grayscale(0.65);
  cursor: default;
}

.apple-headline.reading-nudge {
  animation: headlineNudge 0.32s ease;
}

@keyframes headlineNudge {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.platter-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.platter-title {
  font-size: 1.38rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  transition: color 0.16s ease;
}

.platter-common .platter-title {
  color: var(--common-solid);
}

.platter-not .platter-title {
  color: var(--not-solid);
}

.platter-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.2s var(--spring-pop);
}

.platter-icon-svg {
  width: 14px;
  height: 14px;
  display: block;
}

.platter-common .platter-icon {
  background: var(--common-solid);
  color: #ffffff;
}

.platter-not .platter-icon {
  background: var(--not-solid);
  color: #ffffff;
}

.platter-sub {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.16s ease;
}

/* Result Reveal Widget — top bar sits at exact same top:0 & 86px height as .platter-grid */
.result-widget {
  grid-area: 1 / 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    visibility 0s linear 0.18s;
}

.card-action-zone.is-verdict .result-widget {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity 0.18s ease,
    visibility 0s linear 0s;
}

.widget-bar {
  width: 100%;
  height: 86px;
  display: flex;
  gap: 5px;
  margin-bottom: 0;
  flex-shrink: 0;
}

.widget-segment {
  position: relative;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 18px;
  min-width: 64px;
  transition:
    width 0.58s var(--spring-pop),
    padding 0.35s ease,
    transform 0.25s var(--spring),
    filter 0.15s ease;
}

.widget-segment.user-picked {
  overflow: hidden;
}

.widget-segment.user-picked::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 55%;
  background: linear-gradient(
    105deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.28) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: translateX(-160%) skewX(-18deg);
  animation: barSheenSweep 0.75s var(--spring) 0.18s forwards;
  pointer-events: none;
}

@keyframes barSheenSweep {
  to {
    transform: translateX(280%) skewX(-18deg);
  }
}

@media (hover: hover) {
  .widget-segment:not(.user-picked):hover {
    filter: brightness(1.06);
  }
}

.seg-common {
  width: var(--common-pct, 50%);
  min-width: 70px;
  background: var(--common-tint);
  color: var(--common-text);
  border: 1.5px solid var(--common-border);
  border-radius: 22px 10px 10px 22px;
  align-items: flex-start;
}

.seg-not {
  width: var(--not-pct, 50%);
  min-width: 56px;
  background: var(--not-tint);
  color: var(--not-text);
  border: 1.5px solid var(--not-border);
  border-radius: 10px 22px 22px 10px;
  align-items: flex-end;
}

.seg-common.user-picked {
  background: var(--common-solid);
  border-color: var(--common-solid);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.14);
  box-shadow: 0 8px 24px -4px rgba(22, 163, 74, 0.35);
}

.seg-not.user-picked {
  background: var(--not-solid);
  border-color: var(--not-solid);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.14);
  box-shadow: 0 8px 24px -4px rgba(225, 29, 72, 0.35);
}

.widget-segment.user-picked .seg-count {
  opacity: 0.9;
  font-weight: 600;
}

.widget-segment.user-picked .seg-name {
  opacity: 0.98;
}

.seg-pct {
  font-size: 1.48rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.02;
  font-variant-numeric: tabular-nums;
}

.seg-count {
  font-weight: 500;
  opacity: 0.72;
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  line-height: 1.15;
  margin-top: 2px;
  white-space: nowrap;
}

.seg-name {
  font-size: 0.74rem;
  font-weight: 600;
  opacity: 0.92;
  line-height: 1.15;
  margin-top: 2px;
  white-space: nowrap;
}

.widget-segment.seg-narrow {
  padding: 0 10px;
}

.widget-segment.seg-narrow .seg-pct {
  font-size: 1.24rem;
}

.widget-segment.seg-narrow .seg-count {
  font-size: 0.67rem;
}

.widget-segment.seg-narrow .seg-name {
  font-size: 0.69rem;
}

.friend-match {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 42px;
  flex-shrink: 0;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.24s ease 0.06s, transform 0.28s var(--spring) 0.06s;
}

.card-action-zone.is-verdict .card-footer-bar {
  opacity: 1;
  transform: translateY(0);
}

.footer-meta-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.change-vote-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

@media (hover: hover) {
  .change-vote-btn:hover {
    color: var(--text);
    background: var(--platter);
  }
}

.footer-btns {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.apple-pill {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s var(--spring), opacity 0.15s ease, background-color 0.15s ease;
}

.apple-pill:active {
  transform: scale(0.97);
}

.apple-pill-primary {
  background: var(--active-fill);
  color: var(--active-text);
}

.apple-pill-secondary {
  background: #e5e5ea;
  color: var(--text);
}

@media (prefers-color-scheme: dark) {
  .apple-pill-secondary {
    background: #2c2c30;
  }
}

@media (hover: hover) {
  .apple-pill-secondary:hover {
    background: #d8d8de;
  }
}

@media (hover: hover) and (prefers-color-scheme: dark) {
  .apple-pill-secondary:hover {
    background: #38383d;
  }
}

.footer-action-btn {
  height: 42px;
  min-width: 112px;
  padding: 0 20px;
  font-size: 0.875rem;
  font-weight: 600;
}

.btn-inline-icon {
  flex-shrink: 0;
}

.apple-pill-large {
  width: 100%;
  padding: 15px 22px;
  font-size: 0.95rem;
  font-weight: 600;
}

/* Netflix-Style Auto-Filling Next Button */
.netflix-next-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: #e5e5ea;
}

.netflix-next-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #e5e5ea;
  z-index: 0;
  pointer-events: none;
}

@media (prefers-color-scheme: dark) {
  .netflix-next-btn,
  .netflix-next-btn::before {
    background: #2c2c30;
  }
}

.netflix-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0%;
  background: #000000;
  z-index: 1;
  pointer-events: none;
}

@media (prefers-color-scheme: dark) {
  .netflix-fill {
    background: #ffffff;
  }
}

.netflix-fill.running {
  animation: countdownBar 4.5s linear forwards;
}

.netflix-fill.paused {
  animation-play-state: paused;
}

.netflix-label {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: #ffffff;
  mix-blend-mode: difference;
}

.next-arrow {
  font-size: 0.95em;
  line-height: 1;
}

@keyframes countdownBar {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

/* 10-Question Summary Card + Linear Freak-to-NPC Spectrum */
.summary-card {
  text-align: center;
}

.summary-kicker {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0 0 6px;
}

.summary-hero-metric {
  font-size: clamp(2.25rem, 7.5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  margin: 0 0 8px;
  line-height: 1.05;
}

.summary-hero-unit {
  color: var(--text-secondary);
  font-weight: 400;
}

.summary-body {
  font-size: 0.94rem;
  line-height: 1.45;
  color: var(--text-secondary);
  margin: 0 auto 20px;
  max-width: 420px;
  text-wrap: balance;
}

.spectrum-box {
  background: var(--platter);
  border: 1.5px solid var(--platter-border);
  border-radius: 20px;
  padding: 36px 22px 16px;
  margin: 0 0 16px;
}

.spectrum-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--not-solid) 0%, #f59e0b 45%, var(--common-solid) 100%);
}

.spectrum-thumb {
  position: absolute;
  top: 50%;
  left: var(--user-bell-x, 50%);
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--card);
  border: 4px solid var(--text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: left 0.55s var(--spring-pop);
}

.spectrum-tag {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--active-fill);
  color: var(--active-text);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.spectrum-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 10px;
}

.anomaly-platter {
  background: var(--platter);
  border: 1.5px solid var(--platter-border);
  border-radius: 20px;
  padding: 15px 18px 16px;
  text-align: left;
  margin-bottom: 18px;
}

.outlier-carousel-viewport {
  overflow: hidden;
  width: 100%;
}

.anomaly-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.76rem;
}

.anomaly-badge {
  font-weight: 600;
  color: var(--text-secondary);
}

.outlier-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.outlier-dot {
  border: none;
  padding: 0;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--text-tertiary);
  opacity: 0.45;
  cursor: pointer;
  transition: width 0.28s var(--spring-pop), opacity 0.2s ease, background-color 0.2s ease;
}

.outlier-dot.active {
  width: 16px;
  opacity: 1;
  background: var(--text);
}

.outlier-carousel {
  display: flex;
  width: 100%;
  transform: translate3d(calc(var(--outlier-idx, 0) * -100%), 0, 0);
  transition: transform 0.38s var(--spring-pop);
  will-change: transform;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
}

.outlier-carousel:active {
  cursor: grabbing;
}

.anomaly-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  opacity: 0.45;
  transform: scale(0.96);
  transition: transform 0.36s var(--spring-pop), opacity 0.26s ease;
}

.anomaly-slide.is-active {
  opacity: 1;
  transform: scale(1);
}

.anomaly-quote {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: -0.015em;
  min-height: 2.65em;
  display: flex;
  align-items: center;
}

.anomaly-verdict-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.anomaly-choice-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.anomaly-choice-dot.is-common {
  background: var(--common-solid);
}

.anomaly-choice-dot.is-not {
  background: var(--not-solid);
}

.anomaly-choice-word {
  font-weight: 700;
}

.anomaly-choice-word.is-common {
  color: var(--common-solid);
}

.anomaly-choice-word.is-not {
  color: var(--not-solid);
}

.summary-cta-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-sub-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Ambient Footer (Locked 28px height so hiding Skip never shifts the centered card) */
.ambient-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 8px;
  height: 28px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  text-align: center;
  flex-shrink: 0;
}

.ambient-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.exp-footer-stat {
  font-variant-numeric: tabular-nums;
}

.ambient-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font: inherit;
  padding: 4px 4px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.ambient-btn-ask {
  font-weight: 500;
}

@media (hover: hover) {
  .ambient-btn:hover {
    color: var(--text);
  }
}

/* Apple Sheet Dialog */
dialog.apple-sheet {
  background: var(--card);
  color: var(--text);
  border: 1.5px solid var(--card-border);
  border-radius: 26px;
  padding: 0;
  width: min(92vw, 440px);
  max-height: 88dvh;
  overflow-y: auto;
  box-shadow: var(--card-shadow);
}

dialog.apple-sheet-fixed {
  width: min(94vw, 520px);
  height: min(84dvh, 520px);
  overflow: hidden;
}

.sheet-fixed-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.sheet-pinned-top {
  padding: 20px 22px 12px;
  border-bottom: 1px solid var(--card-border);
  flex-shrink: 0;
}

.sheet-scroll-body {
  padding: 16px 22px 22px;
  flex: 1;
  overflow-y: auto;
}

.sheet-input-compact {
  padding: 9px 12px;
  font-size: 0.85rem;
}

dialog.apple-sheet::backdrop {
  background-color: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.sheet-content {
  padding: 24px;
}

.sheet-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.sheet-top h2 {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.sheet-close {
  background: var(--platter);
  border: none;
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 0.8rem;
  cursor: pointer;
  flex-shrink: 0;
}

.sheet-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0 0 16px;
}

.sheet-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sheet-input {
  background: var(--platter);
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
  font-size: 1rem; /* 16px prevents iOS Safari auto-zoom on focus */
  width: 100%;
  user-select: text;
  -webkit-user-select: text;
}

.sheet-input:focus {
  outline: none;
  border-color: var(--text-secondary);
}

.char-counter {
  display: flex;
  justify-content: flex-end;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.sheet-success {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--card-border);
}

/* Own Submitted Questions Section inside +Ask Modal */
.my-questions-wrap {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--card-border);
}

.my-questions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.my-questions-title {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}

.my-questions-pack-btn {
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 999px;
  padding: 5px 11px;
  font: inherit;
  font-size: 0.73rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s var(--spring), opacity 0.15s ease;
}

.my-questions-pack-btn[hidden] {
  display: none;
}

@media (hover: hover) {
  .my-questions-pack-btn:hover {
    opacity: 0.88;
  }
}

.my-questions-pack-btn:active {
  transform: scale(0.96);
}

.my-questions-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.my-q-item {
  background: var(--platter);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.my-q-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.my-q-text {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
  margin: 0;
}

.my-q-remove {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.my-q-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  flex-wrap: wrap;
}

.my-q-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.my-q-common {
  color: var(--common-solid);
}

.my-q-not {
  color: var(--not-solid);
}

.my-q-votes {
  color: var(--text-secondary);
  font-weight: 400;
}

.my-q-share {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  color: var(--text);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
}

/* Moderation Studio Controls */
.admin-auth-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.admin-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: var(--platter);
  padding: 4px;
  border-radius: 12px;
}

.admin-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 7px 6px;
  border-radius: 9px;
  cursor: pointer;
}

.admin-tab.active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.admin-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-item {
  background: var(--platter);
  border-radius: 16px;
  padding: 14px;
  font-size: 0.8125rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-item-meta {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 0.74rem;
  flex-wrap: wrap;
  gap: 4px;
}

.admin-edit-input {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
  font-size: 1rem;
  width: 100%;
}

.admin-item-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.apple-toast {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--active-fill);
  color: var(--active-text);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  z-index: 50;
  max-width: 90vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================================
   MOBILE & COMPACT VIEWPORT RESPONSIVENESS
   ========================================================= */
@media (max-width: 520px) {
  body {
    padding:
      max(12px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }

  .glass-nav {
    height: 40px;
    padding: 0 2px;
    gap: 8px;
  }

  .brand-wordmark {
    font-size: 1.12rem;
  }

  .wm-tld {
    font-size: 0.92rem;
  }

  .nav-controls {
    gap: 4px;
  }

  .sound-btn {
    width: 30px;
    height: 30px;
  }

  .lang-picker {
    font-size: 0.82rem;
  }

  .seg-btn {
    font-size: 0.76rem;
    padding: 6px 11px;
  }

  .stage {
    margin: 10px 0;
  }

  .apple-card {
    padding: 22px 18px;
    border-radius: 24px;
  }

  .card-top {
    margin-bottom: 16px;
  }

  .apple-headline {
    font-size: clamp(1.28rem, 5.3vw, 1.56rem);
    line-height: 1.24;
    margin: 0 0 20px;
    min-height: 4.96em;
  }

  .card-action-zone {
    height: 124px;
  }

  .platter-grid {
    height: 74px;
    gap: 6px;
  }

  .or-bridge {
    padding: 0 1px;
  }

  .or-text {
    font-size: 0.76rem;
  }

  .platter-btn {
    padding: 12px 14px;
    border-radius: 18px;
    gap: 4px;
  }

  .platter-title {
    font-size: 1.15rem;
  }

  .platter-icon {
    width: 22px;
    height: 22px;
    font-size: 0.72rem;
  }

  .platter-icon-svg {
    width: 12px;
    height: 12px;
  }

  .platter-sub {
    font-size: 0.75rem;
  }

  .widget-bar {
    height: 74px;
    margin-bottom: 0;
  }

  .card-footer-bar {
    height: 38px;
  }

  .widget-segment {
    padding: 0 12px;
  }

  .seg-common {
    min-width: 60px;
    border-radius: 18px 8px 8px 18px;
  }

  .seg-not {
    min-width: 48px;
    border-radius: 8px 18px 18px 8px;
  }

  .widget-segment.seg-narrow {
    padding: 0 8px;
  }

  .seg-pct {
    font-size: 1.26rem;
    line-height: 1.02;
  }

  .widget-segment.seg-narrow .seg-pct {
    font-size: 1.08rem;
  }

  .seg-count {
    font-size: 0.66rem;
    line-height: 1.1;
    margin-top: 1px;
  }

  .widget-segment.seg-narrow .seg-count {
    font-size: 0.61rem;
  }

  .seg-name {
    font-size: 0.68rem;
    line-height: 1.1;
    margin-top: 2px;
  }

  .widget-segment.seg-narrow .seg-name {
    font-size: 0.63rem;
  }

  .apple-pill {
    padding: 9px 15px;
    font-size: 0.82rem;
  }

  .footer-action-btn {
    height: 38px;
    min-width: 100px;
    padding: 0 16px;
    font-size: 0.82rem;
  }

  .apple-pill-large {
    padding: 13px 18px;
    font-size: 0.9rem;
  }

  .spectrum-box {
    padding: 32px 16px 14px;
  }

  .anomaly-platter {
    padding: 14px 15px;
  }

  .anomaly-quote {
    font-size: 0.95rem;
  }

  .sheet-content {
    padding: 20px 18px;
  }

  .sheet-pinned-top {
    padding: 16px 16px 10px;
  }

  .sheet-scroll-body {
    padding: 14px 16px 18px;
  }
}

/* Ultra-Small Phones (<= 360px like iPhone SE / Mini / Fold Cover) */
@media (max-width: 360px) {
  .wm-tld {
    display: none;
  }

  .apple-card {
    padding: 18px 14px;
    border-radius: 20px;
  }

  .platter-btn {
    padding: 14px 11px;
  }

  .platter-title {
    font-size: 1.04rem;
  }

  .platter-icon {
    width: 20px;
    height: 20px;
    font-size: 0.68rem;
  }

  .summary-sub-row {
    grid-template-columns: 1fr;
  }
}

/* Reduced Motion Accessibility */
@media (prefers-reduced-motion: reduce) {
  .apple-card,
  .platter-btn,
  .result-widget,
  .widget-segment {
    transition: none !important;
    animation: none !important;
  }
  .netflix-fill.running {
    animation-duration: 4.5s;
  }
}
