/* Ultra-narrow, single-viewport game layout.
   320 x 568 is the stress case; 360 x 640 is the vertical-video target. */
@media (max-width: 560px) {
  html,
  body,
  #root {
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    overflow: hidden;
  }

  body {
    font-size: 12px;
  }

  button {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .app-shell {
    width: 100%;
    height: 100dvh;
    margin: 0;
    padding: max(5px, env(safe-area-inset-top)) 6px
      max(5px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .app-header {
    flex: 0 0 40px;
    min-height: 40px;
    gap: 6px;
    padding: 1px 3px 5px;
  }

  .brand-lockup {
    gap: 7px;
    min-width: 0;
  }

  .brand-mark {
    width: 29px;
    height: 29px;
    border-radius: 9px;
    font-size: 0.66rem;
  }

  .brand-lockup > div {
    min-width: 0;
  }

  .brand-lockup strong {
    font-size: 0.73rem;
    line-height: 1.05;
  }

  .brand-lockup > div > span {
    display: none;
  }

  .header-context {
    gap: 4px;
    min-width: 0;
  }

  .case-brief-button {
    min-height: 28px;
    padding: 4px 7px;
    font-size: 0.59rem;
    white-space: nowrap;
  }

  .role-badge {
    min-width: 0;
    padding: 5px 7px;
    border-radius: 9px;
  }

  .role-badge > span {
    display: none;
  }

  .role-badge strong {
    max-width: 92px;
    font-size: 0.59rem;
    line-height: 1.05;
    text-align: right;
  }

  /* Briefing: setup, role, two checks, and CTA all stay above the fold. */
  .case-briefing {
    flex: 1;
    min-height: 0;
    margin-top: 5px;
    border-radius: 16px;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(118px, 28%) minmax(0, 72%);
  }

  .briefing-visual {
    min-height: 0;
  }

  .briefing-visual .evidence-photo {
    background-position: 50% 28%;
  }

  .briefing-visual::after {
    inset: 48% 0 0;
  }

  .missing-label {
    top: 9px;
    left: 9px;
    padding: 5px 8px;
    font-size: 0.52rem;
  }

  .pepper-nameplate {
    gap: 1px;
    bottom: 9px;
    left: 12px;
    right: 12px;
  }

  .pepper-nameplate > span,
  .pepper-nameplate > small {
    font-size: 0.55rem;
  }

  .pepper-nameplate strong {
    font-size: 1.75rem;
    line-height: 0.9;
  }

  .briefing-content {
    justify-content: flex-start;
    min-height: 0;
    padding: 8px 10px;
    overflow: hidden;
  }

  .briefing-eyebrow {
    font-size: 0.5rem;
  }

  .briefing-content h1 {
    margin: 3px 0 0;
    font-size: 1.7rem;
    line-height: 0.92;
  }

  .briefing-lead {
    margin: 3px 0 6px;
    font-size: 0.7rem;
  }

  .incident-summary {
    grid-template-columns: 43px minmax(0, 1fr);
    gap: 6px;
    padding: 6px 0;
  }

  .incident-summary time {
    font-size: 0.68rem;
  }

  .incident-summary div {
    gap: 1px;
  }

  .incident-summary strong {
    font-size: 0.56rem;
  }

  .incident-summary p {
    font-size: 0.58rem;
    line-height: 1.23;
  }

  .briefing-cards {
    gap: 5px;
    margin: 6px 0;
  }

  .ai-briefing-card,
  .role-briefing-card {
    min-height: 0;
    border-radius: 10px;
    padding: 6px 7px;
  }

  .ai-briefing-card > span,
  .role-briefing-card > span {
    margin-bottom: 3px;
    font-size: 0.47rem;
  }

  .ai-briefing-card strong,
  .role-briefing-card strong {
    font-size: 0.62rem;
    line-height: 1.12;
  }

  .ai-briefing-card strong b {
    display: inline;
    font-size: 0.95rem;
  }

  .ai-briefing-card small,
  .role-briefing-card p {
    margin-top: 3px;
    font-size: 0.48rem;
    line-height: 1.16;
  }

  .paws-briefing {
    margin: 0 0 6px;
    border-radius: 10px;
    padding: 6px;
  }

  .paws-briefing-head {
    gap: 1px;
    margin-bottom: 4px;
  }

  .paws-briefing-head > span {
    font-size: 0.47rem;
  }

  .paws-briefing-head > strong {
    font-size: 0.56rem;
    line-height: 1.15;
  }

  .paws-guide {
    gap: 4px;
  }

  .paws-guide > div {
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 4px;
    border-radius: 8px;
    padding: 4px;
  }

  .paws-guide b {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    font-size: 0.52rem;
  }

  .paws-guide strong {
    font-size: 0.52rem;
  }

  .paws-guide small {
    font-size: 0.45rem;
    line-height: 1.05;
  }

  .paws-briefing-note {
    display: none;
  }

  .briefing-cta {
    min-height: 35px;
    border-radius: 10px;
    padding: 7px 10px;
    font-size: 0.66rem;
    box-shadow: none;
  }

  .briefing-cta span {
    font-size: 0.9rem;
  }

  .briefing-microcopy {
    display: none;
  }

  /* Shared six-screen frame. */
  .progress-shell {
    flex: 0 0 26px;
    gap: 2px;
    margin: 3px 12px 1px;
  }

  .progress-line {
    top: 10px;
    left: 8%;
    right: 8%;
  }

  .progress-shell button {
    gap: 0;
    padding: 0;
  }

  .progress-shell button > span {
    width: 21px;
    height: 21px;
    border-width: 1px;
    font-size: 0.52rem;
  }

  .progress-shell button.is-current > span {
    box-shadow: 0 0 0 3px #17232a14;
  }

  .progress-shell button small {
    display: none;
  }

  .case-heading {
    flex: 0 0 auto;
    min-width: 0;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 3px;
    padding: 3px 4px 4px;
  }

  .case-meta {
    gap: 4px;
    margin-bottom: 2px;
  }

  .case-meta span,
  .case-meta b,
  .case-meta i {
    padding: 2px 5px;
    font-size: 0.48rem;
  }

  .case-heading h1 {
    max-width: none;
    font-size: 1.18rem;
    line-height: 0.98;
  }

  .case-heading > div > p {
    display: none;
  }

  .paws-meter-panel {
    gap: 2px;
    margin-top: 3px;
  }

  .paws-meter-title {
    display: none;
  }

  .paws-meter {
    gap: 4px;
  }

  .paws-meter > div {
    gap: 4px;
    border-radius: 8px;
    padding: 3px 5px;
  }

  .mini-mark,
  .paws-meter > div > span {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    font-size: 0.52rem;
  }

  .paws-meter > div > div {
    gap: 2px;
  }

  .paws-meter strong {
    font-size: 0.52rem;
  }

  .paw-meter-copy small {
    font-size: 0.46rem;
  }

  .paws-meter i {
    height: 3px;
  }

  .task-ribbon {
    flex: 0 0 auto;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px;
    margin: 0 0 4px;
    padding: 5px 7px;
    border-left-width: 4px;
    border-radius: 10px;
  }

  .task-kicker {
    padding: 4px 6px;
    font-size: 0.48rem;
  }

  .task-copy {
    gap: 0;
  }

  .task-copy strong {
    font-size: 0.65rem;
    line-height: 1.12;
  }

  .task-copy span,
  .task-progress,
  .task-ribbon > button {
    display: none;
  }

  .workspace-grid {
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .board-shell {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .board-topline {
    flex: 0 0 23px;
    padding: 6px 8px;
    font-size: 0.48rem;
  }

  .board-topline b {
    display: none;
  }

  .board-shell > .scene-enter {
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .app-footer {
    flex: 0 0 38px;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 4px;
    padding: 4px 0 0;
  }

  .app-footer > span {
    display: none;
  }

  .back-button,
  .next-button {
    min-height: 34px;
    border-radius: 9px;
    padding: 6px 8px;
    font-size: 0.62rem;
  }

  /* Evidence map: all three tappable receipts stay visible and never overlap. */
  .map-board {
    min-height: 0;
    padding: 0;
  }

  .map-title-card {
    top: 6px;
    left: 6px;
    width: 123px;
    border-radius: 9px;
    gap: 1px;
    padding: 5px 6px;
  }

  .map-title-card > small {
    display: none;
  }

  .map-title-card > span {
    font-size: 0.42rem;
  }

  .map-title-card > strong {
    font-size: 0.6rem;
  }

  .ai-verdict {
    top: 6px;
    right: 6px;
    width: 139px;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 5px;
    border-radius: 9px;
    padding: 5px;
  }

  .ai-pet-thumb {
    width: 28px;
    height: 34px;
    border-radius: 6px;
  }

  .ai-verdict-copy > span {
    font-size: 0.42rem;
  }

  .ai-verdict-copy > strong {
    font-size: 0.58rem;
    line-height: 1.05;
  }

  .ai-confidence {
    font-size: 0.48rem;
  }

  .zone {
    border-width: 1px;
  }

  .zone b {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    font-size: 0.48rem;
    top: 5px;
    left: 5px;
  }

  .zone > span,
  .zone > small {
    left: 29px;
  }

  .zone > span {
    top: 6px;
    font-size: 0.42rem;
  }

  .zone > small {
    top: 20px;
    font-size: 0.39rem;
  }

  .map-landmark {
    gap: 3px;
    padding: 2px 4px;
    font-size: 0.4rem;
  }

  .map-landmark i {
    width: 4px;
    height: 4px;
    box-shadow: none;
  }

  .evidence-node {
    width: calc((100% - 24px) / 3);
    min-height: 50px;
    gap: 4px;
    border-radius: 8px;
    padding: 4px;
  }

  .evidence-node small {
    font-size: 0.4rem;
  }

  .evidence-node strong {
    font-size: 0.49rem;
    line-height: 1.08;
  }

  .node-symbol {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 0.48rem;
  }

  .tap-cue {
    display: none;
  }

  .node-left {
    top: auto;
    bottom: 6px;
    left: 6px;
  }

  .node-bottom {
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
  }

  .node-bottom:hover {
    transform: translateX(-50%);
  }

  .node-right {
    top: auto;
    right: 6px;
    bottom: 6px;
  }

  /* Evidence receipts are small-screen modals, not scrollable sidebars. */
  .receipt-rail {
    width: calc(100% - 12px);
    max-height: calc(100dvh - 12px);
    border-radius: 16px;
    padding: 12px;
    overflow: hidden;
  }

  .receipt-close {
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }

  .receipt-mobile-label {
    margin-bottom: 6px;
    font-size: 0.5rem;
  }

  .receipt-status {
    padding-right: 34px;
    font-size: 0.5rem;
  }

  .receipt-status b {
    padding: 3px 6px;
  }

  .receipt-rail h2 {
    margin: 8px 0 5px;
    font-size: 1.15rem;
    line-height: 1;
  }

  .receipt-rail > p {
    font-size: 0.65rem;
    line-height: 1.27;
  }

  .source-equation {
    gap: 5px;
    margin-top: 8px;
  }

  .source-equation strong {
    min-height: 47px;
    border-radius: 9px;
    padding: 5px;
    font-size: 0.54rem;
  }

  .source-equation strong b {
    font-size: 1.15rem;
  }

  .source-equation > span {
    font-size: 0.48rem;
  }

  .receipt-takeaway {
    gap: 2px;
    margin-top: 8px;
    border-radius: 9px;
    padding: 8px;
  }

  .receipt-takeaway span {
    font-size: 0.48rem;
  }

  .receipt-takeaway strong {
    font-size: 0.72rem;
    line-height: 1.12;
  }

  .source-receipt {
    gap: 6px;
    margin-top: 6px;
    padding: 6px 0;
  }

  .source-receipt span,
  .paw-explainer span {
    font-size: 0.54rem;
  }

  .source-receipt strong,
  .paw-explainer strong {
    font-size: 0.59rem;
  }

  .paw-explainer {
    gap: 6px;
    margin-top: 6px;
  }

  .paw-explainer .mini-mark {
    width: 24px;
    height: 24px;
  }

  .receipt-done {
    margin-top: 8px;
    border-radius: 9px;
    padding: 8px 12px;
    font-size: 0.65rem;
  }

  /* Screen 2: one active image-check step at a time, with the comparison visible. */
  .compare-board {
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 5px;
    padding: 5px;
  }

  .compare-stage {
    min-height: 0;
    border-radius: 10px;
    padding: 6px;
    display: flex;
    flex-direction: column;
  }

  .compare-labels {
    flex: 0 0 auto;
    margin-bottom: 3px;
    font-size: 0.48rem;
  }

  .compare-image-wrap {
    flex: 1;
    min-height: 0;
    height: auto;
    border-radius: 8px;
  }

  .compare-handle::after {
    width: 26px;
    height: 26px;
    font-size: 0.65rem;
  }

  .compare-control {
    flex: 0 0 auto;
    gap: 1px;
    margin-top: 3px;
    font-size: 0.48rem;
  }

  .compare-control input {
    height: 13px;
  }

  .compare-guide {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    border-radius: 10px;
    padding: 4px;
  }

  .compare-guide-head {
    display: none;
  }

  .compare-step {
    min-height: 38px;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 4px;
    border-radius: 8px;
    padding: 4px;
  }

  .step-number {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    font-size: 0.52rem;
  }

  .compare-step > div strong {
    font-size: 0.5rem;
    line-height: 1.05;
  }

  .compare-step > div small,
  .compare-step > b {
    display: none;
  }

  .compare-finding {
    display: none;
  }

  .compare-finding.has-finding {
    grid-column: 1 / -1;
    gap: 1px;
    margin: 0;
    border-radius: 8px;
    padding: 5px 7px;
    display: grid;
  }

  .compare-finding.has-finding > span {
    font-size: 0.44rem;
  }

  .compare-finding.has-finding p {
    font-size: 0.5rem;
    line-height: 1.12;
  }

  .image-assumption {
    top: 6px;
    right: 6px;
    width: min(178px, 66%);
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 5px;
    border-radius: 8px;
    padding: 6px;
  }

  .image-assumption > span {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-size: 0.52rem;
  }

  .image-assumption small {
    font-size: 0.42rem;
  }

  .image-assumption strong {
    font-size: 0.54rem;
    line-height: 1.08;
  }

  .image-assumption p {
    font-size: 0.46rem;
    line-height: 1.12;
  }

  .search-decision {
    display: none;
  }

  .compare-board:has(.compare-step:nth-child(4).is-current) .search-decision {
    grid-column: 1;
    grid-template-columns: 1fr;
    gap: 4px;
    border-radius: 10px;
    padding: 5px;
    display: grid;
  }

  .search-decision-head {
    gap: 1px;
  }

  .search-decision-head > span {
    font-size: 0.44rem;
  }

  .search-decision-head h3 {
    font-size: 0.66rem;
    line-height: 1.05;
  }

  .search-decision-head p {
    display: none;
  }

  .decision-strip {
    gap: 4px;
  }

  .decision-strip button {
    min-height: 45px;
    gap: 4px;
    border-radius: 8px;
    padding: 5px;
  }

  .decision-strip button strong {
    font-size: 0.49rem;
    line-height: 1.06;
  }

  .decision-strip button small {
    display: none;
  }

  .choice-dot {
    width: 10px;
    height: 10px;
    border-width: 1px;
  }

  /* Screen 3: scene first, then one readable alert card with both targets. */
  .alert-board {
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: 76px minmax(0, 1fr) auto;
    gap: 5px;
    padding: 5px;
  }

  .alert-photo-wrap {
    min-height: 0;
    border-radius: 9px;
  }

  .alert-photo-wrap .evidence-photo {
    background-position: 50% 47%;
  }

  .source-stamp {
    bottom: 5px;
    left: 5px;
    border-radius: 5px;
    padding: 3px 5px;
    font-size: 0.46rem;
  }

  .family-alert {
    min-height: 0;
    align-self: stretch;
    border-radius: 9px;
    padding: 8px;
    transform: none;
    overflow: hidden;
  }

  .alert-header {
    gap: 6px;
    padding-bottom: 5px;
  }

  .school-seal {
    width: 28px;
    height: 28px;
    font-size: 0.55rem;
  }

  .alert-header strong {
    font-size: 0.66rem;
  }

  .alert-header span {
    font-size: 0.5rem;
  }

  .family-alert p {
    margin: 7px 0 6px;
    font-size: 0.82rem;
    line-height: 1.36;
  }

  .claim,
  .claim-open {
    padding: 1px 3px;
  }

  .privacy-line {
    grid-template-columns: 45px minmax(0, 1fr) auto;
    gap: 5px;
    border-radius: 7px;
    padding: 5px;
  }

  .privacy-line.student-photo,
  .student-photo {
    width: 45px;
    height: 34px;
    border-radius: 6px;
  }

  .privacy-line > span i,
  .privacy-line > span small {
    font-size: 0.46rem;
  }

  .privacy-line > span strong {
    font-size: 0.56rem;
  }

  .privacy-line > b {
    padding: 3px 5px;
    font-size: 0.44rem;
  }

  .receipt-key {
    gap: 6px;
    font-size: 0.49rem;
  }

  .key-dot {
    width: 6px;
    height: 6px;
    margin-right: 3px;
  }

  /* Screen 4: compact camera receipt above the editable alert. */
  .message-choice-board {
    min-height: 0;
    gap: 5px;
    padding: 5px;
  }

  .alert-rewrite-layout {
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: 76px minmax(0, 1fr);
    gap: 5px;
  }

  .alert-rewrite-image {
    min-height: 0;
    border-radius: 9px;
  }

  .alert-rewrite-image > .evidence-photo {
    background-position: 50% 47%;
  }

  .camera-facts {
    gap: 1px;
    right: 5px;
    bottom: 5px;
    left: 5px;
    border-radius: 7px;
    padding: 5px 7px;
  }

  .camera-facts span {
    font-size: 0.44rem;
  }

  .camera-facts strong {
    font-size: 0.54rem;
    line-height: 1.1;
  }

  .editable-alert {
    min-height: 0;
    border-radius: 9px;
    align-content: stretch;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 6px;
    padding: 8px;
  }

  .editable-alert-head {
    gap: 6px;
    padding-bottom: 5px;
  }

  .editable-alert-head span {
    font-size: 0.45rem;
  }

  .editable-alert-head strong {
    font-size: 0.58rem;
  }

  .editable-alert > p {
    align-self: center;
    font-size: 0.8rem;
    line-height: 1.38;
  }

  .edit-token {
    border-radius: 6px;
    margin: 1px;
    padding: 3px 5px;
  }

  .edit-token small {
    font-size: 0.4rem;
  }

  .edit-progress {
    gap: 5px;
    border-radius: 7px;
    padding: 6px 7px;
  }

  .edit-progress span,
  .edit-progress strong {
    font-size: 0.5rem;
  }

  .message-choice-board:has(.alert-lesson) .alert-rewrite-layout {
    display: none;
  }

  .alert-lesson {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 5px;
    border-radius: 10px;
    padding: 6px;
  }

  .clean-alert-preview {
    gap: 3px;
    border-radius: 8px;
    padding: 8px;
  }

  .clean-alert-preview span {
    font-size: 0.45rem;
  }

  .clean-alert-preview strong {
    font-size: 0.68rem;
    line-height: 1.25;
  }

  .two-filter-lesson {
    gap: 5px;
  }

  .two-filter-lesson article {
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 5px;
    border-radius: 8px;
    padding: 6px;
  }

  .two-filter-lesson b {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 0.5rem;
  }

  .two-filter-lesson strong {
    font-size: 0.55rem;
  }

  .two-filter-lesson span {
    font-size: 0.48rem;
    line-height: 1.15;
  }

  .alert-lesson > p {
    grid-column: 1;
    margin: 0;
    font-size: 0.52rem;
    line-height: 1.18;
  }

  /* Screen 5: the full live map stays on-screen before and after Pepper is found. */
  .find-pepper-board {
    min-height: 0;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 5px;
    padding: 5px;
  }

  .park-find-scene {
    min-height: 0;
    height: 100%;
    border-radius: 10px;
  }

  .find-town-map {
    object-position: 50% 50%;
  }

  .park-scene-label {
    top: 6px;
    left: 6px;
    max-width: 196px;
    gap: 1px;
    border-radius: 8px;
    padding: 6px 7px;
  }

  .park-scene-label span,
  .find-zone-c span {
    font-size: 0.43rem;
  }

  .park-scene-label strong {
    font-size: 0.55rem;
    line-height: 1.12;
  }

  .find-zone-c {
    border-width: 1px;
  }

  .find-zone-c b {
    top: 6px;
    left: 7px;
    width: 21px;
    height: 21px;
    border-radius: 6px;
    font-size: 0.5rem;
  }

  .find-zone-c span {
    top: 10px;
    left: 33px;
  }

  .ai-search-decoy {
    right: 10%;
    width: 70px;
    min-height: 48px;
    gap: 1px;
    border-width: 1px;
    border-radius: 8px;
    padding: 5px;
  }

  .ai-search-decoy span {
    font-size: 0.8rem;
  }

  .ai-search-decoy strong {
    font-size: 0.46rem;
  }

  .ai-search-decoy small {
    font-size: 0.4rem;
  }

  .hidden-pepper,
  .found-pepper-marker {
    bottom: 4%;
    left: 27%;
    width: 56px;
    height: 66px;
  }

  .hidden-pepper {
    animation: none;
  }

  .hidden-pepper .pepper-cutout {
    animation: 1.65s ease-in-out infinite pepper-peek;
  }

  .found-pepper-marker > span {
    padding: 2px 5px;
    font-size: 0.43rem;
  }

  .search-miss-feedback {
    right: 6px;
    bottom: 6px;
    max-width: 150px;
    gap: 1px;
    border-left-width: 3px;
    border-radius: 8px;
    padding: 6px 7px;
  }

  .search-miss-feedback b {
    font-size: 0.54rem;
  }

  .search-miss-feedback span {
    font-size: 0.46rem;
    line-height: 1.15;
  }

  .find-verification {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .find-success {
    gap: 6px;
    border-radius: 8px;
    padding: 6px 7px;
  }

  .find-success-mark {
    width: 25px;
    height: 25px;
    font-size: 0.6rem;
  }

  .find-success span,
  .find-success p {
    font-size: 0.48rem;
  }

  .find-success strong {
    font-size: 0.6rem;
  }

  .confirmation-check {
    grid-template-columns: 1fr;
    gap: 4px;
    border-radius: 8px;
    padding: 5px;
  }

  .confirmation-check > div:first-child {
    gap: 1px;
  }

  .confirmation-check > div:first-child > span {
    font-size: 0.43rem;
  }

  .confirmation-check > div:first-child > strong {
    font-size: 0.56rem;
    line-height: 1.08;
  }

  .confirmation-options {
    gap: 4px;
  }

  .confirmation-options button {
    min-height: 40px;
    gap: 4px;
    border-radius: 7px;
    padding: 4px 5px;
  }

  .confirmation-options button > span {
    min-width: 29px;
    height: 25px;
    border-radius: 6px;
    padding: 0 4px;
    font-size: 0.45rem;
  }

  .confirmation-options button > strong {
    font-size: 0.5rem;
    line-height: 1.1;
  }

  .confirmation-feedback {
    border-left-width: 3px;
    border-radius: 7px;
    padding: 5px 7px;
    font-size: 0.48rem;
    line-height: 1.15;
  }

  /* Screen 6: a one-frame debrief with the win, judgment calls, stakes, and rule. */
  body:has(.outcome-debrief) .task-ribbon,
  body:has(.outcome-debrief) .paws-meter-panel {
    display: none;
  }

  body:has(.outcome-debrief) .case-heading {
    padding-bottom: 5px;
  }

  body:has(.outcome-debrief) .case-heading h1 {
    font-size: 1.08rem;
  }

  .simple-replay.outcome-debrief {
    height: 100%;
    min-height: 0;
    grid-template-rows:
      minmax(84px, 20%)
      minmax(86px, 22%)
      minmax(92px, 24%)
      minmax(0, 1fr);
    gap: 4px;
    padding: 4px;
  }

  .outcome-debrief .pepper-found-hero {
    min-height: 0;
    grid-template-columns: 70px minmax(0, 1fr);
    border-radius: 9px;
  }

  .debrief-pepper {
    width: 70px;
    height: 80px;
  }

  .pepper-found-hero > div {
    gap: 2px;
    padding: 6px;
  }

  .pepper-found-hero span {
    font-size: 0.43rem;
  }

  .outcome-debrief .pepper-found-hero h2 {
    font-size: 0.84rem;
    line-height: 0.96;
  }

  .outcome-debrief .pepper-found-hero p {
    font-size: 0.48rem;
    line-height: 1.12;
  }

  .debrief-stats {
    flex-wrap: nowrap;
    gap: 3px;
    margin-top: 2px;
  }

  .debrief-stats span {
    gap: 2px;
    border-radius: 6px;
    padding: 2px 4px;
    font-size: 0.4rem;
  }

  .debrief-stats b {
    font-size: 0.55rem;
  }

  .debrief-section {
    min-height: 0;
    border-radius: 9px;
    gap: 3px;
    padding: 4px;
  }

  .debrief-section-head {
    display: none;
  }

  .reasoning-wins {
    height: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 3px;
  }

  .reasoning-wins::before {
    display: none;
  }

  .reasoning-wins article {
    min-height: 0;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 3px;
    border-radius: 7px;
    padding: 4px;
  }

  .reasoning-wins article > span {
    width: 18px;
    height: 18px;
    border-width: 2px;
    font-size: 0.44rem;
    box-shadow: none;
  }

  .reasoning-wins article > div {
    align-content: center;
    gap: 1px;
  }

  .reasoning-wins strong {
    font-size: 0.49rem;
    line-height: 1.08;
  }

  .reasoning-wins p {
    display: none;
  }

  .reasoning-wins small {
    font-size: 0.4rem;
    line-height: 1.05;
  }

  .consequence-compare {
    min-height: 0;
    gap: 4px;
  }

  .consequence-compare > div {
    min-height: 0;
    align-content: start;
    gap: 2px;
    border-radius: 9px;
    padding: 5px;
  }

  .consequence-compare > div > span {
    font-size: 0.42rem;
    line-height: 1.05;
  }

  .consequence-compare h3 {
    font-size: 0.57rem;
    line-height: 1.08;
  }

  .consequence-compare ul {
    gap: 2px;
  }

  .consequence-compare li {
    display: block;
    border-radius: 5px;
    padding: 2px 4px;
  }

  .consequence-compare li b {
    font-size: 0.45rem;
  }

  .consequence-compare li span {
    display: none;
  }

  .transfer-lesson {
    min-height: 0;
    grid-template-columns: 1fr;
    align-content: center;
    gap: 4px;
    border-radius: 9px;
    padding: 6px;
  }

  .transfer-lesson > div:first-child {
    gap: 1px;
  }

  .transfer-lesson > div:first-child > span {
    font-size: 0.42rem;
  }

  .transfer-lesson h3 {
    font-size: 0.7rem;
    line-height: 1.04;
  }

  .transfer-lesson p {
    display: none;
  }

  .transfer-rules {
    gap: 3px;
  }

  .transfer-rules span {
    min-height: 0;
    grid-template-columns: 17px minmax(0, 1fr);
    gap: 3px;
    border-radius: 6px;
    padding: 3px;
    font-size: 0.43rem;
    line-height: 1.06;
  }

  .transfer-rules b {
    width: 17px;
    height: 17px;
    border-radius: 5px;
    font-size: 0.4rem;
  }
}

@media (max-width: 300px) {
  .app-shell {
    padding-left: 4px;
    padding-right: 4px;
  }

  .brand-lockup strong {
    font-size: 0.67rem;
  }

  .role-badge strong {
    max-width: 76px;
    font-size: 0.53rem;
  }

  .case-heading h1 {
    font-size: 1.03rem;
  }

  .evidence-node strong {
    font-size: 0.44rem;
  }

  .app-footer {
    grid-template-columns: 62px minmax(0, 1fr);
  }
}

@media (max-width: 560px) and (max-height: 520px) {
  .app-header {
    flex-basis: 34px;
    min-height: 34px;
  }

  .brand-mark {
    width: 26px;
    height: 26px;
  }

  .case-brief-button {
    min-height: 24px;
  }

  .progress-shell {
    flex-basis: 22px;
    margin-top: 2px;
  }

  .progress-line {
    top: 9px;
  }

  .progress-shell button > span {
    width: 19px;
    height: 19px;
  }

  .case-meta {
    display: none;
  }

  .case-heading {
    gap: 2px;
    padding: 2px 4px 3px;
  }

  .case-heading h1 {
    font-size: 1rem;
  }

  .paws-meter-panel {
    margin-top: 2px;
  }

  .paws-meter > div {
    padding-top: 2px;
    padding-bottom: 2px;
  }

  .task-ribbon {
    gap: 4px;
    margin-bottom: 3px;
    padding: 4px 6px;
  }

  .task-copy strong {
    font-size: 0.58rem;
  }

  .app-footer {
    flex-basis: 34px;
    padding-top: 3px;
  }

  .back-button,
  .next-button {
    min-height: 31px;
  }

  .case-briefing {
    grid-template-rows: 84px minmax(0, 1fr);
  }

  body:has(.outcome-debrief) .case-heading h1 {
    font-size: 0.96rem;
  }

  .simple-replay.outcome-debrief {
    grid-template-rows: 64px 60px 72px minmax(0, 1fr);
  }

  .outcome-debrief .pepper-found-hero {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .debrief-pepper {
    width: 52px;
    height: 61px;
  }

  .outcome-debrief .pepper-found-hero h2 {
    font-size: 0.7rem;
  }

  .outcome-debrief .pepper-found-hero p {
    display: none;
  }

  .debrief-stats span {
    padding: 1px 3px;
    font-size: 0.35rem;
  }

  .reasoning-wins small {
    display: none;
  }

  .reasoning-wins article {
    grid-template-columns: 15px minmax(0, 1fr);
    padding: 3px;
  }

  .reasoning-wins article > span {
    width: 15px;
    height: 15px;
  }

  .reasoning-wins strong {
    font-size: 0.42rem;
  }

  .consequence-compare > div {
    padding: 4px;
  }

  .consequence-compare h3 {
    font-size: 0.49rem;
  }

  .consequence-compare li b {
    font-size: 0.39rem;
  }

  .transfer-lesson {
    gap: 2px;
    padding: 4px;
  }

  .transfer-lesson h3 {
    font-size: 0.59rem;
  }

  .transfer-rules span {
    grid-template-columns: 15px minmax(0, 1fr);
    font-size: 0.37rem;
  }

  .transfer-rules b {
    width: 15px;
    height: 15px;
  }
}

@media (max-width: 560px) and (min-height: 750px) {
  .simple-replay.outcome-debrief {
    grid-template-rows: 1.05fr 1fr 1.15fr 1.15fr;
  }

  .outcome-debrief .pepper-found-hero {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .debrief-pepper {
    width: 92px;
    height: 100%;
  }

  .reasoning-wins article,
  .consequence-compare > div {
    align-content: center;
  }
}
