/* UX-06 CHECK-IN V3 START — page-local truth, recovery, and receipt states. */
html.checkin-v3-page .page-main {
  min-width: 0;
}

html.checkin-v3-page [hidden] {
  display: none !important;
}

html.checkin-v3-page .scan-section {
  gap: var(--space-xs);
}

.checkin-v3-preview-label,
.checkin-v3-result-preview-label {
  margin: 0;
  padding: var(--space-xs) var(--space-sm);
  border: var(--rule-hair) solid var(--color-primary);
  border-radius: var(--radius-control);
  background: var(--color-surface-sunken);
  color: var(--color-ink);
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.55;
}

.checkin-v3-result-preview-label {
  margin: var(--space-sm) var(--space-md) 0;
  text-align: center;
}

.checkin-v3-card {
  display: grid;
  min-width: 0;
  padding: var(--space-md);
  gap: var(--space-sm);
  border: var(--rule-hair) solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-control);
}

.checkin-v3-card__head {
  display: grid;
  min-width: 0;
  gap: var(--space-xs);
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  text-align: start;
}

.checkin-v3-card__icon {
  display: grid;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  place-items: center;
  background: var(--color-surface-sunken);
  color: var(--color-primary);
}

.checkin-v3-card__icon .icon {
  width: 1.5rem;
  height: 1.5rem;
}

.checkin-v3-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 700;
  line-height: var(--lh-title);
}

.checkin-v3-card__summary,
.checkin-v3-fix,
.checkin-v3-policy,
.checkin-v3-privacy {
  margin: 0;
  color: var(--color-ink-muted);
  line-height: 1.55;
}

.checkin-v3-fix {
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-control);
  background: var(--color-surface-sunken);
  color: var(--color-ink);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.checkin-v3-policy {
  font-size: var(--text-xs);
}

.checkin-v3-policy[data-tone="warning"] {
  color: var(--color-primary);
  font-weight: 600;
}

.checkin-v3-actions {
  display: grid;
  min-width: 0;
  gap: var(--space-xs);
}

.checkin-v3-actions .wide-button,
.checkin-v3-actions .ghost-button {
  width: 100%;
  min-height: var(--size-control);
}

.checkin-v3-actions .ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.checkin-v3-actions [aria-busy="true"] {
  cursor: wait;
}

.checkin-v3-device-test {
  padding: 0 var(--space-sm) var(--space-sm);
  border: var(--rule-hair) solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.checkin-v3-device-test summary {
  display: flex;
  min-height: var(--size-control);
  align-items: center;
  color: var(--color-ink);
  font-weight: 700;
  cursor: pointer;
}

.checkin-v3-device-test p {
  margin: 0 0 var(--space-xs);
  color: var(--color-ink-muted);
  line-height: 1.55;
}

.checkin-v3-device-test .ghost-button {
  width: 100%;
  min-height: var(--size-control);
}

.checkin-v3-help {
  padding: var(--space-xs) var(--space-sm);
  border: var(--rule-hair) solid var(--color-ink-muted);
  border-radius: var(--radius-control);
  background: var(--color-surface);
}

.checkin-v3-help summary {
  min-height: var(--size-control);
  color: var(--color-ink);
  font-weight: 700;
  cursor: pointer;
}

.checkin-v3-help p {
  margin-block: var(--space-2xs) 0;
  color: var(--color-ink-muted);
  line-height: 1.6;
}

.checkin-v3-subject {
  display: grid;
  min-width: 0;
  padding: var(--space-sm);
  gap: var(--space-sm);
  grid-template-columns: min(5.25rem, 26vw) minmax(0, 1fr);
  align-items: center;
  border: var(--rule-hair) solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.checkin-v3-subject__photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-control);
  background: var(--color-surface-sunken);
}

.checkin-v3-subject__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.checkin-v3-subject__body {
  display: grid;
  min-width: 0;
  gap: var(--space-2xs);
}

.checkin-v3-subject__name {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 700;
  line-height: var(--lh-title);
  overflow-wrap: anywhere;
}

.checkin-v3-subject__meta,
.checkin-v3-subject__gate {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.5;
}

.checkin-v3-subject__gate {
  color: var(--color-ink-muted);
}

.checkin-v3-subject__gate[data-eligible="true"] {
  color: var(--color-success);
  font-weight: 700;
}

.checkin-v3-privacy {
  padding-inline: var(--space-xs);
  font-size: var(--text-xs);
}

html.checkin-v3-page .nearby-checkin .section-heading {
  padding-block-end: var(--space-xs);
}

html.checkin-v3-page .checkin-list {
  overflow: visible;
}

html.checkin-v3-page .checkin-row,
html.checkin-v3-page .checkin-row:first-child {
  display: block;
  padding: 0;
}

html.checkin-v3-page .checkin-row:first-child .checkin-row__link,
html.checkin-v3-page .checkin-row__link {
  display: grid;
  min-width: 0;
  min-height: 4.75rem;
  padding: var(--space-xs);
  gap: var(--space-xs);
  grid-template-columns: 3.75rem minmax(0, 1fr) auto;
  align-items: center;
}

html.checkin-v3-page .checkin-row:first-child .checkin-row__photo,
html.checkin-v3-page .checkin-row__photo {
  width: 3.75rem;
  height: 3.75rem;
  aspect-ratio: 1;
  grid-column: auto;
  border-radius: var(--radius-control);
}

html.checkin-v3-page .checkin-row:first-child .checkin-row__body {
  padding-inline-start: 0;
}

.checkin-row__state {
  color: var(--color-ink-muted);
  font-size: var(--text-xs);
  line-height: 1.45;
}

.checkin-row__state[data-eligible="true"] {
  color: var(--color-success);
  font-weight: 700;
}

.checkin-row__arrow {
  width: 1.15rem;
  height: 1.15rem;
  color: var(--color-ink-muted);
}

html.checkin-v3-result-page .payoff {
  min-width: 0;
}

/* A short state (no receipt, blocked) still ends at the bottom: the footer takes the slack. */
html.checkin-v3-result-page .site-footer {
  margin-block-start: auto;
}

html.checkin-v3-result-page .payoff[data-state]:not([data-state="earned"]) .payoff-stamp {
  display: none;
  animation: none !important;
}

html.checkin-v3-result-page .payoff[data-state]:not([data-state="earned"]) .payoff-title,
html.checkin-v3-result-page .payoff[data-state]:not([data-state="earned"]) .payoff-place,
html.checkin-v3-result-page .payoff[data-state]:not([data-state="earned"]) .payoff-receipt,
html.checkin-v3-result-page .payoff[data-state]:not([data-state="earned"]) .payoff-actions {
  animation: none !important;
}

.checkin-v3-verified {
  margin: 0;
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

html.checkin-v3-result-page .payoff-actions {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

html.checkin-v3-result-page .payoff-actions > a {
  min-width: 0;
}

html.checkin-v3-result-page .payoff-receipt {
  max-width: 100%;
  text-wrap: pretty;
}

html.checkin-v3-result-page [data-state="blocked"] .payoff-receipt {
  padding: 0;
  background: none;
  border: 0;
}

@media (max-width: 350px) {
  .checkin-v3-subject {
    grid-template-columns: 4.25rem minmax(0, 1fr);
  }

  .checkin-v3-subject__photo {
    width: 4.25rem;
  }

  html.checkin-v3-result-page .payoff-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  html.checkin-v3-result-page .payoff-actions .icon-button {
    width: 100%;
    border-radius: var(--radius-pill);
  }
}

html[data-easy="on"].checkin-v3-page .checkin-v3-card,
html[data-easy="on"].checkin-v3-page .checkin-v3-subject {
  box-shadow: none;
}

html[data-easy="on"].checkin-v3-page .checkin-v3-card__title,
html[data-easy="on"].checkin-v3-page .checkin-v3-subject__name {
  font-size: max(var(--text-md), 1em);
}

@media (prefers-reduced-motion: reduce) {
  html.checkin-v3-page .checkin-row,
  html.checkin-v3-page .payoff-stamp,
  html.checkin-v3-page .payoff-title,
  html.checkin-v3-page .payoff-place,
  html.checkin-v3-page .payoff-receipt,
  html.checkin-v3-page .payoff-actions,
  html.checkin-v3-page .payoff-strip {
    animation: none !important;
    transition: none !important;
  }
}
/* UX-06 CHECK-IN V3 END */

/* An unknown ?id= link: one honest line above the sample stop, never a silent swap. */
.checkin-v3-notice {
  margin: 0 0 var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--color-primary) 10%, var(--color-surface));
  color: var(--color-ink);
  font-size: var(--text-sm);
  font-weight: 600;
}

@media (min-width: 700px) {
  html.checkin-v3-page .scan-section { justify-items: center; }
  .checkin-v3-card,
  .checkin-v3-subject { width: 100%; max-width: 40rem; }
}
