:root {
  font-family: system-ui, -apple-system, sans-serif;
  color: #172235;
  background: #f8f5ee;
  font-synthesis: none;
  --accent: #ad3d1c;
  --border: #ddd8cc;
  --muted: #58605f;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
button, textarea, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid #bb4e2e;
  outline-offset: 3px;
}
.site-header {
  height: 68px;
  width: min(100% - 36px, 1024px);
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.site-header img { display: block; object-fit: contain; }
main { padding: 0 18px 20px; }
.sign-in {
  width: min(100%, 1024px);
  margin: clamp(12px, 5vh, 50px) auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(326px, 390px);
  gap: clamp(16px, 3vw, 32px);
  align-items: center;
}
.match-preview {
  background: linear-gradient(145deg, #172235, #28384a);
  color: #fffdfa;
  border-radius: 26px;
  padding: clamp(26px, 4vw, 43px);
}
.match-preview h1 {
  max-width: 12ch;
  font-size: clamp(34px, 4.1vw, 58px);
  line-height: 1.04;
  letter-spacing: -.055em;
}
.headline-rotating, .headline-motion { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .match-headline.is-animated { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .is-animated .headline-static {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .is-animated .headline-rotating { display: inline; }
  .headline-phrases {
    display: inline-grid;
    vertical-align: baseline;
    white-space: nowrap;
    color: #ffc498;
  }
  .headline-phrases > span {
    grid-area: 1 / 1;
    opacity: 0;
    animation: rotate-headline 12s ease-in-out infinite;
  }
  .headline-phrases > span:nth-child(1) { animation-delay: -.36s; }
  .headline-phrases > span:nth-child(2) { animation-delay: 3.64s; }
  .headline-phrases > span:nth-child(3) { animation-delay: 7.64s; }
  .is-paused .headline-phrases > span { animation-play-state: paused; }
  .is-animated .headline-motion {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    color: #ede8df;
    background: transparent;
    border: 1px solid #ede8df60;
    border-radius: 50%;
  }
  .headline-motion:focus-visible { outline-color: #ffc498; }
  .headline-motion span { width: 9px; height: 10px; border-inline: 2px solid; }
  .headline-motion[aria-pressed="true"] span {
    width: 0;
    height: 0;
    margin-left: 2px;
    border: 0;
    border-block: 5px solid transparent;
    border-left: 8px solid currentColor;
  }
}
@keyframes rotate-headline {
  0% { opacity: 0; transform: translateY(.16em); }
  3%, 33.33% { opacity: 1; transform: translateY(0); }
  36.33%, 100% { opacity: 0; transform: translateY(-.16em); }
}
.match-intro { max-width: 44ch; margin: 14px 0 23px; color: #ede8df; line-height: 1.55; }
.match-preview h2 { font-size: 13px; color: #ede8df; margin: 0 0 9px; font-weight: 650; }
.match-profiles { display: grid; gap: 8px; }
.match-profile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  color: #172235;
  background: #fbf8f1;
  border-radius: 13px;
  padding: 11px;
}
.profile-photo {
  width: 56px;
  height: 56px;
  border-radius: 9px;
  background: #ded6c6 url('/assets/extro-match-portraits.png') no-repeat;
  background-size: 200% auto;
}
.profile-gc { background-position: left center; }
.profile-electrical { background-position: right center; }
.match-profile h3 { font-size: 15px; line-height: 1.25; font-weight: 750; }
.profile-role { color: #943516; margin-top: 2px; font-size: 12px; font-weight: 650; }
.profile-interest { color: #4d5758; margin-top: 4px; font-size: 13px; line-height: 1.35; }
.sign-in-panel {
  display: flex;
  flex-direction: column;
  background: #fffdfa;
  border: 1px solid var(--border);
  border-radius: 23px;
  box-shadow: 0 18px 55px #51432213;
  padding: clamp(17px, 3vw, 27px);
}
.sign-in-panel h2 { font-size: 23px; letter-spacing: -.035em; margin: 0 0 14px; }
#phone-form[hidden] ~ #send-code { display: none; }
#sign-in-verification:empty { display: none; }
.sign-in:has(#code-form:not([hidden])) { display: block; width: min(100%, 468px); }
.sign-in:has(#code-form:not([hidden])) .match-preview { display: none; }
.sign-in:has(#code-form:not([hidden])) #sign-in-verification { order: 1; margin-top: 8px; }
.sign-in:has(#code-form:not([hidden])) #login-status { order: 2; }
.sign-in:has(#code-form:not([hidden])) footer { order: 3; }
.sign-in label { display: block; font-size: 14px; font-weight: 650; margin-bottom: 8px; }
#code-form label { font-size: 20px; letter-spacing: -.025em; }
.sign-in input, textarea {
  background: #fff;
  border: 1px solid #bcb8ad;
  border-radius: 12px;
  color: inherit;
  min-height: 47px;
  padding: 10px 13px;
  width: 100%;
}
.sign-in .notice { margin: 12px 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.code-entry { position: relative; }
.code-slots { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(4px, 2vw, 9px); }
.code-slots span {
  display: grid;
  place-items: center;
  height: 52px;
  background: #fff;
  border: 1px solid #bcb8ad;
  border-radius: 10px;
  font-size: clamp(20px, 5vw, 25px);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.code-entry:focus-within .code-cursor { outline: 2px solid var(--accent); outline-offset: 1px; }
.code-entry input { position: absolute; inset: 0; height: 100%; opacity: 0; cursor: text; font-size: 16px; }
.code-actions { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0 12px; margin-top: 6px; }
.code-actions button { font-size: 14px; }
.code-actions button:disabled { opacity: 1; color: var(--muted); }
.primary, .secondary {
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 10px 16px;
  min-height: 45px;
  font-weight: 650;
}
.primary { background: var(--accent); color: #fff; }
.primary:hover:not(:disabled) { background: #8c2f14; }
.secondary { background: #fffdfa; color: #973215; }
.full { width: 100%; margin-top: 12px; }
.text-button { background: transparent; border: 0; color: #943516; min-height: 40px; padding: 4px 0; }
.sign-in footer { font-size: 13px; display: flex; gap: 18px; margin-top: 16px; }
.sign-in footer a { color: var(--muted); text-underline-offset: 3px; }
.status { color: #942e19; font-size: 13px; line-height: 1.4; }
.status:not(:empty) { margin-top: 9px; }
.loading { margin: 15vh auto; text-align: center; color: var(--muted); }
.in-chat .site-header { display: none; }
.in-chat main { padding: 0; }
.chat {
  width: min(calc(100% - 36px), 790px);
  height: calc(100dvh - 36px);
  min-height: 300px;
  margin: 18px auto;
  background: #fffdfa;
  border: 1px solid var(--border);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 14px 48px #51432212;
}
.chat-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas: ". identity settings";
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 8px 20px 7px;
  background: #fcf8f0;
  border-bottom: 1px solid #eae4d8;
}
.chat-identity { grid-area: identity; display: grid; justify-items: center; gap: 2px; }
#settings-button {
  grid-area: settings;
  justify-self: end;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #643822;
  background: transparent;
  border: 0;
  border-radius: 50%;
  font-size: 27px;
  line-height: 1;
}
#settings-button:hover, .chat-header:has(:popover-open) #settings-button { background: #f0e5d5; }
#chat-settings {
  --settings-top: 104px;
  position: fixed;
  inset: var(--settings-top) max(12px, calc((100vw - 790px) / 2 + 20px)) auto auto;
  width: min(324px, calc(100vw - 24px));
  max-height: calc(100dvh - var(--settings-top) - 12px);
  overflow-y: auto;
  margin: 0;
  padding: 15px 16px;
  color: #172235;
  background: #fffdfa;
  border: 1px solid var(--border);
  border-radius: 15px;
  box-shadow: 0 12px 35px #3f2b1924;
}
#chat-settings h2 { font-size: 17px; }
#sms-settings { margin: 12px 0 2px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
#sms-settings h3 { font-size: 14px; }
#sms-settings p { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.45; }
#sms-settings-link { display: inline-flex; align-items: center; text-underline-offset: 3px; font-size: 14px; }
#chat-settings #sign-out { margin-top: 3px; font-size: 14px; }
.chat-avatar {
  display: grid;
  place-items: center;
  width: 47px;
  height: 47px;
  padding: 0;
  border: 0;
  overflow: hidden;
  border-radius: 50%;
  background: #f5e6cf;
}
.chat-avatar:disabled { opacity: 1; }
.chat-avatar img { display: block; object-fit: contain; border-radius: 50%; transform-origin: 50% 72%; }
.chat-header h1 { font-size: 15px; letter-spacing: -.025em; line-height: 1.25; }
@media (prefers-reduced-motion: reduce) {
  .chat-avatar img { transform: none !important; }
}
.thread { flex: 1; min-height: 0; overflow-y: auto; padding: 20px clamp(12px, 4vw, 29px); }
.thread-content, .messages { display: flex; flex-direction: column; gap: 9px; }
.thread-content { margin: 0 auto; max-width: 660px; }
.messages:empty { display: none; }
.older { align-self: center; margin-bottom: 10px; font-size: 13px; }
.message {
  max-width: min(88%, 530px);
  line-height: 1.48;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 10px 14px;
  border-radius: 17px 17px 17px 5px;
  background: #f1ede4;
  align-self: flex-start;
}
.message.inbound {
  background: #95391c;
  color: #fff;
  align-self: flex-end;
  border-radius: 17px 17px 5px 17px;
}
.message.inbound + .message:not(.inbound), .message:not(.inbound) + .message.inbound { margin-top: 6px; }
.message a { color: inherit; text-underline-offset: 3px; }
.thread-card {
  align-self: flex-start;
  width: min(92%, 405px);
  margin: 5px 0 4px;
  padding: 14px;
  border: 1px solid #e4d6c3;
  border-radius: 17px 17px 17px 5px;
  background: #fcf4e8;
}
.thread-card h2 { font-size: 16px; line-height: 1.25; }
.thread-card p { margin-top: 5px; color: #4d5758; font-size: 14px; line-height: 1.45; }
.intro-card-header { display: flex; align-items: center; gap: 10px; }
.intro-card-header div { min-width: 0; overflow-wrap: anywhere; }
.intro-mark {
  flex: 0 0 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #efdfc7;
  color: #7b3019;
  font-weight: 750;
  font-size: 19px;
}
.card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-top: 10px; }
.card-actions .primary { display: inline-flex; align-items: center; text-decoration: none; }
.card-actions .primary, .card-actions button { font-size: 14px; }
.alert-card { background: #fcf8ef; }
.alert-card .alert-notice { margin-top: 8px; font-size: 12px; }
.alert-notice a { color: inherit; text-underline-offset: 3px; }
.typing {
  align-self: flex-start;
  background: #f1ede4;
  padding: 11px 13px;
  border-radius: 16px 16px 16px 5px;
}
.typing-dots { display: flex; gap: 4px; }
.typing-dots i { width: 6px; height: 6px; border-radius: 50%; background: #877865; }
@media (prefers-reduced-motion: no-preference) {
  .typing-dots i { animation: typing-dot 1.25s infinite ease-in-out; }
  .typing-dots i:nth-child(2) { animation-delay: .14s; }
  .typing-dots i:nth-child(3) { animation-delay: .28s; }
}
@keyframes typing-dot {
  0%, 70%, 100% { opacity: .55; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-3px); }
}
.chat-input { padding: 10px clamp(12px, 4vw, 24px) 16px; }
.chat-input form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  border: 1px solid #ded8cb;
  background: #fff;
  border-radius: 26px;
  padding: 4px;
  max-width: 660px;
  margin: auto;
}
.chat-input form:focus-within { border-color: #ae492a; }
.chat-input textarea {
  border: 0;
  outline: none;
  border-radius: 22px;
  resize: none;
  field-sizing: content;
  min-height: 41px;
  max-height: 112px;
  padding: 10px 12px;
  line-height: 21px;
}
#send-message { min-height: 41px; width: 41px; flex-shrink: 0; padding: 0; border-radius: 50%; font-size: 23px; }
#chat-status { max-width: 660px; margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 720px) {
  .sign-in { max-width: 510px; grid-template-columns: 1fr; margin-top: 4px; gap: 12px; }
  .match-preview { padding: 20px; border-radius: 20px; }
  .match-preview h1 { max-width: 16ch; font-size: clamp(29px, 7vw, 38px); }
  .match-intro { margin: 9px 0 14px; font-size: 14px; line-height: 1.45; }
  .match-profile { padding: 8px; gap: 9px; border-radius: 11px; }
  .profile-photo { width: 46px; height: 46px; }
  .profile-interest { font-size: 12px; }
  .sign-in-panel { border-radius: 20px; }
}
@media (max-width: 560px) {
  .site-header { height: 58px; }
  main { padding: 0 10px 10px; }
  .chat { height: 100dvh; width: 100%; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
  .chat-header { padding-inline: 13px; }
  #chat-settings { --settings-top: 84px; right: 12px; }
  .thread { padding-top: 15px; }
  .chat-input { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}
