/* Funnel step one on a phone: a switch above the frame shows one Google page
   at a time, and each page scrolls inside the frame. Wide screens keep the
   slider (compare.css) and hide these parts. */
.compare-switch {
  display: none;
}
@media (max-width: 760px) {
  .quiz-dialog.step-compare .quiz-bottom,
  .compare-shown,
  .compare-side,
  .compare-drag,
  .compare-source,
  .ba-handle,
  .ba-range {
    display: none;
  }
  .quiz-dialog.step-compare .quiz-workspace {
    padding-bottom: 0;
  }
  .compare-head {
    gap: 0;
  }
  .compare-head .quiz-question {
    margin-bottom: 8px;
    font-size: 26px;
  }
  .compare-status {
    display: block;
    min-height: 0;
    margin: 0;
  }

  .compare-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 8px;
    padding: 4px;
    border-radius: 12px;
    background: var(--soft);
    box-shadow: inset 0 0 0 1px var(--line);
  }
  .compare-switch-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-width: 0;
    min-height: 48px;
    padding: 4px 8px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    line-height: 1.25;
  }
  .compare-switch-option b {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
  }
  .compare-switch-option small {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
  }
  .compare-switch-option[aria-pressed="true"] {
    background: var(--white);
    box-shadow:
      0 0 0 1px var(--cmp-chip-line),
      0 2px 6px var(--cmp-frame-shadow);
  }
  .compare-switch-option:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 1px;
  }
  .compare-switch-state::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
  }
  .compare-switch-state[data-state="live"]::before {
    background: var(--cmp-live);
  }
  .compare-switch-state[data-state="example"] {
    color: var(--cmp-example);
  }

  /* The frame fills the screen between the switch and the Back / Continue bar, measured at 390x664 and
     360x640; on Rhonda's page the topic buttons take a row under it. */
  .ba {
    display: flex;
    flex-direction: column;
    height: max(300px, calc(100svh - 286px));
  }
  .compare-step[data-view="good"] .ba {
    height: max(240px, calc(100svh - 338px));
  }
  .ba-after,
  .ba-before {
    position: relative;
    inset: auto;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden auto;
    overscroll-behavior: contain;
    clip-path: none;
  }
  .ba-scroll {
    position: relative;
  }
  .ba-caption {
    position: static;
    flex: none;
    border-radius: 0;
  }
  .ba-caption:empty {
    padding: 0;
  }

  .compare-moves {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .compare-move {
    padding: 7px 2px;
    border-color: var(--cmp-chip-line);
    border-radius: 10px;
    background: linear-gradient(var(--white), var(--soft));
    box-shadow: 0 1px 3px var(--cmp-grip-shadow);
    font-size: 12.5px;
    letter-spacing: -0.01em;
  }
  .compare-move:active {
    box-shadow: none;
    translate: 0 1px;
  }
  .compare-move[aria-pressed="true"] {
    background: var(--ink);
    box-shadow: 0 0 0 2px var(--gold-deep);
  }
  /* One page at a time: the other page, and Rhonda's topic buttons on "Your Google", are hidden. */
  .compare-step[data-view="yours"] .ba-after,
  .compare-step[data-view="good"] .ba-before,
  .compare-step[data-view="yours"] .ba-caption,
  .compare-step[data-view="yours"] .compare-foot {
    display: none;
  }
}
@media (max-width: 760px) and (prefers-reduced-motion: no-preference) {
  .compare-step[data-view="yours"] .ba-before,
  .compare-step[data-view="good"] .ba-after {
    animation: cmp-fade var(--motion-ui) var(--motion-ease);
  }
  .compare-switch-option {
    transition:
      background-color var(--motion-fast) ease,
      box-shadow var(--motion-fast) ease;
  }
  .compare-switch-state[data-state="loading"]::before {
    animation: cmp-pulse 900ms ease-in-out infinite alternate;
  }
}
@keyframes cmp-fade {
  from {
    opacity: 0;
  }
}
@media (max-width: 760px) and (forced-colors: active) {
  .compare-switch-option[aria-pressed="true"] {
    outline: 2px solid Highlight;
  }
}
