:root {
  --blue: #0055a4;
  --blue-dark: #003f7c;
  --avocado: #dcf4a2;
  --avocado-soft: #eff9d0;
  --ink: #123047;
  --muted: #577080;
  --paper: #fffef8;
  --line: #8fa8b5;
  --danger: #b44122;
  --success: #27663f;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { background: #102638; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  background: #102638;
}
button, input, select { font: inherit; }
button { border-radius: 0; }

.brand-bar {
  width: min(100%, 760px);
  margin: 0 auto;
  background-color: var(--blue);
}
.brand-header-image { display: block; width: 100%; height: auto; }

.shell {
  width: min(100%, 760px);
  min-height: calc(100vh - min(35.334vw, 269px));
  margin: 0 auto;
  padding: 48px 42px 112px;
  background-color: var(--avocado);
  background-image: radial-gradient(circle, rgba(0, 85, 164, .11) 1px, transparent 1.3px);
  background-size: 12px 12px;
}
.panel { animation: appear .22s ease; }
.hidden { display: none !important; }
.eyebrow {
  display: inline-block;
  margin: 0 0 20px;
  padding: 7px 10px 6px;
  color: var(--avocado);
  background: var(--blue);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}
h1, h2 { color: var(--blue); font-family: var(--serif); }
h1 {
  max-width: 650px;
  margin: 0 0 20px;
  font-size: clamp(2.8rem, 8vw, 4.65rem);
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: .96;
}
h2 { margin: 0; font-size: 1.75rem; line-height: 1.05; }
.intro { max-width: 610px; margin: 0 0 34px; color: var(--ink); font-size: 1.08rem; line-height: 1.55; }
.state { padding-top: 12vh; text-align: center; }
.state h1 { margin-inline: auto; font-size: 2.8rem; }
.state .eyebrow { margin-inline: auto; }
.loader {
  display: inline-flex;
  width: 58px;
  height: 58px;
  align-items: center;
  justify-content: center;
  font-size: 2.65rem;
  line-height: 1;
  transform-origin: center bottom;
  animation: ball-bounce 1.05s ease-in-out infinite;
}

form { display: grid; gap: 25px; }
label, legend { color: var(--ink); font-size: 1rem; font-weight: 700; }
fieldset { margin: 0; padding: 0; border: 0; }
.field-hint { color: var(--muted); font-size: .8rem; font-weight: 400; }
.field-copy { margin: 7px 0 13px; color: var(--muted); font-size: .92rem; font-weight: 400; line-height: 1.45; }
input, select[name="whatsapp_country"] {
  display: block;
  width: 100%;
  margin-top: 9px;
  padding: 16px 15px;
  border: 1px solid var(--blue);
  border-radius: 0;
  color: var(--ink);
  background: var(--paper);
}
input:focus, select[name="whatsapp_country"]:focus { border-color: var(--blue-dark); outline: 3px solid rgba(0, 85, 164, .22); }
.phone-field { display: grid; grid-template-columns: auto 1fr; margin-top: 9px; }
.phone-prefix { display: flex; align-items: center; padding: 0 14px; border: 1px solid var(--blue); border-right: 0; color: var(--avocado); background: var(--blue); font-weight: 700; }
.phone-field input { margin-top: 0; }

.preference-options, .skill-options { display: grid; gap: 9px; }
.preference-options input, .skill-options input { position: absolute; opacity: 0; pointer-events: none; }
.preference-options span, .skill-options span {
  display: grid;
  padding: 14px 15px;
  border: 1px solid var(--blue);
  color: var(--ink);
  background: rgba(255, 254, 248, .82);
  font-weight: 400;
  cursor: pointer;
}
.preference-options input:checked + span, .skill-options input:checked + span { border-color: var(--blue); color: var(--avocado); background: var(--blue); }
.preference-options input:focus-visible + span, .skill-options input:focus-visible + span { outline: 3px solid rgba(0, 85, 164, .28); outline-offset: 2px; }
.skill-options span { grid-template-columns: minmax(78px, auto) 1fr; column-gap: 12px; align-items: center; }
.skill-options span strong { grid-row: 1 / span 2; font-size: 1.02rem; letter-spacing: -3px; }
.skill-options span b { font-size: 1rem; }
.skill-options span small { grid-column: 2; margin-top: 4px; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.skill-options input:checked + span small { color: var(--avocado-soft); }
.skill-options-compact span { grid-template-columns: minmax(78px, auto) 1fr; }
.skill-options-compact span strong { grid-row: auto; }
.consent-option { display: grid; grid-template-columns: 24px 1fr; gap: 11px; align-items: start; padding-top: 20px; border-top: 1px solid rgba(0, 85, 164, .4); }
.consent-option input { width: 20px; height: 20px; margin: 1px 0 0; padding: 0; accent-color: var(--blue); }
.consent-option span { font-size: .9rem; font-weight: 400; line-height: 1.45; }

.button {
  width: 100%;
  padding: 17px 20px;
  border: 1px solid var(--blue);
  color: var(--avocado);
  background: var(--blue);
  font-size: 1.03rem;
  font-weight: 700;
  cursor: pointer;
}
.button:hover { border-color: var(--blue-dark); background: var(--blue-dark); }
.button:disabled { border-color: #8195a0; color: #e9efe5; background: #8195a0; cursor: not-allowed; }
.button-secondary { margin-top: 16px; color: var(--avocado); background: var(--ink); border-color: var(--ink); }
.button-quiet { color: var(--blue); background: transparent; border-color: var(--blue); }
.button-quiet:hover { color: var(--avocado); background: var(--blue); }
.button-danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.button-danger:hover { background: #8f3018; border-color: #8f3018; }
.button[aria-busy="true"] { opacity: .72; }
.button[aria-busy="true"]::after { content: " …"; }

.date-strip-wrap { position: relative; }
.date-strip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 34px 18px 0; scroll-snap-type: x proximity; }
.date-button { position: relative; min-width: 84px; height: 78px; border: 1px solid var(--blue); color: var(--blue); background: rgba(255, 254, 248, .52); font-size: 1rem; line-height: 1.25; scroll-snap-align: start; }
.date-button[aria-selected="true"] { border-color: var(--blue); color: var(--avocado); background: var(--blue); }
.date-button small { display: block; margin-top: 4px; font-size: .7rem; }
.scroll-cue { position: absolute; right: 0; top: 22px; display: flex; width: 34px; height: 38px; align-items: center; justify-content: center; color: var(--blue); background: linear-gradient(90deg, transparent, var(--avocado) 40%); font-size: 1.45rem; font-weight: 700; pointer-events: none; }
.day-heading, .section-heading { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 18px; gap: 14px; }
.count-pill { display: flex; min-width: 34px; height: 34px; padding: 0 8px; align-items: center; justify-content: center; border: 1px solid var(--blue); color: var(--avocado); background: var(--blue); font-weight: 700; }
.slot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.slot-button { height: 58px; border: 1px solid var(--blue); color: var(--blue); background: var(--paper); font-size: 1rem; }
.slot-button[aria-pressed="true"] { color: var(--avocado); background: var(--blue); }
.schedule-section { padding: 4px 0 10px; }
.date-schedule-section { margin-top: 48px; padding-top: 38px; border-top: 1px solid rgba(0, 85, 164, .42); }
.schedule-section > .section-copy { margin: 11px 0 24px; }
.schedule-day-title { margin: 18px 0 14px; color: var(--ink); font-family: var(--sans); font-size: 1rem; font-weight: 700; text-transform: none; }
.recurring-day-strip { margin-bottom: 8px; }
.recurring-day-button { min-width: 92px; }
.schedule-slot-grid { align-items: stretch; }
.schedule-slot { display: flex; height: 78px; padding: 10px 7px; align-items: center; justify-content: center; flex-direction: column; gap: 7px; }
.slot-time { font-size: 1.02rem; }
.slot-state { font-size: .68rem; font-weight: 700; line-height: 1.2; }
.slot-protected, .slot-protected[aria-pressed="true"] { border-color: #8c9aa1; color: #5d6e77; background: #e5eaec; cursor: pointer; }
.schedule-callout { margin: 20px 0 28px; padding: 17px 18px; border-left: 5px solid var(--blue); background: rgba(255, 254, 248, .78); line-height: 1.5; }
.date-week-groups { display: grid; gap: 24px; }
.date-week-group { min-width: 0; }
.week-label { margin: 0 0 10px; color: #35546a; font-family: var(--sans); font-size: .78rem; letter-spacing: .13em; line-height: 1.4; text-transform: uppercase; }
.date-week-group .date-strip { padding-bottom: 4px; }
.protected-slot-message { margin-top: 14px; padding: 16px 18px; border: 1px solid var(--blue); background: rgba(255, 254, 248, .82); }
.protected-slot-message p { margin: 0; line-height: 1.5; }
.protected-slot-message .level-guide-link { padding-bottom: 0; }
.selection-summary { display: flex; justify-content: space-between; gap: 12px; margin: 28px 0 22px; padding: 18px 0; border-top: 1px solid rgba(0, 85, 164, .4); border-bottom: 1px solid rgba(0, 85, 164, .4); color: var(--muted); }
.selection-summary strong { color: var(--ink); }

.section-copy, .match-meta { color: var(--muted); line-height: 1.45; }
.alternate-section { margin-top: 46px; padding-top: 34px; border-top: 1px solid rgba(0, 85, 164, .4); }
.section-spacer { margin-top: 18px; }
.match-list { display: grid; gap: 12px; }
.match-card { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; padding: 19px; border: 1px solid var(--blue); background: rgba(255, 254, 248, .8); }
.match-card h3 { margin: 0 0 7px; color: var(--blue); font-family: var(--serif); font-size: 1.55rem; }
.match-meta { margin: 0; }
.match-card .button { width: auto; min-width: 150px; padding: 13px 16px; }
.match-contact { margin-top: 11px; font-weight: 700; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.card-actions .button { min-width: 110px; }
.whatsapp-button { display: inline-block; color: var(--avocado); background: var(--blue); border-color: var(--blue); text-align: center; text-decoration: none; }
.confirmed-match-card { grid-template-columns: 1fr; gap: 17px; padding: 22px; }
.confirmed-match-card .card-kicker { display: inline-block; width: max-content; margin: 0 0 12px; padding: 6px 8px 5px; color: var(--avocado); background: var(--blue); font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.confirmed-match-card h3 { margin-bottom: 8px; font-size: 1.75rem; }
.confirmed-match-card .match-meta { color: var(--muted); line-height: 1.5; }
.confirmed-match-card .match-contact { display: flex; gap: 12px; justify-content: space-between; margin: 16px 0 0; padding: 12px 0; border-top: 1px solid rgba(0,85,164,.35); border-bottom: 1px solid rgba(0,85,164,.35); font-weight: 400; }
.confirmed-match-card .match-contact span { color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.confirmed-match-card .match-contact strong { color: var(--ink); text-align: right; }
.confirmed-match-card .card-actions { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; justify-content: stretch; }
.confirmed-match-card .card-actions .button { width: 100%; }
.button-cancel-subtle { min-width: 0 !important; padding-inline: 12px !important; border-color: transparent; color: var(--blue); background: transparent; text-decoration: underline; }
.button-cancel-subtle:hover { border-color: var(--blue); background: transparent; }
.empty-state { margin: 0; padding: 22px; border: 1px dashed var(--blue); color: var(--muted); background: rgba(255, 254, 248, .48); line-height: 1.5; }

.match-filter { margin: 0 0 34px; }
.filter-toggle { width: 100%; padding: 18px; border: 2px solid var(--blue); color: var(--blue); background: var(--paper); font-size: 1.05rem; font-weight: 700; text-align: left; cursor: pointer; }
.filter-toggle::after { content: "+"; float: right; font-size: 1.3rem; line-height: .9; }
.filter-toggle[aria-expanded="true"]::after { content: "−"; }
.filter-panel { display: grid; gap: 25px; padding: 22px; border: 1px solid var(--blue); border-top: 0; background: rgba(255, 254, 248, .84); }
.filter-panel legend { margin-bottom: 10px; }
.filter-options { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-options label { position: relative; }
.filter-options input { position: absolute; opacity: 0; pointer-events: none; }
.filter-options span { display: block; padding: 10px 12px; border: 1px solid var(--blue); color: var(--blue); background: var(--paper); font-size: .82rem; font-weight: 700; cursor: pointer; }
.filter-options input:checked + span { color: var(--avocado); background: var(--blue); }
.filter-options input:focus-visible + span { outline: 3px solid rgba(0, 85, 164, .28); outline-offset: 2px; }
.filter-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }

.form-error { margin: 0; padding: 13px; border-left: 5px solid var(--danger); background: #fff0e9; }
.confirmation, #referral-feedback { color: var(--success); font-weight: 700; text-align: center; }
.level-guide-link, .level-guide-inline { padding: 10px 0; border: 0; color: var(--blue); background: transparent; font: inherit; text-align: left; text-decoration: underline; cursor: pointer; }
.level-guide-link { margin-top: 4px; }
.level-guide-inline { font-size: .8rem; }
.profile-form { margin-bottom: 8px; }
.level-guide-list { display: grid; gap: 17px; margin: 24px 0; padding-left: 22px; }
.level-guide-list li { padding-left: 5px; }
.level-guide-list strong, .level-guide-list span { display: block; }
.level-guide-list span { margin-top: 4px; color: var(--muted); font-size: .9rem; line-height: 1.45; }

.invite-callout, .invite-safety, .recovery-confirmation { padding: 19px; border: 1px solid var(--blue); background: rgba(255, 254, 248, .78); }
.invite-callout { display: grid; gap: 7px; margin-top: 24px; }
.invite-callout span, .invite-safety p, .access-home-note p { color: var(--muted); line-height: 1.5; }
.invite-callout .level-guide-link { justify-self: start; padding-bottom: 0; }
.invite-safety { margin: 0 0 24px; }
.invite-safety p, .access-home-note p { margin: 8px 0 0; }
#invite-actions { display: grid; gap: 10px; }
.referral-field { display: block; margin-top: 10px; }
.referral-field input { color: var(--muted); font-size: .82rem; }
#referral-feedback { min-height: 1.4em; }
.access-home-note { margin-top: 34px; padding-top: 24px; border-top: 1px solid rgba(0, 85, 164, .4); }
.recovery-confirmation { line-height: 1.5; }

.main-nav { position: fixed; z-index: 10; bottom: 0; left: 50%; display: grid; grid-template-columns: repeat(5, 1fr); width: min(100%, 760px); transform: translateX(-50%); border-top: 1px solid var(--blue); background: var(--paper); }
.main-nav button { min-width: 0; padding: 17px 3px; border: 0; color: var(--muted); background: var(--paper); font-size: .86rem; }
.main-nav button[aria-current="page"] { color: var(--avocado); background: var(--blue); font-weight: 700; }
.nav-badge { display: inline-flex; min-width: 19px; height: 19px; margin-left: 2px; padding: 0 5px; align-items: center; justify-content: center; color: var(--blue); background: var(--avocado); border: 1px solid var(--blue); font-size: .7rem; }

dialog { width: min(calc(100% - 36px), 560px); padding: 30px; border: 2px solid var(--blue); color: var(--ink); background-color: var(--avocado); background-image: radial-gradient(circle, rgba(0, 85, 164, .1) 1px, transparent 1.3px); background-size: 12px 12px; box-shadow: 10px 10px 0 rgba(0, 31, 70, .45); }
dialog::backdrop { background: rgba(7, 29, 47, .72); }
dialog h2 { font-size: 2rem; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 24px; }
.dialog-actions .button-secondary { margin-top: 0; }

@keyframes ball-bounce {
  0%, 100% { transform: translateY(0) scale(1.02,.96); }
  50% { transform: translateY(-12px) scale(.98,1.02); }
}
@keyframes appear { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 560px) {
  .shell { padding: 38px 22px 108px; }
  h1 { font-size: clamp(2.65rem, 13vw, 3.7rem); }
  .skill-options span, .skill-options-compact span { grid-template-columns: 1fr; }
  .skill-options span strong, .skill-options span small { grid-column: 1; grid-row: auto; }
  .skill-options span strong { margin-bottom: 3px; }
  .consent-option { grid-template-columns: 22px 1fr; }
  .slot-grid { grid-template-columns: repeat(2, 1fr); }
  .schedule-slot { height: 82px; }
  .selection-summary { flex-direction: column; }
  .match-card { grid-template-columns: 1fr; }
  .match-card .button, .card-actions .button { width: 100%; }
  .card-actions { display: grid; }
  .confirmed-match-card .card-actions { grid-template-columns: 1fr; }
  .confirmed-match-card .match-contact { align-items: flex-start; flex-direction: column; }
  .confirmed-match-card .match-contact strong { text-align: left; }
  .main-nav button { padding: 15px 1px; font-size: .7rem; }
  .dialog-actions { grid-template-columns: 1fr; }
  .filter-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Independent schedule disclosures preserve their DOM and unsaved selections. */
.schedule-disclosure > summary { cursor: pointer; list-style: none; padding: 18px 0; }
.schedule-disclosure > summary::-webkit-details-marker { display: none; }
.schedule-disclosure > summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 5px; }
.schedule-disclosure > summary h2 { margin: 0; }
.schedule-disclosure > summary .section-copy { margin: 12px 0 18px; }
.schedule-action { display: flex; justify-content: space-between; align-items: center; gap: 16px; color: var(--blue); font-weight: 700; }
.schedule-chevron { font-size: 1.6rem; line-height: 1; }
.schedule-disclosure[open] > summary .schedule-chevron { transform: rotate(180deg); }
.schedule-disclosure:not([open]) .when-open, .schedule-disclosure[open] .when-closed { display: none; }
.schedule-status { display: block; margin-top: 10px; color: var(--muted); font-size: .85rem; }
.schedule-status.is-dirty { color: var(--blue); font-weight: 700; }
.schedule-content { padding-top: 8px; }
.schedule-disclosure.date-schedule-section { margin-top: 20px; padding-top: 16px; }

.invitation-feedback { grid-column: 1 / -1; margin: 12px 0 0; overflow-wrap: anywhere; }
.field-hint { font-size: .9rem; margin-top: 0; }
select[name="whatsapp_country"] { width: 100%; min-width: 0; }

.preference-options label, .skill-options label { position: relative; min-width: 0; }

.alternate-date-filter { display: grid; gap: 9px; margin: 0 0 24px; }
#alternate-date { display: block; width: 100%; max-width: 440px; min-width: 0; padding: 14px; border: 1px solid var(--blue); border-radius: 0; color: var(--ink); background: var(--paper); }
#alternate-date:focus { outline: 3px solid rgba(0, 85, 164, .22); }
#alternate-date-count { margin: 0; }

.invitation-history { margin-top: 32px; border-top: 1px solid var(--blue); padding-top: 20px; }
.invitation-history summary { cursor: pointer; color: var(--blue); font-size: 1.2rem; font-weight: 700; padding: 12px 0; }
.invitation-history summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.history-toggle { float: right; }
.invitation-history[open] .history-toggle { display: none; }
.main-nav button:disabled { cursor: wait; opacity: .65; }
