/* Unbubble administration and invitation onboarding. Self-contained: same
   azure / egg-yolk / grey / purple tokens as the preview stylesheet. Text
   pairs meet WCAG AA (>= 4.5:1); control borders and focus meet 3:1. */
:root {
  --azure-50: #eef5fd;
  --azure-100: #d4e5f8;
  --azure-600: #0b5cad;
  --azure-700: #094b8e;
  --azure-900: #0a2540;
  --yolk-100: #fff5d1;
  --yolk-400: #f7c948;
  --yolk-500: #f0b429;
  --yolk-900: #5c4100;
  --grey-0: #ffffff;
  --grey-50: #f5f7fa;
  --grey-100: #e8edf2;
  --grey-300: #cbd2d9;
  --grey-500: #7b8794;
  --grey-700: #52606d;
  --grey-900: #1f2933;
  --purple-50: #f4eefc;
  --purple-600: #6b3fa0;
  --purple-800: #44216b;
  --danger-50: #fdecea;
  --danger-700: #b42318;
  --danger-800: #8f1c13;
  --success-50: #e8f5ec;
  --success-700: #1e6b3a;

  --text: var(--grey-900);
  --muted: var(--grey-700);
  --canvas: var(--grey-50);
  --surface: var(--grey-0);
  --line: var(--grey-300);
  --control-line: var(--grey-500);
  --primary: var(--azure-600);
  --primary-strong: var(--azure-700);
  --accent: var(--yolk-500);
  --highlight: var(--purple-600);
  --focus: var(--purple-600);

  --radius-s: 8px;
  --radius-m: 12px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --target: 44px;
  --shadow-1: 0 1px 2px rgb(10 37 64 / 8%), 0 4px 14px rgb(10 37 64 / 6%);
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  --duration-fast: 120ms;
  --duration-medium: 480ms;
  --mono: ui-monospace, "SFMono-Regular", Menlo, monospace;

  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  color: var(--text);
  background: var(--canvas);
  line-height: 1.55;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: auto;
  max-width: 1100px;
  padding: var(--space-5);
}
a {
  color: var(--primary-strong);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  padding: var(--space-2) 0 var(--space-4);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--target);
  letter-spacing: 0.2em;
  font-size: 1.35rem;
  font-weight: 750;
  color: var(--azure-900);
}
.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--yolk-400);
  box-shadow:
    inset 0 0 0 4px var(--grey-0),
    0 0 0 2px var(--azure-600);
}
.session-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}
.session-bar:empty {
  display: none;
}
.who {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  overflow-wrap: anywhere;
}
.notice {
  margin: 0 0 var(--space-4);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-s);
  padding: var(--space-3) var(--space-4);
  background: var(--yolk-100);
  color: var(--yolk-900);
  font-weight: 600;
}

/* Typography */
h1 {
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: var(--space-4) 0 var(--space-3);
  color: var(--azure-900);
  overflow-wrap: anywhere;
}
h1:focus,
h2:focus,
h3:focus {
  outline: none;
}
h1:focus-visible,
h2:focus-visible,
h3:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}
h2 {
  font-size: 1.35rem;
  line-height: 1.25;
  margin: 0 0 var(--space-3);
  color: var(--azure-900);
}
h3 {
  font-size: 1.1rem;
  line-height: 1.3;
  margin: 0 0 var(--space-2);
  color: var(--azure-900);
  overflow-wrap: anywhere;
}
p {
  margin: 0 0 var(--space-3);
}
.lede {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 70ch;
}
.hint {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0 0 var(--space-1);
}
.muted {
  color: var(--muted);
}
code {
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 0.9rem;
  background: var(--grey-100);
  border-radius: var(--radius-s);
  padding: 2px 6px;
}

/* One-time secrets: invitation links and authenticator setup */
.secret {
  display: block;
  margin: var(--space-3) 0;
  padding: var(--space-4);
  border: 2px dashed var(--purple-600);
  border-radius: var(--radius-m);
  background: var(--purple-50);
  color: var(--purple-800);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  word-break: break-all;
  user-select: all;
}
.secret-small {
  font-size: 0.85rem;
  letter-spacing: 0;
}
.secret-card {
  border-left: 4px solid var(--highlight);
}

/* Referral programme: announcement callout and collapsible rules */
.referral-callout {
  margin: var(--space-3) 0 var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--azure-100);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-m);
  background: var(--azure-50);
  overflow-wrap: anywhere;
}
.referral-callout p {
  max-width: 70ch;
  margin: 0 0 var(--space-2);
}
.referral-callout p:last-child {
  margin-bottom: 0;
}
.referral-callout-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--azure-900);
}
.referral-rules {
  margin: var(--space-3) 0;
  padding: 0 var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
}
.referral-rules[open] {
  padding-bottom: var(--space-3);
}
.referral-rules > summary {
  min-height: var(--target);
  padding: var(--space-3) 0;
  cursor: pointer;
  color: var(--primary-strong);
}
.referral-rules > summary h3 {
  display: inline;
  margin: 0;
  font-size: 1rem;
}
.referral-rules > summary:focus {
  outline: none;
}
.referral-rules > summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius-s);
}

/* Surfaces */
.panel {
  padding: var(--space-5) 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: var(--space-4);
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-1);
  padding: var(--space-5);
  margin: var(--space-4) 0;
  min-width: 0;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: var(--space-4);
}
.grid > .card {
  margin: 0;
}
.list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-3);
}
.list-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: var(--space-4);
  min-width: 0;
}
.item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.item-title {
  font-weight: 650;
  margin: 0;
  overflow-wrap: anywhere;
}
.facts {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
  gap: var(--space-1) var(--space-4);
  margin: var(--space-3) 0 0;
}
.facts dt {
  font-weight: 650;
}
.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.section-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 0;
  margin: var(--space-4) 0;
}
.section-nav a,
.section-nav button,
.section-nav button.link-button {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  padding: 0 var(--space-4);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-decoration: none;
  font-weight: 550;
}
.section-nav button,
.section-nav button.link-button {
  cursor: pointer;
}
.section-nav a:hover,
.section-nav button:hover,
.section-nav button.link-button:hover {
  background: var(--azure-50);
  border-color: var(--azure-600);
  color: var(--text);
}
.section-nav button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Profile subsections: wrapping compact tabs over panels built once. */
.subsection-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-3) 0 var(--space-4);
}
button.subsection-tab {
  min-height: var(--target);
  padding: 0 var(--space-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 550;
  text-align: left;
}
button.subsection-tab:hover {
  background: var(--azure-50);
  border-color: var(--azure-600);
  color: var(--text);
}
button.subsection-tab[aria-selected="true"] {
  background: var(--azure-50);
  color: var(--azure-900);
  border-color: var(--primary-strong);
  box-shadow: inset 0 -3px 0 var(--primary-strong);
  font-weight: 700;
}
.subsection-panel > .panel:first-child {
  border-top: 0;
  padding-top: var(--space-2);
}
@media (max-width: 600px) {
  .subsection-tabs {
    gap: var(--space-1);
  }
  button.subsection-tab {
    padding: 0 var(--space-2);
    font-size: 0.92rem;
  }
}

/* Tables: scroll on medium widths, stack into labelled rows on phones */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--grey-100);
  overflow-wrap: anywhere;
}
thead th {
  background: var(--azure-50);
  color: var(--azure-900);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
tbody tr:last-child > * {
  border-bottom: 0;
}
tbody th {
  font-weight: 650;
}
@media (max-width: 640px) {
  .table-wrap {
    border: 0;
    background: none;
  }
  table,
  tbody,
  tr,
  th,
  td {
    display: block;
  }
  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  tr {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    padding: var(--space-2) 0;
    margin-bottom: var(--space-3);
  }
  th,
  td {
    border: 0;
    padding: var(--space-1) var(--space-4);
  }
  tbody [data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.8rem;
    font-weight: 650;
    color: var(--muted);
  }
}

/* Badges */
.badge {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 650;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--grey-100);
  color: var(--grey-900);
}
.badge-public {
  background: var(--azure-50);
  color: var(--azure-700);
}
.badge-cmv {
  background: var(--purple-50);
  color: var(--purple-800);
}
.badge-ok {
  background: var(--success-50);
  color: var(--success-700);
}
.badge-warn {
  background: var(--yolk-100);
  color: var(--yolk-900);
}
.badge-danger {
  background: var(--danger-50);
  color: var(--danger-800);
}

/* Controls */
button,
input,
select,
textarea {
  font: inherit;
}
button,
summary,
.button-link {
  min-height: var(--target);
  padding: 10px 18px;
  border-radius: var(--radius-s);
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}
button {
  background: var(--primary);
  color: var(--grey-0);
  border: 1px solid var(--primary);
  font-weight: 600;
}
button:hover {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
}
button.secondary,
.button-link {
  background: var(--surface);
  color: var(--primary-strong);
  border: 1px solid var(--primary);
  font-weight: 600;
}
button.secondary:hover,
.button-link:hover {
  background: var(--azure-50);
}
.button-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
button.danger {
  background: var(--danger-700);
  border-color: var(--danger-700);
  color: var(--grey-0);
}
button.danger:hover {
  background: var(--danger-800);
  border-color: var(--danger-800);
}
button.danger-outline {
  color: var(--danger-800);
  border-color: var(--danger-700);
}
button.danger-outline:hover {
  background: var(--danger-50);
}
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
form[aria-busy="true"] button[type="submit"] {
  cursor: progress;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-4) 0 var(--space-2);
}
.confirm-q {
  flex-basis: 100%;
  margin: 0;
  font-weight: 600;
}
.form {
  max-width: 640px;
}
.field {
  margin: var(--space-4) 0;
}
.field label {
  display: block;
  font-weight: 650;
  margin-bottom: var(--space-1);
}
input,
select,
textarea {
  width: 100%;
  min-height: var(--target);
  padding: 10px 12px;
  border: 1px solid var(--control-line);
  border-radius: var(--radius-s);
  color: var(--text);
  background: var(--surface);
}
input.short {
  max-width: 7rem;
  text-transform: uppercase;
}
input[type="number"] {
  max-width: 9rem;
}
textarea {
  min-height: 110px;
  resize: vertical;
}
[aria-invalid="true"] {
  border: 2px solid var(--danger-700);
}
input[type="checkbox"],
input[type="radio"] {
  width: 24px;
  height: 24px;
  min-height: 0;
  margin: 0;
  accent-color: var(--primary);
}
.check {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  column-gap: var(--space-3);
  min-height: var(--target);
  margin: var(--space-3) 0;
}
.check label {
  font-weight: 600;
  cursor: pointer;
  padding: var(--space-2) 0;
}
.check-hint {
  margin: 0 0 var(--space-3) calc(24px + var(--space-3));
}
select[size] {
  min-height: 0;
  padding: var(--space-1);
}

/* Grouped answers: profile details, audiences and discovery choices */
fieldset {
  min-width: 0;
  margin: var(--space-4) 0;
  padding: var(--space-2) var(--space-4) var(--space-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
}
legend {
  padding: 0 var(--space-2);
  font-weight: 650;
  color: var(--azure-900);
  overflow-wrap: anywhere;
}
fieldset > .hint {
  margin-top: var(--space-1);
}
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
  column-gap: var(--space-4);
}
.choice-grid .check {
  margin: var(--space-1) 0;
}

/* Short how-it-works lists and secondary links */
.steps {
  max-width: 70ch;
  margin: 0 0 var(--space-4);
  padding-left: var(--space-5);
}
.steps li {
  margin-bottom: var(--space-2);
}
.links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
}
.links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
}
button.link-button {
  min-height: var(--target);
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary-strong);
  font-weight: 400;
  text-decoration: underline;
}
button.link-button:hover {
  background: none;
  color: var(--azure-900);
}

/* Registration status table cells */
.cell-actions .actions {
  margin: 0 0 var(--space-2);
}
.delivery {
  display: grid;
  justify-items: start;
  gap: var(--space-1);
}
.delivery .hint {
  margin: 0;
}

/* Member area: inline confirmations, protected images and conversations */
.inline-actions {
  display: contents;
}
.report-confirm {
  flex-basis: 100%;
  max-width: 640px;
}
.report-confirm .actions {
  margin-top: 0;
}
.plain {
  margin: var(--space-2) 0;
  padding-left: var(--space-5);
  overflow-wrap: anywhere;
}
.media-view img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: var(--space-2) 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
}
.messages {
  margin: var(--space-3) 0;
}
.messages .list-item {
  max-width: 75ch;
}
.messages .own {
  border-left: 4px solid var(--primary);
  background: var(--azure-50);
}
.messages .hint {
  margin: 0 0 var(--space-1);
}
.message-body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
input[type="file"] {
  padding: var(--space-2);
}

/* Find people: temporary filters, compact cards and the profile panel. */
.discovery-filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr));
  gap: 0 var(--space-4);
  max-width: none;
}
.discovery-wide {
  grid-column: 1 / -1;
}
/* Match .field vertical rhythm so picker labels and inputs align with neighbors. */
.discovery-filters > .location-picker {
  margin: var(--space-4) 0;
  align-self: start;
  align-content: start;
}
.discovery-filters details {
  margin: var(--space-2) 0;
}
.discovery-group {
  margin: 0 0 var(--space-3);
  border: 0;
  padding: 0;
}
.discovery-group legend {
  font-weight: 650;
}
.discovery-links a {
  font-weight: 650;
}
.match-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: var(--space-3);
  margin: var(--space-2) 0 var(--space-4);
  padding: 0;
  list-style: none;
}
.match-card {
  height: 100%;
  max-width: 560px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  padding: var(--space-4);
  overflow-wrap: anywhere;
}
.match-heading {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  margin-bottom: var(--space-3);
}
.match-heading .identity {
  display: grid;
  flex: none;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--azure-50);
  color: var(--azure-900);
  font-size: 1.35rem;
  font-weight: 700;
}
.match-heading h3 {
  margin: 0 0 var(--space-1);
}
.match-heading p,
.match-bio {
  margin: 0;
}
.match-card .actions {
  margin-top: var(--space-3);
}
.discovery-detail {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  width: min(34rem, 100%);
  overflow-y: auto;
  padding: var(--space-5);
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.discovery-detail .item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.discovery-detail h3 {
  margin: 0;
}

.field-error {
  margin: var(--space-1) 0 0;
  color: var(--danger-800);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.field-error:empty {
  display: none;
}

/* Birthplace search: combobox with an in-flow listbox, so it never covers
   other fields or overflows narrow screens. */
.listbox {
  list-style: none;
  margin: var(--space-1) 0 0;
  padding: var(--space-1);
  max-height: 18rem;
  overflow-y: auto;
  border: 1px solid var(--control-line);
  border-radius: var(--radius-s);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.option {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: var(--target);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-s);
  cursor: pointer;
  overflow-wrap: anywhere;
}
.option[aria-selected="true"] {
  background: var(--azure-50);
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
.option-city {
  font-weight: 650;
}
.option-detail {
  font-size: 0.92rem;
  color: var(--muted);
}
.search-status {
  margin: var(--space-2) 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}
.search-status:empty {
  display: none;
}
.search-loading {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.search-loading::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid var(--azure-100);
  border-top-color: var(--azure-600);
  animation: spin 900ms linear infinite;
}
.search-error {
  color: var(--danger-800);
  font-weight: 600;
}
.place-chosen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-2) 0 0;
  font-weight: 600;
  color: var(--success-700);
  overflow-wrap: anywhere;
}
.place-chosen:empty {
  display: none;
}

/* AstroPassport consent: a bordered card so the confirmation stands apart. */
.form.consent {
  margin: var(--space-3) 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-left: 4px solid var(--highlight);
  border-radius: var(--radius-m);
  background: var(--surface);
}
.form.consent .check label {
  overflow-wrap: anywhere;
}

/* The member's own birth details, above the fold-out form. */
.birth-summary {
  max-width: 640px;
  margin: var(--space-3) 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
}
.birth-summary .facts {
  margin: 0;
}
.birth-summary.is-empty {
  border: 2px dashed var(--yolk-500);
  background: var(--yolk-100);
}
.birth-summary-empty {
  margin: 0;
  color: var(--yolk-900);
  font-style: italic;
}

.form-error,
.form-ok {
  border-radius: var(--radius-s);
  padding: var(--space-3) var(--space-4);
  margin: var(--space-2) 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.form-error:empty,
.form-ok:empty {
  display: none;
}
.form-error {
  border-left: 4px solid var(--danger-700);
  background: var(--danger-50);
  color: var(--danger-800);
}
.form-ok {
  border-left: 4px solid var(--success-700);
  background: var(--success-50);
  color: var(--success-700);
}

/* Disclosures */
details {
  margin: var(--space-5) 0;
  border-top: 1px solid var(--line);
  padding-top: var(--space-2);
}
summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-left: var(--space-2);
  font-weight: 650;
  color: var(--primary-strong);
  list-style: none;
}
summary::-webkit-details-marker {
  display: none;
}
summary::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  rotate: -45deg;
  transition: rotate var(--duration-fast) var(--ease-out);
}
details[open] > summary::before {
  rotate: 45deg;
}
summary:hover {
  background: var(--azure-50);
}

/* Loading, empty, info, pending, denied, error and success states */
.state {
  border-radius: var(--radius-s);
  padding: var(--space-3) var(--space-4);
  margin: var(--space-3) 0;
  max-width: 75ch;
  overflow-wrap: anywhere;
}
.state p:last-child {
  margin-bottom: 0;
}
.state-loading {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--muted);
}
.state-loading::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid var(--azure-100);
  border-top-color: var(--azure-600);
  animation: spin 900ms linear infinite;
}
.state-empty {
  border: 1px dashed var(--control-line);
  background: var(--surface);
  color: var(--muted);
}
.state-info {
  background: var(--azure-50);
  color: var(--azure-900);
}
.state-pending {
  background: var(--purple-50);
  color: var(--purple-800);
  border-left: 4px solid var(--highlight);
}
.state-denied {
  background: var(--yolk-100);
  color: var(--yolk-900);
  border-left: 4px solid var(--accent);
}
.state-error {
  background: var(--danger-50);
  color: var(--danger-800);
  border-left: 4px solid var(--danger-700);
}
.state-ok {
  background: var(--success-50);
  color: var(--success-700);
  border-left: 4px solid var(--success-700);
}

/* Newly loaded content briefly glows yolk, without moving. */
.slot > :not(.state-loading) {
  animation: arrive var(--duration-medium) var(--ease-out);
}
@keyframes arrive {
  from {
    background-color: var(--yolk-100);
  }
}
@keyframes spin {
  to {
    rotate: 360deg;
  }
}

#status {
  margin: 0 0 var(--space-4);
  overflow-wrap: anywhere;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-s);
  padding: var(--space-3) var(--space-4);
  background: var(--azure-50);
  color: var(--azure-900);
}
#status:empty {
  padding: 0;
  margin: 0;
  border: 0;
}
#status.error {
  border-left-color: var(--danger-700);
  background: var(--danger-50);
  color: var(--danger-800);
}

main {
  padding-bottom: var(--space-6);
}
main:focus {
  outline: none;
}
footer {
  margin-top: var(--space-6);
  padding: var(--space-5) 0;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--muted);
}
/* Contextual comparison tabs: compare-only explanation, never actual access.
   Pattern: .compare-tabs > p.compare-note, [role=tablist].compare-tablist >
   button.compare-tab, then [role=tabpanel].compare-panel. */
.compare-tabs {
  margin-top: var(--space-4);
}
.compare-note {
  margin: 0 0 var(--space-3);
}
.compare-tablist {
  display: flex;
  gap: var(--space-2);
}
button.compare-tab {
  flex: 1 1 0;
  min-width: 0;
  background: var(--surface);
  color: var(--primary-strong);
  border: 1px solid var(--control-line);
  font-weight: 600;
}
button.compare-tab:hover {
  background: var(--azure-50);
  border-color: var(--primary);
}
button.compare-tab[aria-selected="true"] {
  background: var(--azure-50);
  color: var(--azure-900);
  border-color: var(--primary-strong);
  box-shadow: inset 0 -4px 0 var(--primary-strong);
  font-weight: 700;
}
.compare-panel {
  margin-top: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
}
.compare-panel .facts {
  margin: 0;
}
@media (prefers-reduced-motion: reduce) {
  button.compare-tab {
    transition: none;
  }
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: var(--space-5);
  top: var(--space-1);
  z-index: 2;
  background: var(--surface);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-s);
}
@media (max-width: 600px) {
  body {
    padding: var(--space-4);
  }
  .card {
    padding: var(--space-4);
  }
  .panel {
    padding: var(--space-4) 0;
  }
  .facts {
    grid-template-columns: minmax(0, 1fr);
  }
  .facts dd {
    margin-bottom: var(--space-2);
  }
  .actions > button,
  .actions > .button-link {
    flex: 1 1 auto;
    justify-content: center;
  }
}
/* Location picker: searchable combobox with an in-flow listbox. Shared by
   the owner editor and member admin; every rule is namespaced. */
.location-picker {
  display: grid;
  gap: var(--space-1, 4px);
}
.location-picker-label {
  font-weight: 600;
}
.location-picker-row {
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
}
.location-picker-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: var(--target, 44px);
  padding: var(--space-2, 8px) var(--space-3, 12px);
  border: 1px solid var(--control-line, #7b8794);
  border-radius: var(--radius-s, 8px);
  background: var(--surface, #ffffff);
  color: var(--text, #1f2933);
  font: inherit;
}
.location-picker-input:focus-visible {
  outline: 3px solid var(--focus, #6b3fa0);
  outline-offset: 2px;
}
.location-picker-input:disabled {
  background: var(--grey-100, #e8edf2);
  color: var(--muted, #52606d);
  cursor: not-allowed;
}
.location-picker-clear,
.location-picker-retry {
  min-height: var(--target, 44px);
}
.location-picker-list {
  list-style: none;
  margin: 0;
  padding: var(--space-1, 4px);
  max-height: 18rem;
  overflow-y: auto;
  border: 1px solid var(--control-line, #7b8794);
  border-radius: var(--radius-s, 8px);
  background: var(--surface, #ffffff);
  box-shadow: var(--shadow-1, none);
}
.location-picker-option {
  display: flex;
  align-items: center;
  min-height: var(--target, 44px);
  padding: var(--space-2, 8px) var(--space-3, 12px);
  border-radius: var(--radius-s, 8px);
  cursor: pointer;
  overflow-wrap: anywhere;
}
.location-picker-option:hover {
  background: var(--grey-100, #e8edf2);
}
.location-picker-option.is-chosen {
  font-weight: 650;
}
.location-picker-option[aria-selected="true"] {
  background: var(--azure-50, #eef5fd);
  outline: 2px solid var(--primary, #0b5cad);
  outline-offset: -2px;
}
.location-picker-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2, 8px);
}
.location-picker-status,
.location-picker-hint {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted, #52606d);
}
.location-picker-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
/* Structured profile choices and profile match (scoped additions only). */
.profile-choices,
.profile-match {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.profile-choices [hidden],
.profile-match [hidden] {
  display: none !important;
}
.profile-choices-field {
  min-width: 0;
  margin: var(--space-5) 0 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}
.profile-choices-groups {
  max-height: 32rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 0 var(--space-3) var(--space-2);
  margin: var(--space-2) 0;
}
.profile-choices-groups > details:first-child {
  border-top: 0;
}
.profile-choices summary {
  min-height: var(--target);
}
.profile-choices .check {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  column-gap: var(--space-3);
  min-height: var(--target);
  margin: var(--space-1) 0;
}
.profile-choices .check label {
  font-weight: 500;
  cursor: pointer;
  padding: var(--space-2) 0;
}
.profile-choices input[type="checkbox"],
.profile-choices input[type="radio"] {
  width: 24px;
  height: 24px;
  min-height: 0;
  margin: 0;
}
.profile-choices-subgroup {
  margin: var(--space-3) 0;
}
.profile-choices-chips {
  list-style: none;
  margin: var(--space-2) 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  min-width: 0;
}
.profile-choices-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  max-width: 100%;
  min-width: 0;
  padding-left: var(--space-3);
  border: 1px solid var(--primary);
  border-radius: 999px;
  background: var(--azure-50);
  color: var(--azure-900);
}
.profile-choices-chip > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.profile-choices-chip-unsupported {
  border-style: dashed;
  border-color: var(--yolk-900);
  background: var(--yolk-100);
  color: var(--yolk-900);
}
.profile-choices-chip > button {
  flex: none;
  min-width: var(--target);
  min-height: var(--target);
  padding: 0 var(--space-2);
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--primary-strong);
  font-size: 1.25rem;
  line-height: 1;
}
.profile-choices-chip > button:hover {
  background: var(--azure-100);
  color: var(--azure-900);
}
.profile-choices-legacy {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-left: 4px solid var(--line);
  padding-left: var(--space-3);
}
.profile-choices-status {
  font-weight: 650;
  margin: var(--space-2) 0;
}
.profile-choices-dirty {
  color: var(--yolk-900);
}
.profile-choices-result-list {
  list-style: none;
  padding: 0;
  margin: var(--space-2) 0;
  display: grid;
  gap: var(--space-2);
}
.profile-choices-result-list > li {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: var(--space-2) var(--space-3);
}
.profile-match-lists {
  list-style: none;
  padding: 0;
  margin: var(--space-3) 0;
  display: grid;
  gap: var(--space-3);
}
.profile-match label {
  display: block;
  font-weight: 650;
}
.profile-match meter {
  display: block;
  width: 100%;
  height: 1.25rem;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Profile photo or image: the saved picture and the square crop editor. */
.profile-image {
  margin-top: var(--space-5);
  min-width: 0;
  overflow-wrap: anywhere;
}
.profile-image fieldset {
  min-width: 0;
}
.profile-image-picture {
  display: grid;
  place-items: center;
  width: 160px;
  max-width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--muted);
}
.profile-image-picture img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-image-editor {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
  max-width: 100%;
  margin-top: var(--space-4);
}
.profile-image-canvas {
  display: block;
  width: 320px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
}
.profile-image-range {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
  max-width: 320px;
}
.profile-image-range input[type="range"] {
  width: 100%;
  min-height: 44px;
  margin: 0;
}
.profile-image-avatar {
  margin-right: 0.4rem;
  font-size: 1.5rem;
  line-height: 1;
  vertical-align: middle;
}
.profile-image-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Account deletion: its own area at the end of settings, and the isolated
   confirmation dialog above an inert page. */
.delete-zone {
  max-width: 640px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-left: 4px solid var(--danger-700);
  border-radius: var(--radius-m);
  background: var(--surface);
}
.delete-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: rgb(10 37 64 / 55%);
  overflow-y: auto;
}
.delete-dialog {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 2 * var(--space-4));
  overflow-y: auto;
  padding: var(--space-5);
  border-top: 4px solid var(--danger-700);
  border-radius: var(--radius-m);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  overflow-wrap: anywhere;
}
.delete-dialog .form {
  max-width: none;
}
@media (max-width: 600px) {
  .delete-dialog {
    padding: var(--space-4);
  }
}

/* Account deletion on Account: last, after a clear break from other settings. */
.panel.danger-section {
  margin-top: var(--space-6);
  border-top: 2px solid var(--danger-700);
}

/* Shared shell: sticky header with member page navigation. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--canvas);
  box-shadow: 0 1px 0 var(--line);
  margin-bottom: var(--space-4);
}
.skip:focus {
  z-index: 6;
}
.panel,
h1,
h2 {
  scroll-margin-top: 9rem;
}
.member-nav {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.member-nav-toggle {
  display: none;
}
.member-nav-lists {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
}
.member-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  margin: 0;
  padding: 0;
}
.member-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  padding: 0 var(--space-3);
  border-radius: var(--radius-s);
  color: var(--primary-strong);
  font-weight: 600;
  text-decoration: none;
}
.member-nav-more a {
  font-weight: 500;
  font-size: 0.95rem;
}
.member-nav a:hover {
  background: var(--azure-50);
}
.member-nav a[aria-current="page"] {
  background: var(--azure-50);
  color: var(--azure-900);
  box-shadow: inset 0 -3px 0 var(--primary-strong);
}
@media (max-width: 760px) {
  .member-nav-toggle {
    display: inline-flex;
    align-items: center;
  }
  .member-nav[data-open="false"] .member-nav-lists {
    display: none;
  }
  .member-nav-lists {
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
    max-height: 70vh;
    overflow-y: auto;
  }
  .member-nav ul {
    flex-direction: column;
  }
  .member-nav a {
    width: 100%;
  }
}
/* Location picker helper buttons keep their label on one line. */
.location-picker-clear,
.location-picker-retry {
  flex: 0 0 auto;
  white-space: nowrap;
}
/* Find people: discovery setup panel. */
.discovery-setup {
  margin: var(--space-4) 0;
  padding: var(--space-4);
  border: 1px solid var(--yolk-500);
  border-left-width: 4px;
  border-radius: var(--radius-m);
  background: var(--yolk-100);
  color: var(--text);
  font-size: 1rem;
}
.discovery-setup h3 {
  margin: 0 0 var(--space-2);
}
.discovery-setup p,
.discovery-setup ul {
  margin: 0 0 var(--space-2);
}
.discovery-setup > div > :last-child {
  margin-bottom: 0;
}
