/*
 * Sized in rem off the platform body font so Android's system text scaling is
 * honoured. Everything must stay legible at 200%, and text WRAPS rather than
 * truncating -- a card reading "2nd gr…" is a failure of the app's only purpose.
 */

:root {
  --ink: #1c1917;
  --paper: #faf9f7;
  --muted: #57534e;
  --line: #d6d3d1;
  --accent: #9a3412;
  --danger: #b91c1c;
  --focus: #2563eb;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  /* Swipe-down is pull-to-refresh in a standalone PWA, and the reload looks
     like a crash. Contained on BOTH axes. */
  overscroll-behavior: contain;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.125rem;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.view {
  min-height: 100dvh;
}

/* Containing block for the absolutely-positioned pending-invitation banner. */
#view-deck {
  position: relative;
}

.view-centered {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 32rem;
  margin: 0 auto;
  padding: max(1.5rem, env(safe-area-inset-top)) max(1.5rem, env(safe-area-inset-right))
    max(1.5rem, env(safe-area-inset-bottom)) max(1.5rem, env(safe-area-inset-left));
}

.view-dark {
  background: #0c0a09;
  color: #fff;
}

/*
 * Phone-first, but not phone-only: this is a web app people also open on a
 * laptop. Unconstrained, the manage screen ran the full window width, so a
 * button was a 1900px-wide target and every hint was one very long line. The
 * max-width matches .view-centered so both kinds of screen agree.
 */
.padded {
  padding: 1.25rem max(1.25rem, env(safe-area-inset-right)) max(2rem, env(safe-area-inset-bottom))
    max(1.25rem, env(safe-area-inset-left));
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 1.5rem;
  text-align: center;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ---------- forms ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.field-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
}

/* Every instruction in the app is a .field-hint, and at 0.9375rem the
   explanations were the SMALLEST prose on screen -- for an audience chosen for
   presbyopia. Still subordinate to body copy, but readable. */
.field-hint {
  font-size: 1.0625rem;
  color: var(--muted);
}

input,
select {
  font: inherit;
  /* 1rem or larger, or Chrome Android zooms the viewport on focus. */
  font-size: 1.125rem;
  padding: 0.875rem 1rem;
  border: 2px solid var(--line);
  border-radius: 0.625rem;
  background: #fff;
  color: inherit;
  width: 100%;
}

input:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* body sets -webkit-tap-highlight-color: transparent, which removes Android's
   own press feedback. Without a replacement, a tap that did not register is
   indistinguishable from one the app ignored -- the precise failure the
   scroll-snap decision was made to avoid. */
button:active {
  filter: brightness(0.88);
}

.card:active .card-scrim {
  filter: brightness(1.15);
}

button {
  font: inherit;
  font-weight: 700;
  /* Comfortably above the 48px minimum touch target. */
  min-height: 3.25rem;
  padding: 0.875rem 1.25rem;
  border-radius: 0.625rem;
  border: 2px solid transparent;
  cursor: pointer;
}

.button-primary {
  background: var(--accent);
  color: #fff;
}

button[disabled] {
  opacity: 0.6;
}

/* The border colour is what separates an ACTION from a DATA ROW.
   `.card-list button` is also a white, 2px, --line-bordered, full-width box, so
   with a --line border here a child's name and "Save this name" were the same
   object on screen. Actions carry the accent on the edge as well as the text;
   rows never do. */
.button-secondary {
  background: #fff;
  color: var(--accent);
  border-color: var(--accent);
}

.button-link {
  background: none;
  border: none;
  color: var(--accent);
  text-decoration: underline;
  /* Was 2.75rem (44px) -- BELOW the floor asserted for every other button, and
     applied to the two most consequential controls on the manage screen. */
  min-height: 3rem;
}

.button-link.danger {
  color: var(--danger);
}

/* Destructive actions that are real buttons rather than asides.
   A one-step hue change from --accent to --danger is not enough signal on its
   own: an underlined borderless link reads as LESS committal than the bordered
   secondary buttons around it, which is backwards for the control that ends
   someone's access. */
.button-danger {
  background: #fff;
  color: var(--danger);
  border-color: var(--danger);
}

.error {
  margin: 0;
  color: var(--danger);
  font-weight: 600;
}

.loading {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
}

/* ---------- persistent back control ----------
   Standalone mode hides the address bar and the back button, so without this a
   failed gesture inside a gallery is a terminal state. Present on every screen
   except the deck, large and high contrast. */

.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  /* The side padding centres the bar's contents on the same column as .padded
     below it, so the back button does not float out at the window edge on a
     wide screen. Collapses to a plain 1rem on a phone. */
  padding: max(0.75rem, env(safe-area-inset-top)) max(1rem, calc((100% - 34rem) / 2)) 0.75rem;
  /* NOT `inherit`: .view sets no background, so this resolved to transparent
     and content scrolled behind the header on every light screen. The gallery
     only looked right because .view-dark .bar hardcodes a colour. */
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.view-dark .bar {
  background: #0c0a09;
  border-bottom-color: #292524;
}

.button-back {
  background: var(--accent);
  color: #fff;
  font-size: 1.125rem;
  padding: 0.75rem 1.125rem;
  min-height: 3rem;
  flex: none;
}

.bar-title {
  font-size: 1.25rem;
  margin: 0;
  font-weight: 700;
}

/* A heading must outrank the text beneath it.
   This was 1.125rem in --muted: the SAME size as body copy and LOWER contrast
   than it, sharing a colour with .field-hint. On a page with ten of them the
   only thing separating a section title from a paragraph was <h3>'s default
   bold, which is why the screen read as one undifferentiated column. */
.section-title {
  font-size: 1.375rem;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}

/* Second level, inside a .group. Ranks below .section-title and above body. */
.subsection-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}

/*
 * Grouping, which .stack alone cannot express.
 *
 * .stack applies ONE gap to everything, so a heading sat as far from its own
 * content as from the section above it. Nothing bound a title to what it
 * titled. A .group is a stack with a tighter inner gap, separated from its
 * neighbours by a rule and a larger margin -- so the eye gets sections rather
 * than a list of equidistant controls.
 */
.group {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

/* The first group on a screen has the bar above it already. */
.group:first-of-type {
  padding-top: 0;
  border-top: none;
}

/* A block within a group: subhead, its list, its button. Tighter still. */
.group-block {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

/*
 * A row that navigates somewhere, rather than doing something here.
 * The chevron is the whole point: it distinguishes "this opens a screen" from
 * "this acts now", which no other control on the page was saying.
 */
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 2px solid var(--line);
  color: inherit;
  font-weight: 700;
}

.nav-row::after {
  content: '›';
  font-size: 1.5rem;
  color: var(--muted);
  flex: none;
}

.card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card-list button {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 2px solid var(--line);
  color: inherit;
  font-weight: 600;
}

/*
 * A tappable row says so. These rows open a screen, and they were visually
 * identical to "Save this name" and "Add photos" -- same white box, same 2px
 * --line border, same width. The chevron marks the ones that navigate; the
 * accent border on .button-secondary marks the ones that act. Absolute rather
 * than flex so it does not disturb the block-level .row-sub beneath the name.
 */
.card-list button:not(.button-link) {
  position: relative;
  padding-right: 2.75rem;
}

.card-list button:not(.button-link)::after {
  content: '›';
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: var(--muted);
}

/*
 * The name and detail take a full line each; any actions wrap onto their own
 * line as flex items with a real gap between them.
 *
 * Appended straight onto the row, two actions had NO whitespace node between
 * them and no horizontal padding, so "Resend" and "Withdraw" touched at 0px
 * and each target was exactly the glyphs of its word. Three pixels left of
 * "Withdraw" was inside "Resend" -- so a near-miss on the phone did not fail
 * quietly, it sent another invitation email.
 */
.card-list-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 1.25rem;
  row-gap: 0.25rem;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 0.625rem;
  padding: 0.875rem 1.25rem;
  font-weight: 600;
}

.card-list-row > strong,
.card-list-row > .row-sub {
  flex: 0 0 100%;
}

.card-list .row-sub,
.card-list-row .row-sub {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 1rem;
}

/* ---------- the deck ---------- */

.deck {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  height: 100dvh;
  /* CSS scroll-snap rather than a JS drag handler. A threshold-based handler
     punishes slow, short, wobbly swipes by snapping back, which reads as the
     app ignoring him. Essential tremor is common at 75. */
  scroll-snap-type: x mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.deck::-webkit-scrollbar {
  display: none;
}

.card {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100dvh;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  overflow: hidden;
  /* Set per card from JS; a card whose photo fails to load still reads as
     deliberate rather than broken. */
  background: var(--card-color, #44403c);
}

.card-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* If the image errors, JS removes it entirely -- never a broken-image glyph. */
}

.card-scrim {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  /* Never a fixed height: the overlay grows with wrapped text. */
  padding: 4rem max(1.5rem, env(safe-area-inset-right))
    max(2rem, calc(env(safe-area-inset-bottom) + 1.5rem)) max(1.5rem, env(safe-area-inset-left));
  /* §8 wants the scrim "near-black under the text". With the stop at 25% and
     4rem of top padding, the name landed in the FADING part of the gradient --
     white on roughly 39% black, which is the least legible text on the card
     over a bright photo, outdoors, without readers. */
  background: linear-gradient(to top, rgba(0, 0, 0, 0.94) 62%, rgba(0, 0, 0, 0));
  color: #fff;
  /* The scrim grows upward inside an overflow:hidden card, so at 200% text
     scaling the topmost element -- the child's NAME -- was the first thing
     clipped. §8 calls losing that text a failure of the app's only purpose. */
  max-height: 100%;
  overflow-y: auto;
}

/* A last-resort guarantee for the two lines that matter most, independent of
   whatever the photo behind them happens to be. */
.card-name,
.card-facts {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
}

.card-name {
  font-size: 2rem; /* 32px at default scaling */
  font-weight: 700;
  margin: 0;
  line-height: 1.15;
  overflow-wrap: break-word;
}

.card-facts {
  font-size: 1.4375rem; /* ~23px */
  font-weight: 700;
  margin: 0.25rem 0 0;
  overflow-wrap: break-word;
}

.card-school {
  font-size: 1.25rem;
  font-weight: 400;
  margin: 0.125rem 0 0;
  opacity: 0.92;
  overflow-wrap: break-word;
}

.card-note {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0.5rem 0 0;
  overflow-wrap: break-word;
}

.card-gallery-button {
  margin-top: 1rem;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.5);
  font-size: 1.125rem;
  width: 100%;
}

.card-dots {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1rem;
}

.card-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
}

.card-dot.is-current {
  background: #fff;
}

/* Mirrors .deck-manage on the other side, so the two deck controls are one
   pair rather than two unrelated things. */
.deck-ask {
  position: absolute;
  top: max(0.75rem, env(safe-area-inset-top));
  left: max(0.75rem, env(safe-area-inset-left));
  z-index: 4;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 1rem;
  font-weight: 600;
  min-height: 3rem;
  padding: 0.625rem 1rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  /* Long enough labels wrap into two lines and cover the photo otherwise. */
  max-width: calc(100% - 9.5rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deck-ask[disabled] {
  opacity: 0.75;
}

.deck-manage {
  position: absolute;
  top: max(0.75rem, env(safe-area-inset-top));
  right: max(0.75rem, env(safe-area-inset-right));
  z-index: 4;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 1rem;
  font-weight: 600;
  /* Was 2.5rem: the only control in the app under the 48px touch target, sitting
     exactly where a thumb lands when holding the phone out. */
  min-height: 3rem;
  padding: 0.625rem 1rem;
  border-radius: 999px;
  /* Opaque enough to stay legible over a bright photo. */
  background: rgba(0, 0, 0, 0.72);
}

#view-deck {
  position: relative;
}

.deck-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--muted);
}

/* ---------- gallery ---------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.5rem;
  padding: 0.75rem max(0.75rem, env(safe-area-inset-right))
    max(1.5rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
}

.gallery-grid.small {
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  padding-left: 0;
  padding-right: 0;
}

.gallery-item {
  position: relative;
  padding: 0;
  border: none;
  min-height: 0;
  cursor: pointer;
  aspect-ratio: 3 / 4;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #292524;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: rgba(0, 0, 0, 0.55);
}

.gallery-actions button {
  flex: 1;
  min-height: 2.25rem;
  padding: 0.25rem;
  font-size: 0.8125rem;
  border-radius: 0.375rem;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
}

.gallery-actions button.is-cover {
  background: rgba(255, 255, 255, 0.85);
  color: #1c1917;
}

@media (prefers-reduced-motion: reduce) {
  .deck {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- assign photos ---------- */

.assign-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.assign-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.assign-thumb {
  width: 4.5rem;
  height: 6rem;
  object-fit: cover;
  border-radius: 0.5rem;
  background: #e7e5e4;
  flex: none;
}

.assign-select {
  flex: 1;
}

/* ---------- install steps ---------- */

.install-steps {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.install-steps li {
  font-size: 1.0625rem;
}

/* ---------- invitations ---------- */

/* The typo guard: the address is the one mistake nothing downstream catches. */
.confirm-email {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  overflow-wrap: anywhere;
}

.invite-link {
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 0.625rem;
  padding: 0.75rem;
  margin: 0;
}

.offline-message {
  text-align: center;
  font-size: 1.25rem;
  margin: 0 0 1.5rem;
}

/* Brief confirmation after a save. There is no --ok token because success is
   the only state in the app that needs one. */
.flash {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(1.5rem, calc(env(safe-area-inset-bottom) + 1rem));
  z-index: 20;
  /*
   * It ANNOUNCES; it is never a target.
   *
   * Fixed to the bottom centre at z-index 20 and tappable, it swallowed taps
   * on whatever was underneath for the three seconds it showed -- and the
   * bottom of the screen is where the last control on a page sits. Sign out
   * worked only if you had not done anything that raises a toast first, which
   * is the kind of failure that reads as the app ignoring you: nothing visibly
   * blocks the button, and trying again a moment later works.
   */
  pointer-events: none;
  margin: 0;
  padding: 0.875rem 1.25rem;
  border-radius: 999px;
  background: #14532d;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* ---------- one photo, full screen ---------- */

#view-photo {
  position: relative;
  background: #000;
  height: 100dvh;
  overflow: hidden;
}

/* Same mechanics as the deck, deliberately: swipe with scroll-snap, and tap to
   advance. Having the cards swipe and the enlarged photos only tap was two
   different answers to the same gesture, one screen apart. */
.photo-deck {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  height: 100dvh;
  scroll-snap-type: x mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.photo-deck::-webkit-scrollbar {
  display: none;
}

.photo-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100dvh;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-full {
  max-width: 100%;
  max-height: 100%;
  /* contain, not cover: at a checkout the whole face matters more than filling
     the frame, and these are already downscaled to 1600px. */
  object-fit: contain;
}

.photo-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: max(0.75rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) 0.75rem
    max(1rem, env(safe-area-inset-left));
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
}

.photo-count {
  margin: 0;
  color: #fff;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

/* Position in the enlarged view, shown the same way as on the cards. */
.photo-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(1.5rem, calc(env(safe-area-inset-bottom) + 0.75rem));
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

/*
 * Quieter than the gallery button on purpose: it is not what the deck is for.
 *
 * Sized down again once it was live. Full width and 2.75rem tall put it on
 * equal footing with the gallery button, so it read as one of the two things
 * to do on a card and got tapped out of idleness. It is now visibly the
 * smaller, secondary control. It stays at 2.25rem and centred, which is still
 * a comfortable target for the audience this app is for.
 */
/*
 * A tickable row in the suggestion lists. The whole row is the <label>, so the
 * target is the full width rather than a 16px box -- the people using this are
 * the reason every other control in the app has a 2.75rem minimum.
 */
.check-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
  cursor: pointer;
}

/*
 * Named choices, sized like the rows they replace. A <select> collapses two
 * meanings into one line of text you have to open to read; these state both
 * consequences at once, which is the whole point of replacing it.
 */
.choice-set {
  border: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.choice-set legend {
  padding: 0;
  margin-bottom: 0.625rem;
}

.choice-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 0.625rem;
  cursor: pointer;
}

.choice-row:has(input:checked) {
  border-color: var(--accent);
}

.choice-row input[type='radio'] {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  margin: 0;
  accent-color: #9a3412;
}

.choice-row .row-sub {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 1rem;
}

.check-row input[type='checkbox'] {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  accent-color: #9a3412;
}

/*
 * `.card-list button` makes every button in a card list a full-width bordered
 * row, which is right for the child rows that ARE the list items and wrong for
 * a control sitting inside one. Without this the "Remove" link on a person
 * rendered as a second full-width box below their name, looking like a
 * separate card rather than an action on that person.
 */
.card-list button.button-link {
  width: auto;
  border: none;
  background: none;
  /* Horizontal padding so the target is wider than the word itself. With no
     padding the hit area was the glyphs exactly, which is not a touch target. */
  padding: 0.25rem 0.5rem;
  min-height: 3rem;
  text-align: left;
  font-weight: 600;
}

/* Pulls the first action back so its text lines up with the name above it,
   which the padding above would otherwise indent. */
.card-list-row > button:first-of-type {
  margin-left: -0.5rem;
}

/*
 * The waiting-invitation banner. Sits over the deck, which is the only screen
 * a grandparent reliably reaches, and is deliberately loud: it is the one
 * thing on that screen she is meant to act on.
 */
.pending {
  position: absolute;
  /*
   * BELOW the deck's control row, not beside it.
   *
   * It used to start level with the top controls and dodge Manage by reserving
   * 5.5rem on the right. Nothing reserved anything on the LEFT, because until
   * "Ask for a photo" moved up here nothing was there -- so at z-index 6 the
   * banner covered the ask button completely and a tap on it landed on this
   * card instead. That is reachable: a grandparent already in one household,
   * invited to a second, has both on screen at once.
   *
   * Clearing the row vertically means neither control needs to know the other
   * exists, and the banner gets the full width it wanted anyway.
   */
  top: calc(max(0.75rem, env(safe-area-inset-top)) + 3.75rem);
  left: max(0.75rem, env(safe-area-inset-left));
  right: max(0.75rem, env(safe-area-inset-right));
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pending-card {
  background: #fff;
  border-radius: 0.75rem;
  padding: 1rem 1.125rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.pending-card p {
  margin: 0 0 0.75rem;
  font-size: 1.0625rem;
}

.pending-card .pending-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pending-card button {
  min-height: 2.75rem;
  flex: 1 1 auto;
}

/*
 * Show-password, on the two screens where a mistyped character creates an
 * account with a password nobody knows -- and where the person typing is on a
 * phone keyboard they may not trust. Pairs with the iOS Home Screen cookie jar
 * problem: if the credential was never saved, a typo here is a hard lockout.
 */
.reveal {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  font-size: 1rem;
  color: var(--muted);
  cursor: pointer;
}

.reveal input[type='checkbox'] {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  accent-color: var(--accent);
}
