.button, .text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: background-color .14s, border-color .14s, box-shadow .14s;
}
.button { background: #fff; color: #26384c; border-color: #cbd2dc; box-shadow: 0 1px 2px #172a4010; }
.button:hover { background: #f7f8fa; border-color: #9eaab8; text-decoration: none; }
.button:active { background: #edf0f4; box-shadow: inset 0 1px 2px #172a4012; }
.button-primary { color: #fff; background: var(--blue); border-color: #002e5d; box-shadow: inset 0 1px 0 #ffffff15, 0 1px 2px #122d4a24; }
.button-primary:hover { color: #fff; background: #164b7e; border-color: #164b7e; }
.button-primary:active { background: #002b56; border-color: #002b56; box-shadow: inset 0 1px 3px #001c3440; }
.button-secondary { color: #26384c; background: #fff; border-color: #cbd2dc; font-weight: 500; }
.button-danger { color: var(--danger); background: #fff; border-color: #dfb8b8; }
.button-danger:hover { color: #8c2222; background: var(--danger-soft); border-color: #bd7777; }
.text-button { color: var(--blue); background: transparent; box-shadow: none; border-color: transparent; padding-left: 8px; padding-right: 8px; font-weight: 500; }
.text-button:hover { color: #164b7e; background: #f3f6f9; text-decoration: underline; text-underline-offset: 4px; }
.text-button:active { background: #eaf0f6; }
.button:disabled, .text-button:disabled, .button[aria-disabled="true"] { opacity: .48; box-shadow: none; cursor: not-allowed; }
.button:disabled:hover, .text-button:disabled:hover { text-decoration: none; }
.button.full, .button-full { width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.form-grid > .full, .form-grid > .field-wide, .form-grid > .span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field + .field { margin-top: 18px; }
.form-grid > .field + .field, .stack > .field + .field { margin-top: 0; }
.label, .field > label { color: #333b46; font-size: 14px; font-weight: 500; line-height: 1.65; }
.input, .select, .textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid #cdd3da;
  border-radius: 6px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  line-height: 24px;
  transition: border-color .14s, box-shadow .14s;
}
.input::placeholder, .textarea::placeholder { color: #969da7; opacity: 1; }
.input:hover, .select:hover, .textarea:hover { border-color: #acb7c4; }
.input:focus, .select:focus, .textarea:focus { border-color: #507aa5; box-shadow: 0 0 0 3px #0a4b8e0d; }
.input:disabled, .select:disabled, .textarea:disabled { color: #747d89; background: var(--tint); cursor: not-allowed; }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: #b54949; }
.textarea { min-height: 116px; resize: vertical; }
.select { padding-right: 32px; }
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; margin: 0; flex: 0 0 auto; accent-color: var(--blue); }
.check-label, .checkbox-label { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 10px 0; font-size: 13px; line-height: 1.75; }
.check-label input, .checkbox-label input { margin-top: 3px; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.form-actions .hint { flex: 1 1 200px; }
.otp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 10px; }
.otp-row .button { min-height: 48px; }
.notice, .status-message, .error { padding: 12px 14px; border: 1px solid var(--line); border-radius: 4px; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.notice, .status-message { color: #515e6e; background: var(--tint); }
.notice + .field, .error + .field { margin-top: 18px; }
.error, .status-message[data-tone="error"] { color: #942d2d; border-color: #e8c5c3; background: #fff6f5; }
.status-message[data-tone="success"] { color: var(--success); border-color: #d0dfd4; background: var(--success-soft); }
.status-message:empty, .error:empty { display: none; }
.empty-state { padding: 40px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); text-align: left; }
.empty-state h2, .empty-state h3 { color: var(--ink); margin-bottom: 8px; }
.empty-state .button, .empty-state .text-button { margin-top: 16px; }
.tabs { display: flex; gap: 24px; margin: 0 0 24px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; flex: 0 0 auto; padding: 10px 0; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; }
.tab:hover { color: var(--blue); text-decoration: none; }
.tab[aria-selected="true"], .tab.is-active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.people-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
.person-card { display: flex; flex-direction: column; min-width: 0; padding: 24px 0; border-top: 1px solid var(--line); background: #fff; }
.person-name { color: var(--ink); font-size: 17px; font-weight: 600; line-height: 1.6; overflow-wrap: anywhere; }
.person-affiliation { margin-top: 4px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.person-bio { margin-top: 14px; color: #4e5763; font-size: 14px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.topics { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px 8px; margin-top: 14px; }
.topic { display: inline-block; max-width: 100%; padding: 3px 8px; border: 1px solid var(--line); border-radius: 3px; background: var(--tint); color: #596474; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.person-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 20px; }
.person-footer .hint { flex: 1 1 140px; }
.person-footer .button { flex: 0 1 auto; }
.invite-list { display: flex; flex-direction: column; }
.invite-card { min-width: 0; padding: 24px 0; border-top: 1px solid var(--line); }
.invite-card:last-child { border-bottom: 1px solid var(--line); }
.invite-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.invite-header > div { min-width: 0; }
.invite-header h2, .invite-header h3 { font-size: 16px; }
.invite-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 10px; color: var(--muted); font-size: 13px; }
.invite-card > p { margin-top: 12px; white-space: pre-wrap; }
.invite-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.status-label { flex: 0 0 auto; max-width: 100%; color: #617083; font-size: 12px; font-weight: 500; line-height: 1.7; padding: 2px 0; }
.status-label[data-status="accepted"] { color: var(--success); }
.status-label[data-status="declined"], .status-label[data-status="cancelled"] { color: var(--muted); }
.status-label[data-status="pending"] { color: var(--blue); }
.profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; }
.profile-layout > * { min-width: 0; }
.profile-layout > .section + .section { margin-top: 0; padding-top: 0; border-top: 0; }
.slots-list { display: flex; flex-direction: column; gap: 0; }
.slot-day { min-width: 0; margin: 0; padding: 16px 0; border: 0; border-top: 1px solid var(--line); }
.slot-day:first-child { padding-top: 0; border-top: 0; }
.slot-day h3, .slot-day h4 { margin-bottom: 12px; font-size: 14px; font-weight: 500; }
.slot-buttons { display: grid; grid-template-columns: repeat(auto-fill, minmax(106px, 1fr)); gap: 8px; }
.slot-button { display: inline-flex; align-items: center; justify-content: center; min-width: 0; min-height: 44px; padding: 9px 6px; border: 1px solid #cdd3da; border-radius: 4px; background: #fff; color: #435164; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.6; transition: background-color .14s, border-color .14s; }
.slot-button:hover { color: var(--blue); border-color: #8ca3ba; background: #f7f9fc; }
.slot-button[aria-pressed="true"] { color: var(--blue); border-color: #315d88; background: #f2f6fb; font-weight: 600; box-shadow: inset 0 0 0 1px #315d8818; }
.slot-button:disabled { opacity: .45; cursor: not-allowed; }
.slot-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.slot-row > :first-child { flex: 1 1 160px; min-width: 0; }
.slot-row .button, .slot-row .text-button { flex: 0 0 auto; }
.dialog {
  width: min(520px, calc(100% - 40px));
  max-width: none;
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  border: 1px solid #d7dde5;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 30px #12233814;
  overflow: auto;
  overscroll-behavior: contain;
}
.dialog::backdrop { background: #14203045; }
.dialog-wide { width: min(720px, calc(100% - 40px)); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 28px 0; }
.dialog-header h2 { align-self: center; min-width: 0; font-size: 20px; }
.dialog-header .text-button { flex: 0 0 auto; margin: -6px -8px 0 0; }
.dialog-body { min-width: 0; padding: 20px 28px 28px; }
.dialog-body > .hint:first-child { margin-bottom: 18px; }
.dialog-body > .section + .section { margin-top: 24px; padding-top: 22px; }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 18px 28px 24px; border-top: 1px solid var(--line); }
.dialog-body .dialog-actions { margin: 24px -28px -28px; }
.dialog dl { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px 16px; margin: 0; }
.dialog dt { color: var(--muted); }
.dialog dd { margin: 0; white-space: pre-wrap; }
@media (max-width: 900px) {
  .profile-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .profile-layout > .section + .section { padding-top: 28px; border-top: 1px solid var(--line); }
}
@media (max-width: 600px) {
  .input, .select, .textarea { font-size: 16px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .form-grid > .full, .form-grid > .field-wide, .form-grid > .span-2 { grid-column: auto; }
  .people-grid { grid-template-columns: minmax(0, 1fr); }
  .person-card { padding: 22px 0; }
  .person-footer { padding-top: 16px; }
  .form-actions { gap: 10px; margin-top: 24px; }
  .auth-card .form-actions > .button-primary { width: 100%; }
  .invite-actions { justify-content: flex-start; }
  .invite-header { flex-wrap: wrap; gap: 5px 12px; }
  .slot-buttons { grid-template-columns: repeat(auto-fill, minmax(106px, 1fr)); }
  .dialog, .dialog-wide { width: calc(100% - 28px); max-height: calc(100dvh - 28px); }
  .dialog-header { padding: 20px 20px 0; gap: 10px; }
  .dialog-header h2 { font-size: 19px; }
  .dialog-body { padding: 16px 20px 24px; }
  .dialog-actions { padding: 16px 20px max(20px, env(safe-area-inset-bottom)); gap: 10px; }
  .dialog-body .dialog-actions { margin: 22px -20px -24px; }
  .dialog dl { grid-template-columns: 72px minmax(0, 1fr); gap: 8px 12px; }
}
@media (max-width: 370px) {
  .otp-row { grid-template-columns: minmax(0, 1fr); }
  .otp-row .button { justify-self: start; }
  .tabs { gap: 20px; }
  .dialog-actions > .button { flex: 1 1 auto; }
}

/* Shared form and directory structures. */
.auth-secondary { justify-content: space-between; margin-top: 8px; }
.auth-secondary .text-button { padding-left: 0; padding-right: 0; }
.auth-privacy { margin-top: 24px; }
.auth-privacy a { text-decoration: underline; text-underline-offset: 3px; }
.auth-card .error { margin-top: 16px; }
.code-input { font-size: 18px; letter-spacing: .22em; font-variant-numeric: tabular-nums; }
.code-input::placeholder { font-size: 15px; letter-spacing: 0; }
.search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; max-width: 760px; margin-bottom: 12px; }
.search-form > .button { min-height: 48px; }
.search-form + .hint { margin-bottom: 24px; }
.people-grid > .empty-state { grid-column: 1 / -1; }
#people-message:not(:empty) { margin: 16px 0; }
.person-detail { padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.person-detail .person-name { font-size: 20px; }
.slot-day legend { width: 100%; padding: 0 0 12px; color: #333b46; font-size: 14px; font-weight: 500; line-height: 1.7; overflow-wrap: anywhere; }
#selected-time { min-height: 21px; margin: 12px 0 18px; color: var(--blue); }
form > .hint { margin-top: 12px; }
form > .error:not(:empty), form > .status-message:not(:empty) { margin-top: 16px; }
@media (max-width: 370px) {
  .search-form { gap: 8px; }
  .search-form > .button { padding-left: 14px; padding-right: 14px; }
}

/* Profile and invitation content remains unboxed. */
.page-head > .row:first-child { margin-top: 0; }
.profile-layout > .section > .section-head, .dialog .section-head { flex-direction: column; gap: 5px; }
.profile-layout .slots-heading { flex-direction: row !important; align-items: center; margin: 32px 0 12px; }
.account-email { font-size: 15px; overflow-wrap: anywhere; }
.stack > .form-actions { margin-top: 4px; }
.stack > .hint { margin-top: 0; }
.invite-note { white-space: pre-wrap; color: #4e5763; }
.invite-highlight { padding-left: 16px; padding-right: 16px; border-left: 3px solid var(--blue); background: #f7f9fc; scroll-margin-top: 20px; }
.notification-note { margin-top: 16px; }
.contact-box { display: flex; align-items: center; flex-wrap: wrap; gap: 0 12px; margin-top: 16px; padding-left: 14px; border-left: 2px solid #c9d7e5; }
.contact-box > .hint { flex: 1 0 100%; }
.contact-box > a { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; text-decoration: underline; }
.invite-card > .status-message { margin-top: 16px; }

.privacy-copy { max-width: 72ch; color: #4e5763; line-height: 1.9; }
.privacy-copy h3 { margin-top: 24px; margin-bottom: 8px; color: var(--ink); font-size: 15px; }
.privacy-copy h3:first-child { margin-top: 0; }
.privacy-page > .button { margin-top: 28px; }
.receipt h3 { margin-bottom: 12px; font-size: 20px; }
.receipt > p + p { margin-top: 10px; }
body:has(.dialog[open]) { overflow: hidden; }

/* Keep primary actions visible while only the dialog content scrolls. */
.dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
.dialog-header { flex: 0 0 auto; padding-bottom: 16px; border-bottom: 1px solid var(--line); background: #fff; }
.dialog-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.dialog > .dialog-actions { flex: 0 0 auto; margin: 0; background: #fff; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
@media (max-width: 600px) {
  .dialog-header { padding-bottom: 14px; }
  .dialog > .dialog-actions { padding-top: 14px; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
  .dialog > .dialog-actions > .button-primary:only-child { width: 100%; }
}

/* People: recommendation-first editorial hierarchy. */
.people-page { padding-top: 8px; }
.directory-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; margin-bottom: 34px; }
.directory-heading-main { min-width: 0; }
.directory-heading h1 { color: #162d47; font-size: 30px; font-weight: 600; line-height: 1.4; letter-spacing: -.4px; }
.directory-heading p { max-width: 630px; margin-top: 10px; font-size: 15px; line-height: 1.85; color: #687586; }
.directory-heading > .text-button { flex: 0 0 auto; margin-top: 2px; font-size: 13px; }
.profile-nudge { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; margin: -8px 0 30px; padding: 12px 16px; border-left: 2px solid #adc1d6; background: #f7f9fc; }
.profile-nudge-copy { min-width: 0; flex: 1 1 240px; color: #59697c; font-size: 13px; line-height: 1.8; }
.profile-nudge > .text-button { flex: 0 0 auto; font-size: 13px; }
.recommendations { margin-bottom: 44px; }
.recommendations-head { margin-bottom: 20px; }
.recommendations-head h2 { color: var(--ink); font-size: 22px; font-weight: 600; line-height: 1.5; }
.recommendations-head p { max-width: 680px; margin-top: 5px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.recommendations-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.recommendations-grid:empty { display: none; }
.recommendation-card { position: relative; min-width: 0; min-height: 332px; padding: 24px; border: 1px solid #dde4ec; border-radius: 8px; background: #fff; transition: border-color .16s; }
.recommendation-card:first-child { padding-top: 22px; border-color: #c7d5e3; border-top: 3px solid var(--blue); background: #f7f9fc; }
.recommendation-card:hover { border-color: #9cafc3; }
.recommendation-reason { margin-bottom: 18px; color: #466788; font-size: 12px; font-weight: 500; line-height: 1.7; overflow-wrap: anywhere; }
.recommendation-card .person-name { color: #18324f; font-size: 22px; line-height: 1.45; font-weight: 600; }
.recommendation-card .person-affiliation { margin-top: 6px; color: #697687; font-size: 14px; line-height: 1.65; }
.recommendation-card .person-bio { margin-top: 18px; font-size: 14px; line-height: 1.85; color: #4e5b6b; }
.recommendation-card .topics { gap: 5px 8px; margin-top: 16px; }
.recommendation-card .topic { padding: 0; border: 0; border-radius: 0; background: none; color: #63758a; font-size: 12px; line-height: 1.8; }
.recommendation-card .topic + .topic { padding-left: 9px; border-left: 1px solid #cfd9e3; }
.recommendation-card .person-footer { flex-direction: column; align-items: stretch; gap: 12px; padding-top: 24px; }
.recommendation-card .person-footer .hint { flex: 0 1 auto; }
.availability-label { color: #617184; font-size: 13px; line-height: 1.7; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.recommendation-card .person-footer .button { width: 100%; min-height: 46px; color: #fff; background: var(--blue); border-color: #002e5d; font-size: 14px; font-weight: 600; box-shadow: inset 0 1px 0 #ffffff15, 0 1px 2px #122d4a24; }
.recommendation-card .person-footer .button:hover { background: #164b7e; border-color: #164b7e; }
.recommendation-card .person-footer .button:active { background: #002b56; border-color: #002b56; }
.recommendations-empty { padding: 32px; border: 1px solid #dde6ef; border-radius: 8px; background: #f7f9fc; }
.recommendations-empty h3 { color: #18324f; font-size: 22px; font-weight: 600; line-height: 1.5; }
.recommendations-empty p { max-width: 640px; margin-top: 10px; color: #687586; font-size: 14px; line-height: 1.85; }
.recommendations-empty-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 24px; }
.recommendations-empty-actions .button { min-height: 46px; padding-left: 22px; padding-right: 22px; }
.directory-section { padding-top: 30px; border-top: 1px solid var(--line); }
.directory-section > .section-head { align-items: center; gap: 12px; margin-bottom: 18px; }
.directory-section > .section-head h2 { font-size: 22px; font-weight: 600; line-height: 1.5; }
.directory-count { color: #83909e; font-size: 13px; line-height: 1.7; }
.directory-section .search-form { max-width: none; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; margin-bottom: 12px; }
.directory-section .search-form .input { border-color: #cdd7e2; background: #fff; }
.directory-section .search-form > .button { min-width: 92px; }
.directory-section .search-form + .hint { margin-bottom: 20px; }
.directory-section .people-grid { column-gap: 32px; }
.directory-section .person-card { padding: 26px 0; }
.directory-section .person-name { font-size: 19px; line-height: 1.5; }
.directory-section .person-affiliation { font-size: 14px; line-height: 1.7; }
.directory-section .person-bio { margin-top: 12px; font-size: 14px; line-height: 1.85; }
.directory-section .person-footer { gap: 12px; padding-top: 20px; }
.directory-section .person-footer .button { padding-left: 16px; padding-right: 16px; }
.directory-section > .text-button { padding-left: 0; margin-top: 4px; text-decoration: underline; text-underline-offset: 4px; }
.directory-section .empty-state { padding: 28px 0; border-bottom: 0; font-size: 14px; }
@media (max-width: 1000px) {
  .recommendations-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recommendation-card { min-height: 316px; padding: 22px; }
  .recommendation-card:first-child { padding-top: 20px; }
}
@media (max-width: 600px) {
  .people-page { padding-top: 4px; }
  .directory-heading { flex-direction: column; gap: 8px; margin-bottom: 28px; }
  .directory-heading h1 { font-size: 28px; letter-spacing: -.3px; }
  .directory-heading p { margin-top: 8px; font-size: 14px; }
  .directory-heading > .text-button { min-height: 44px; margin: 0; padding: 10px 0; }
  .profile-nudge { margin: -2px 0 28px; padding: 12px 14px; gap: 4px; }
  .profile-nudge > .text-button { padding-left: 0; }
  .recommendations { margin-bottom: 34px; }
  .recommendations-head { margin-bottom: 16px; }
  .recommendations-head h2 { font-size: 22px; }
  .recommendations-head p { font-size: 13px; }
  .recommendations-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .recommendation-card { min-height: 0; padding: 22px; }
  .recommendation-card:first-child { padding-top: 20px; }
  .recommendation-card .person-bio { margin-top: 14px; }
  .recommendation-card .person-footer { padding-top: 22px; gap: 10px; }
  .recommendation-reason { margin-bottom: 14px; }
  .recommendations-empty { padding: 24px 22px; }
  .recommendations-empty h3 { font-size: 20px; }
  .recommendations-empty p { font-size: 14px; }
  .recommendations-empty-actions { margin-top: 20px; }
  .directory-section { padding-top: 26px; }
  .directory-section > .section-head h2 { font-size: 20px; }
  .directory-section .search-form { gap: 8px; }
  .directory-section .search-form > .button { min-width: 70px; padding-left: 14px; padding-right: 14px; }
  .directory-section .person-card { padding: 22px 0; }
}
@media (max-width: 370px) {
  .recommendation-card { padding: 20px; }
  .recommendation-card:first-child { padding-top: 18px; }
  .recommendations-empty { padding: 22px 20px; }
  .recommendations-empty h3 { font-size: 19px; }
  .recommendations-empty-actions .button { width: 100%; padding-left: 14px; padding-right: 14px; }
}

.people-page .discovery-tabs { gap: 28px; margin-bottom: 28px; }
.discovery-tabs .tab { min-height: 48px; font-size: 15px; }
.people-page .directory-section { padding-top: 0; border-top: 0; }
.discovery-all-link { min-height: 44px; margin-top: 20px; padding-left: 0; padding-right: 0; text-decoration: underline; text-underline-offset: 4px; }
.onboarding-page { display: flex; flex-direction: column; width: 100%; max-width: 680px; min-height: calc(100svh - 170px); margin: 0 auto; padding: 12px 0 0; }
.onboarding-progress { margin-bottom: 30px; color: #788493; font-size: 13px; line-height: 1.7; }
.onboarding-progress progress { display: block; width: 100%; height: 3px; margin-top: 14px; border: 0; border-radius: 0; appearance: none; color: var(--blue); background: #e9eef3; }
.onboarding-progress progress::-webkit-progress-bar { background: #e9eef3; }
.onboarding-progress progress::-webkit-progress-value { background: var(--blue); }
.onboarding-progress progress::-moz-progress-bar { background: var(--blue); }
.onboarding-card { flex: 1 1 auto; min-width: 0; padding: 0; border: 0; background: #fff; box-shadow: none; }
.onboarding-card h1, .onboarding-card h2 { color: #1a2d43; font-size: 28px; font-weight: 600; line-height: 1.45; letter-spacing: -.3px; }
.onboarding-card > p, .onboarding-description { margin-top: 10px; color: #707d8c; font-size: 14px; line-height: 1.85; }
.onboarding-form { display: flex; flex-direction: column; gap: 22px; margin-top: 30px; min-width: 0; }
.onboarding-form > .field + .field { margin-top: 0; }
.onboarding-form > .hint { margin-top: 0; }
.onboarding-form .form-grid { gap: 20px; }
.onboarding-form .field > .label, .onboarding-form .field > label { font-size: 14px; }
.onboarding-form .input, .onboarding-form .select, .onboarding-form .textarea { min-height: 48px; }
.onboarding-form .textarea { min-height: 110px; }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; min-width: 0; }
.choice-grid > label, .choice-grid > .choice-option { display: flex; align-items: flex-start; gap: 10px; min-width: 0; min-height: 48px; margin: 0; padding: 12px 14px; border: 1px solid #d6dee7; border-radius: 6px; background: #fff; color: #4e5e71; font-size: 14px; font-weight: 400; line-height: 1.65; cursor: pointer; overflow-wrap: anywhere; transition: border-color .14s, background-color .14s; }
.choice-grid input[type="checkbox"], .choice-grid input[type="radio"] { flex: 0 0 17px; width: 17px; height: 17px; margin: 3px 0 0; accent-color: var(--blue); }
.choice-grid > label:hover, .choice-grid > .choice-option:hover { border-color: #93abc3; background: #f8fafc; }
.choice-grid > label:has(input:checked), .choice-grid > .choice-option:has(input:checked) { border-color: #315d88; background: #f2f6fb; color: var(--blue); }
.choice-grid > label:has(input:focus-visible), .choice-grid > .choice-option:has(input:focus-visible) { outline: 2px solid #507aa5; outline-offset: 2px; }
.choice-grid > label:has(input:disabled), .choice-grid > .choice-option:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.wizard-actions { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 14px; padding: 18px 0 max(18px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; }
.wizard-actions > .button-primary { min-width: 112px; min-height: 46px; margin-left: auto; }
.wizard-actions > .text-button { padding-left: 0; }
.onboarding-skip { display: flex; justify-content: center; margin-top: 0; padding-bottom: 12px; }
.onboarding-skip .text-button, .onboarding-page > .text-button { min-height: 44px; text-decoration: underline; text-underline-offset: 4px; }
.onboarding-receipt { max-width: 560px; padding: 40px 0 48px; }
.onboarding-receipt h1, .onboarding-receipt h2 { color: #1a2d43; font-size: 28px; font-weight: 600; line-height: 1.5; }
.onboarding-receipt p { margin-top: 14px; color: #687586; font-size: 15px; line-height: 1.85; }
.onboarding-receipt .button { min-height: 46px; margin-top: 28px; padding-left: 24px; padding-right: 24px; }
.profile-fieldset { min-width: 0; margin: 0; padding: 24px 0 0; border: 0; border-top: 1px solid var(--line); }
.profile-fieldset:first-child { padding-top: 0; border-top: 0; }
.profile-fieldset > legend { padding: 0 0 14px; color: var(--ink); font-size: 17px; font-weight: 600; line-height: 1.65; }
.profile-fieldset > .hint { margin: 0 0 14px; }
.profile-fieldset .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.profile-fieldset > .field + .field { margin-top: 18px; }
@media (max-width: 600px) {
  .people-page .discovery-tabs { gap: 24px; margin-bottom: 24px; }
  .onboarding-page { min-height: calc(100svh - 165px); padding-top: 4px; }
  .onboarding-progress { margin-bottom: 24px; font-size: 12px; }
  .onboarding-card h1, .onboarding-card h2 { font-size: 26px; }
  .onboarding-card > p, .onboarding-description { font-size: 14px; }
  .onboarding-form { gap: 20px; margin-top: 26px; }
  .onboarding-form .form-grid { gap: 18px; }
  .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .choice-grid > label, .choice-grid > .choice-option { gap: 8px; padding: 12px; font-size: 13px; }
  .wizard-actions { gap: 12px; margin-top: 10px; padding-top: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .wizard-actions > .button-primary { min-width: 108px; }
  .onboarding-receipt { padding: 28px 0 40px; }
  .onboarding-receipt h1, .onboarding-receipt h2 { font-size: 26px; }
  .onboarding-receipt p { font-size: 14px; }
}
@media (max-height: 500px) {
  .wizard-actions { position: static; }
}

.recommendations-time-note, .directory-time-note { margin-top: 18px; color: #718091; font-size: 13px; line-height: 1.8; }
.directory-time-note { margin: 12px 0 22px; }
.discovery-more { display: flex; justify-content: flex-end; margin-top: 0; }
.discovery-loading { padding: 32px; border: 1px solid #e1e8ef; border-radius: 8px; background: #f7f9fc; color: #687586; font-size: 14px; }
.recommendations-empty > .button { margin-top: 20px; }
.recommendations-empty-copy .hint { margin-top: 4px; }
.clear-search { margin: 0 0 4px; padding-left: 0; text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 600px) {
  .discovery-more { justify-content: flex-start; }
  .discovery-loading { padding: 24px 22px; }
}

.wizard-action-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; width: 100%; }
.wizard-action-row > .button-primary { min-width: 112px; min-height: 46px; margin-left: auto; }
.wizard-action-row > .text-button { padding-left: 0; }
.wizard-actions > .onboarding-skip { width: 100%; margin-top: -6px; padding-bottom: 0; }
.onboarding-skip .text-button { color: #617184; font-size: 13px; }
.onboarding-ranges { display: flex; flex-direction: column; gap: 0; }
.onboarding-ranges .slot-row { font-size: 14px; }
.people-page .person-bio, .recommendations-empty-copy > p:not(.hint) { font-size: 15px; line-height: 1.8; }
@media (max-width: 600px) {
  .wizard-action-row { gap: 12px; }
  .wizard-action-row > .button-primary { min-width: 108px; }
}

@media (min-width: 761px) {
  .recommendations-grid:has(> .recommendation-card:nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recommendations-grid:has(> .recommendation-card:only-child) { grid-template-columns: minmax(0, 1fr); }
  .recommendation-card:only-child { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 260px); column-gap: 40px; min-height: 0; padding: 26px 28px 28px; }
  .recommendation-card:only-child .recommendation-reason { grid-column: 1 / -1; margin-bottom: 16px; }
  .recommendation-card:only-child .person-summary { grid-column: 1; }
  .recommendation-card:only-child .person-footer { grid-column: 2; align-self: end; width: 100%; margin-top: 0; padding-top: 0; }
}
@media (min-width: 601px) and (max-width: 760px) {
  .recommendations-grid:has(> .recommendation-card:only-child) { grid-template-columns: minmax(0, 1fr); }
  .recommendation-card:only-child .person-footer { max-width: 300px; }
}

/* The active discovery tab is the visual section title. */
.people-page .directory-heading { margin-bottom: 24px; }
.people-page .discovery-tabs .tab { font-size: 16px; }
.recommendations-head h2, .directory-section-head h2 { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.recommendations-head p { margin-top: 0; font-size: 13px; line-height: 1.8; }
.directory-section > .directory-section-head { justify-content: flex-end; margin-bottom: 12px; min-height: 22px; }
@media (max-width: 600px) {
  .people-page .directory-heading { gap: 2px; margin-bottom: 16px; }
  .people-page .discovery-tabs { margin-bottom: 20px; }
  .recommendations-head { margin-bottom: 16px; }
}

/* In onboarding, only the question body scrolls; progress and actions stay in view. */
.page-shell:has(> .onboarding-page) { max-width: none; padding: 32px 24px 0; }
.onboarding-page { height: calc(100dvh - 182px); min-height: 0; padding-top: 0; }
.onboarding-step-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
.onboarding-progress { flex: 0 0 auto; margin-bottom: 24px; }
.onboarding-card { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 4px 20px 0; }
.onboarding-card h1:focus, .onboarding-receipt h1:focus { outline: none; }
.onboarding-form .choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.onboarding-page > .wizard-actions { position: static; flex: 0 0 auto; margin-top: 12px; padding-top: 16px; padding-bottom: 14px; gap: 10px; }
.onboarding-page > .wizard-actions > .error { flex: 1 0 100%; width: 100%; margin: 0; }
.onboarding-page > .wizard-actions > .onboarding-skip { margin-top: -6px; }
.onboarding-receipt { height: auto; min-height: calc(100dvh - 182px); padding-top: 36px; }
.onboarding-receipt-label { color: #718091; font-size: 13px !important; margin-top: 0 !important; margin-bottom: 12px; }
.onboarding-receipt .form-actions { justify-content: flex-start; margin-top: 24px; }
.onboarding-receipt .form-actions .button { margin-top: 0; }
@media (max-width: 600px) {
  .page-shell:has(> .onboarding-page) { padding: 24px 20px 0; }
  .onboarding-page { height: calc(100dvh - 169px); }
  .onboarding-form .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .onboarding-card { padding-bottom: 16px; }
  .onboarding-receipt { min-height: calc(100dvh - 169px); padding-top: 24px; }
}
@media (max-width: 370px) {
  .page-shell:has(> .onboarding-page) { padding-left: 16px; padding-right: 16px; }
}
@media (max-height: 500px) {
  .onboarding-page { height: auto; min-height: 0; }
  .onboarding-card { overflow: visible; }
}

/* Size the onboarding viewport from the actual header/footer, not assumed heights. */
.app:has(.onboarding-page) { display: flex; flex-direction: column; height: 100dvh; min-height: 100svh; }
.app:has(.onboarding-page) > .site-header, .app:has(.onboarding-page) > .site-footer { flex: 0 0 auto; }
.app:has(.onboarding-page) > .page-shell { flex: 1 1 auto; min-height: 0; }
.app:has(.onboarding-page) .onboarding-page { height: 100%; min-height: 0; }
@media (max-height: 500px) {
  .app:has(.onboarding-page) { height: auto; }
  .app:has(.onboarding-page) .onboarding-page { height: auto; min-height: 0; }
}

.dialog .public-profile-details { display: flex; flex-direction: column; gap: 0; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }
.public-profile-details > div { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; min-width: 0; padding: 7px 0; }
.public-profile-details dt { color: #758190; font-size: 13px; line-height: 1.8; }
.public-profile-details dd { color: #435366; font-size: 14px; line-height: 1.75; }
@media (max-width: 600px) {
  .public-profile-details > div { grid-template-columns: 72px minmax(0, 1fr); gap: 10px; }
}

.onboarding-card { scrollbar-width: thin; scrollbar-color: #c5d0dd transparent; }

/* Explicit conversation filters: compact text controls, never decorative pills. */
.discovery-filters { margin: 0 0 22px; }
.filter-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 40px; margin-bottom: 6px; }
.filter-heading h2 { color: #4d5d70; font-size: 14px; font-weight: 500; line-height: 1.6; }
.filter-heading .text-button { min-height: 44px; padding: 10px 0 10px 10px; color: #718092; font-size: 12px; }
.filter-options, .filter-suboptions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.filter-option { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; max-width: 100%; padding: 9px 16px; border: 1px solid #dce3eb; border-radius: 5px; background: #fff; color: #536479; font-size: 14px; font-weight: 400; line-height: 1.65; text-align: center; overflow-wrap: anywhere; transition: border-color .14s, background-color .14s, color .14s; }
.filter-option:hover { border-color: #93a9c0; background: #f8fafc; color: var(--blue); }
.filter-option[aria-pressed="true"] { border-color: #315d88; background: #f2f6fb; color: var(--blue); font-weight: 600; }
.filter-option:active { background: #eaf1f8; }
.filter-option:disabled { opacity: .5; cursor: not-allowed; }
.filter-suboptions { margin-top: 12px; padding-top: 12px; border-top: 1px solid #edf0f4; }
.filter-suboptions .filter-option { padding: 9px 14px; border-color: #e4e9ef; font-size: 13px; }
.filter-suboptions .filter-option[aria-pressed="true"] { border-color: #315d88; }
.goals-picker { display: flex; flex-direction: column; gap: 12px; }
.goal-group { min-width: 0; }
.goal-group > .choice-option { display: flex; align-items: flex-start; gap: 10px; min-height: 48px; padding: 12px 14px; border: 1px solid #d6dee7; border-radius: 6px; background: #fff; color: #4e5e71; font-size: 14px; line-height: 1.65; cursor: pointer; }
.goal-group > .choice-option input { flex: 0 0 17px; width: 17px; height: 17px; margin: 3px 0 0; accent-color: var(--blue); }
.goal-group > .choice-option:has(input:checked) { border-color: #315d88; background: #f2f6fb; color: var(--blue); font-weight: 500; }
.goal-group > .choice-option:hover { border-color: #93abc3; }
.goal-group > .choice-option:has(input:focus-visible) { outline: 2px solid #507aa5; outline-offset: 2px; }
.goal-subchoices, .onboarding-form .goal-subchoices { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 10px; padding-left: 14px; border-left: 2px solid #e1e8ef; }
@media (max-width: 600px) {
  .discovery-filters { margin-bottom: 20px; }
  .filter-options, .filter-suboptions { gap: 7px; }
  .filter-option { padding-left: 13px; padding-right: 13px; font-size: 13px; }
  .filter-suboptions .filter-option { padding-left: 12px; padding-right: 12px; }
  .goal-subchoices, .onboarding-form .goal-subchoices { padding-left: 10px; gap: 8px; }
}
@media (max-width: 370px) {
  .filter-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-options .filter-option { width: 100%; }
  .goal-subchoices, .onboarding-form .goal-subchoices { grid-template-columns: minmax(0, 1fr); }
}

.filter-search-summary { margin-top: 12px; color: #617184; }
.filter-result-count:not(:empty) { margin-top: 10px; color: #718091; font-size: 12px; line-height: 1.75; }

.person-goals { margin-top: 12px; color: #55708c; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.optional-profile-details { border-top: 1px solid var(--line); padding-top: 6px; }
.optional-profile-details > summary { display: block; min-height: 44px; padding: 10px 0; color: var(--blue); font-size: 13px; line-height: 1.8; list-style: none; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.optional-profile-details > summary::-webkit-details-marker { display: none; }
.optional-profile-details > summary::marker { content: ''; }
.optional-profile-details > .stack { padding-top: 14px; padding-bottom: 4px; }
.optional-profile-details[open] > summary { font-weight: 500; }

/* Sample profiles stay visibly separate from actual members. */
.demo-label { display: inline-block; margin-left: 5px; padding: 1px 6px; border: 1px solid #d7e0e9; border-radius: 3px; color: #60748b; font-size: 11px; font-weight: 400; line-height: 1.6; vertical-align: middle; white-space: nowrap; }
.demo-description { margin-top: 5px; color: #718091; font-size: 12px; line-height: 1.7; }
