/* Recall public card + swap form (build 11, seat B11-9).
   design/DESIGN-LANGUAGE.md rev 3: iOS-native, SF Pro text styles, iOS
   semantic colours from design/tokens.json, solid surfaces (no imagery
   here, so no glass), no gradients, one tint (brand). Sizes in rem so
   text follows the browser's zoom and text size. */

:root {
  color-scheme: light dark;
  --sheet: #F2F2F7;
  --card: #FFFFFF;
  --field: rgba(118, 118, 128, 0.12);
  --fg: #000000;
  --mut: rgba(60, 60, 67, 0.75);
  --line: rgba(60, 60, 67, 0.29);
  --brand: #0D6C7A;
  --brand-wash: rgba(13, 108, 122, 0.12);
  --on-brand: #FFFFFF;
  --danger: #D70015;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --sheet: #000000;
    --card: #1C1C1E;
    --field: rgba(118, 118, 128, 0.24);
    --fg: #FFFFFF;
    --mut: rgba(235, 235, 245, 0.6);
    --line: rgba(84, 84, 88, 0.65);
    --brand: #3FB3C2;
    --brand-wash: rgba(63, 179, 194, 0.18);
    --on-brand: #000000;
    --danger: #FF6961;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--sheet);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 1.0625rem; /* Body 17 */
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
}
h1, p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }

.page {
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.top {
  display: flex;
  justify-content: center;
  padding: 0.25rem 0;
}
.wordmark {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--mut);
  text-decoration: none;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  padding: 0 0.75rem;
}

.skip {
  position: absolute; left: -999px; top: 0;
  min-height: 2.75rem; padding: 0.75rem; display: inline-flex; align-items: center;
}
.skip:focus { left: 1rem; top: 1rem; background: var(--card); padding: 0.75rem; border-radius: 0.625rem; z-index: 2; }

#main { display: flex; flex-direction: column; gap: 1.25rem; }
#main:focus, [tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }

/* The card */
.card {
  background: var(--card);
  border-radius: 1.375rem;
  padding: 1.75rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.375rem;
}
/* Compact owner card (swap form): avatar in column 1 spanning the name,
 * meta and handle rows; text in column 2, so wrapped lines stay aligned
 * at 200 % text instead of falling under the avatar (review-124 F8). */
.card-compact {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-auto-rows: auto;
  text-align: left;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 0.625rem;
  gap: 0.125rem 0.75rem;
}
.card-compact .avatar { grid-column: 1; grid-row: 1 / span 3; align-self: center; }
.card-compact > :not(.avatar) { grid-column: 2; }

.avatar {
  position: relative;
  border-radius: 50%;
  background: var(--brand-wash);
  color: var(--brand);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: none;
}
.avatar-l { width: 6rem; height: 6rem; margin-bottom: 0.5rem; font-size: 2.125rem; }
.avatar-s { width: 2.75rem; height: 2.75rem; font-size: 1.0625rem; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.initials { font-weight: 600; letter-spacing: 0.02em; }

.name { font-size: 2.125rem; line-height: 1.2; font-weight: 700; letter-spacing: 0.01em; overflow-wrap: anywhere; } /* Large Title 34/41 */
.name-s { font-size: 1.0625rem; font-weight: 600; overflow-wrap: anywhere; } /* Headline */
.title { font-size: 1.375rem; line-height: 1.27; font-weight: 700; overflow-wrap: anywhere; } /* Title 2 22/28 */
.meta { font-size: 0.9375rem; line-height: 1.33; color: var(--mut); overflow-wrap: anywhere; } /* Subheadline 15/20 */
.handle { font-size: 0.9375rem; color: var(--mut); }
.quiet { font-size: 0.9375rem; color: var(--mut); text-align: center; }

/* Inset-grouped lists: 10 pt corners, hairlines inset 16 pt */
.group {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
  background: var(--card);
  border-radius: 0.625rem;
  overflow: hidden;
  width: 100%;
  text-align: left;
}
.card .group { margin-top: 1rem; background: var(--sheet); }
fieldset.group { padding: 0; }
.group-head {
  display: block;
  float: left;
  width: 100%;
  padding: 0.75rem 1rem 0.25rem;
  font-size: 0.8125rem; /* Footnote */
  color: var(--mut);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.group-head + * { clear: both; }
.group > li + li, .group > .field + .field, .group > .choice + .choice { position: relative; }
.group > li + li::before, .group > .field + .field::before, .group > .choice + .choice::before {
  content: "";
  position: absolute;
  left: 1rem;
  right: 0;
  top: 0;
  border-top: 0.5px solid var(--line);
}
/* A row wraps: the label stays on line 1 and the value drops below it
 * when the two do not fit side by side (200 % text), so the value is
 * never squeezed to one character per line (review-124 F1). */
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.125rem 0.75rem;
  min-height: 2.75rem;
  padding: 0.6875rem 1rem;
  color: var(--fg);
  text-decoration: none;
}
a.row:active { background: var(--field); }
.row-label { flex: 0 0 auto; min-width: 4.75rem; color: var(--mut); font-size: 0.9375rem; }
.row-value { flex: 1 1 10rem; min-width: 0; overflow-wrap: anywhere; }
a.row { position: relative; padding-right: 2.25rem; }
a.row .row-value { color: var(--brand); }
.chev { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); color: var(--mut); font-size: 1.25rem; line-height: 1; }
/* Very narrow layouts (a phone at 200 % text is ~195 CSS px): give the
 * side padding back to the content so a link value keeps >= 8ch. */
@media (max-width: 16rem) {
  .page { padding-left: 0.5rem; padding-right: 0.5rem; }
  .card { padding-left: 0.5rem; padding-right: 0.5rem; }
  .row { padding-left: 0.75rem; }
  a.row { padding-right: 1.75rem; }
  .chev { right: 0.5rem; }
}

/* Buttons: iOS filled (tint, 12 pt corners, 50 pt tall) and plain */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.125rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  border: 0;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  width: 100%;
  text-align: center;
}
.btn-filled { background: var(--brand); color: var(--on-brand); }
.btn-tinted { background: var(--brand-wash); color: var(--brand); }
.btn-plain { background: none; color: var(--brand); min-height: 2.75rem; width: auto; padding: 0.5rem 0.75rem; }
.btn-quiet { color: var(--mut); font-weight: 400; font-size: 0.9375rem; }
.btn[disabled] { opacity: 0.6; cursor: default; }
.btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, .row:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}
.actions { display: flex; flex-direction: column; gap: 0.75rem; }
.report { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.report-form { width: 100%; display: flex; flex-direction: column; gap: 0.75rem; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.625rem 1rem; }
.field > label, .label-like { font-size: 0.8125rem; color: var(--mut); }
.field input[type=text], .field input[type=url], .field input[type=email], .field input[type=tel], .field textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.625rem;
  border: 0;
  background: var(--field);
  font-size: 1.0625rem; /* 17: no iOS focus zoom */
}
.field textarea { resize: vertical; }
/* Full --mut, no extra opacity: 4.8:1 light, 5.0:1 dark on --field (review-124 F4). */
.field input::placeholder, .field textarea::placeholder { color: var(--mut); opacity: 1; }
.field input[aria-invalid=true] { box-shadow: inset 0 0 0 2px var(--danger); }
.hint { font-size: 0.8125rem; color: var(--mut); }
.field-error { font-size: 0.8125rem; color: var(--danger); font-weight: 500; }
.form-error { text-align: center; font-size: 0.9375rem; }

.choice { display: flex; align-items: center; gap: 0.75rem; min-height: 2.75rem; padding: 0 1rem; }
.choice input { width: 1.375rem; height: 1.375rem; accent-color: var(--brand); flex: none; margin: 0; }
.choice label { flex: 1; padding: 0.6875rem 0; cursor: pointer; }

.swap-form { display: flex; flex-direction: column; gap: 1.25rem; }
.photo-field { background: var(--card); border-radius: 0.625rem; padding: 0.75rem 1rem; }
.photo-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.photo-preview { width: 4.5rem; height: 4.5rem; border-radius: 50%; overflow: hidden; flex: none; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-buttons { display: flex; gap: 0.5rem; align-items: center; flex: 1; flex-wrap: wrap; }
.photo-buttons .btn-tinted { width: auto; min-height: 2.75rem; }
.visually-hidden-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
/* The file input comes BEFORE its label in the DOM, so `+ label` matches;
 * :has() covers a reordered DOM (review-124 F3). */
/* Two rules, not one list (review-124 re-review N1): a browser without
 * :has() drops a whole selector list it cannot parse, which would take the
 * "+ label" ring down with it. */
.visually-hidden-file:focus-visible + label { outline: 3px solid var(--brand); outline-offset: 2px; }
.photo-buttons:has(.visually-hidden-file:focus-visible) > label { outline: 3px solid var(--brand); outline-offset: 2px; }
.privacy { font-size: 0.9375rem; color: var(--mut); text-align: center; }

/* Empty, expired, sent */
.empty {
  background: var(--card);
  border-radius: 1.375rem;
  padding: 2rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}
.check {
  width: 3.5rem; height: 3.5rem; border-radius: 50%;
  background: var(--brand); color: var(--on-brand);
  display: grid; place-items: center;
  font-size: 1.75rem; font-weight: 700; margin-bottom: 0.25rem;
}
.claim { display: flex; flex-direction: column; gap: 0.5rem; align-items: stretch; text-align: center; }
.claim-q { font-size: 0.9375rem; color: var(--mut); }
.loading { color: var(--mut); text-align: center; padding: 3rem 0; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Privacy policy and support pages (wave 36 seat 01). Prose on the same
   solid sheet, same tokens. */
.legal main { display: flex; flex-direction: column; gap: 1.25rem; }
.legal section { display: flex; flex-direction: column; gap: 0.625rem; }
.legal h2 { margin: 0.75rem 0 0; font-size: 1.25rem; line-height: 1.25; font-weight: 600; } /* Title 3 20/25 */
.legal h3 { margin: 0.5rem 0 0; font-size: 1.0625rem; line-height: 1.3; font-weight: 600; } /* Headline */
.legal p, .legal li { line-height: 1.47; overflow-wrap: anywhere; }
.legal ul { margin: 0; padding-left: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.legal-foot { text-align: center; font-size: 0.9375rem; color: var(--mut); padding-top: 1rem; }
.legal-foot a { display: inline-block; min-height: 2.75rem; line-height: 2.75rem; padding: 0 0.5rem; }
