/* Responsive and keyboard refinements for the shared desktop/mobile experience. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { min-width: 0; }
button, a, input, select, summary { touch-action: manipulation; }
button, input, select { max-width: 100%; }
.brand, .back-link, .game-back { min-height: 44px; align-content: center; }
.button.text-button, .journey .button, .notebook-button { min-height: 44px; }
.close-button { width: 44px; height: 44px; }
.location-control select { font-size: 16px; }
.journey li { color: #626b60; }
.journey-quote { color: #626b60; }
.soon { color: #626b60; }
.george-note > span { color: #76603f; }
.game-bar-title small, .resume-banner strong { overflow-wrap: anywhere; }
.venue-clue > span:nth-child(2), .timer-group { min-width: 0; }
.order-card strong { overflow-wrap: anywhere; }
.notebook-grid > *, .evidence-grid > *, .key-grid > * { min-width: 0; }
dialog { max-height: 85vh; max-height: 85dvh; overflow-y: auto; overscroll-behavior: contain; }
html:has(dialog[open]) { overflow: hidden; }
dialog h2:focus, main h1:focus { outline: none; }
input[aria-invalid="true"] { border: 2px solid var(--red); }
.order-result { min-height: 44px; }
.order-card.selected { opacity: 1; }
.solutions-list summary { min-height: 44px; padding: 9px 0; }
.site-footer { display: block; }
.footer-top { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.ownership-note { max-width: 1000px; margin: 16px 0 0; font-size: 12px; line-height: 1.75; }

@media (max-width: 600px) {
  .site-header { min-height: 73px; height: auto; padding: 10px 16px; gap: 8px; }
  .site-header nav { gap: 12px; }
  .nav-link { min-height: 44px; padding: 12px 0; white-space: nowrap; }
  .brand { font-size: 12px; }
  .brand em { font-size: 9px; }
  .game-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; padding: 16px 20px; }
  .game-bar-title { grid-column: 1 / -1; }
  .game-bar-title span { font-size: 23px; }
  .game-bar-title small { white-space: normal; font-size: 13px; }
  .timer-group { flex-direction: column; align-items: flex-start; gap: 0; }
  .timer-label { text-align: left; width: auto; max-width: none; letter-spacing: .06em; }
  .timer { font-size: 30px; flex-shrink: 0; }
  .notebook-button { padding: 8px; gap: 6px; font-size: 12px; }
  .notebook-button > span { display: inline; }
  .puzzle-panel { overflow: visible; }
  .help-row { flex-wrap: wrap; gap: 4px 12px; }
  .help-row .button { padding: 8px; }
  .notebook-item { flex-wrap: wrap; font-size: 13px; }
  .notebook-item small { font-size: 11px; }
  .key-grid { gap: 5px; }
  .key-grid .evidence-tile { padding-inline: 2px; }
  .modal-copy, .record-list > div { font-size: 16px; }
  .modal-note, .small-note, .payment-note, .safety-note { font-size: 14px; }
  .ending-card { padding-inline: 20px; }
  .result-stats { gap: 4px; }
  .result-stats span { font-size: 12px; }
  .certificate-stamp { font-size: 10px; }
  .resume-banner { flex-wrap: wrap; }
  .ownership-note { font-size: 13px; }
}

@media (max-width: 380px) {
  .feature-bottom { flex-direction: column; align-items: stretch; }
  .feature-bottom .button { width: 100%; }
  .notebook-grid { grid-template-columns: 1fr; }
  .order-cards { grid-template-columns: 1fr; gap: 8px; }
  .order-card { display: grid; grid-template-columns: 1fr auto; align-items: center; text-align: left; gap: 2px 12px; }
  .order-card strong { font-size: 20px; margin: 0; }
  .order-card > span { grid-column: 2; grid-row: 1 / 3; margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
