/* UX pass overrides. Keep after styles.css. */
.tab { min-height: 44px; }
.text-button { min-height: 44px; padding: 8px 0; }
.capture-row { grid-template-columns: 76px minmax(0, 1fr) auto; }

.skip-link {
  position: fixed;
  inset-inline-start: 12px;
  top: 8px;
  z-index: 100;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ps-blue);
  color: var(--ps-white);
  font-weight: 700;
}
.skip-link:focus { transform: translateY(0); }

.processing-card { max-width: 700px; }
#processing-working {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 14px;
  align-items: start;
}
#processing-working p,
#processing-recovery p { margin: 5px 0 0; color: var(--ps-muted); }
.spinner {
  width: 30px;
  height: 30px;
  margin-top: 1px;
  border: 3px solid var(--ps-tint);
  border-top-color: var(--ps-blue);
  border-radius: 50%;
  animation: ps-spin .8s linear infinite;
}
@keyframes ps-spin { to { transform: rotate(360deg); } }
.recovery-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.save-filename { font-size: .88rem; }
.save-filename code {
  font-family: var(--ps-font-mono);
  color: var(--ps-blue);
  overflow-wrap: anywhere;
}
.email-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

.reference-banner {
  max-width: 700px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid #CBD6E4;
  border-inline-start: 4px solid var(--ps-blue);
  border-radius: 12px;
  background: var(--ps-tint);
}
.reference-banner.error {
  border-color: #E8C7C3;
  border-inline-start-color: var(--ps-danger);
  background: #FFF8F7;
}
.reference-banner strong { color: var(--ps-blue); }
.reference-banner.error strong { color: var(--ps-danger); }
.reference-banner p { margin: 3px 0 0; color: var(--ps-muted); }
.selection-summary {
  margin: -4px 0 0;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--ps-surface);
  color: var(--ps-graphite);
  overflow-wrap: anywhere;
}

.history-thumb {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--ps-border);
  border-radius: 9px;
  background: var(--ps-surface);
  color: var(--ps-muted);
  font-size: .75rem;
}
.history-thumb img { width: 100%; height: 100%; object-fit: cover; }
.capture-row-copy { min-width: 0; }
.capture-row-copy strong { overflow-wrap: anywhere; }
.capture-row .history-state { margin-top: 5px; }
.history-save-status {
  grid-column: 2 / -1;
  min-height: 1.2em;
  color: var(--ps-muted);
}

.verify-photo-recognition {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--ps-border);
  border-radius: 11px;
  background: var(--ps-surface);
}
.verify-photo-recognition img {
  width: 92px;
  height: 76px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--ps-white);
}
.verify-photo-recognition strong,
.verify-photo-recognition small { display: block; }
.verify-photo-recognition small { margin-top: 3px; color: var(--ps-muted); }

.help-card { max-width: 700px; }
.help-steps { margin: 0; padding-left: 1.5rem; display: grid; gap: 16px; }
.help-steps li { padding-left: 4px; }
.help-steps strong { display: block; color: var(--ps-blue); }
.help-steps span { display: block; margin-top: 3px; color: var(--ps-muted); }
.help-limit {
  margin-top: 22px;
  padding: 14px;
  border-radius: 11px;
  background: var(--ps-surface);
}
.help-limit strong { color: var(--ps-blue); }
.help-limit p { margin: 4px 0 0; color: var(--ps-muted); }
.help-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

@media (max-width: 680px) {
  .tab { min-height: 44px; padding: 8px 9px; }
  .capture-row { grid-template-columns: 68px minmax(0, 1fr); }
  .capture-row .history-actions,
  .capture-row .history-save-status { grid-column: 1 / -1; }
  .reference-banner { display: grid; gap: 8px; }
  .history-thumb { width: 68px; height: 68px; }
  .verify-photo-recognition { grid-template-columns: 76px 1fr; }
  .verify-photo-recognition img { width: 76px; height: 68px; }
  .email-actions { align-items: stretch; }
  .email-actions .button { width: 100%; }
  .email-actions .text-button { justify-self: start; width: auto; }
  .recovery-actions .button { flex: 1 1 180px; }
}

@media (max-height: 520px) and (orientation: landscape) {
  main { padding-top: 16px; }
  .hero { padding-top: 0; }
  .camera-frame { max-height: 58vh; aspect-ratio: auto; }
  .camera-frame video { max-height: 58vh; }
  .shutter-row { min-height: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
}

.toggle-row,
.optional-note > summary,
.earlier-check > summary,
.email-panel > summary,
.advanced-details > summary {
  min-height: 44px;
}
.optional-note > summary,
.earlier-check > summary,
.email-panel > summary {
  display: list-item;
}


.capture-options {
  margin-top: 6px;
  padding-top: 0;
  border-top: 0;
}
.optional-note {
  margin-top: 18px;
  padding-top: 0;
  border-top: 0;
}
.email-panel {
  padding-top: 0;
  border-top: 0;
}
.earlier-check {
  padding-block: 4px;
  border: 0;
}
.optional-note > summary::marker,
.earlier-check > summary::marker,
.email-panel > summary::marker,
.advanced-details > summary::marker {
  color: var(--ps-blue);
}


/* Accessibility and growth stress cases. */
.button:focus-visible,
.tab:focus-visible,
.text-button:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--ps-blue);
  outline-offset: 3px;
}
.camera-stage .button:focus-visible,
.camera-stage .shutter:focus-visible {
  outline-color: var(--ps-white);
}

#result-title {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

@media (max-width: 300px) {
  .site-header .brand-wrap { display: none; }
  .tabs { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .tab { width: 100%; }
}


.option-status {
  margin: -0.25rem 0 0.25rem 2.65rem;
  color: var(--ps-muted);
  font-size: 0.875rem;
  line-height: 1.35;
}

@media (max-width: 420px) {
  .option-status {
    margin-left: 0;
  }
}


.camera-location-action {
  margin-top: 0.6rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--ps-muted);
}
.camera-location-action .text-button { margin-left: 0.5rem; }
.camera-location-action[hidden] { display: none; }
.shutter:disabled { opacity: 0.45; cursor: not-allowed; }
