:root {
  --canvas: #ffffff;
  --ink: #000000;
  --graphite: #404040;
  --ash: #8b8b94;
  --stage: #f4f4f4;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--stage);
  color: var(--ink);
  font-family: "Switzer", sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
}

button, input, textarea {
  border-radius: 0;
  font: inherit;
}

button { cursor: pointer; }

.app-shell {
  position: relative;
  width: min(100%, 390px);
  min-height: 900px;
  margin: max(0px, calc((100vh - 900px) / 2)) auto;
  overflow: hidden;
  background: var(--canvas);
}

.screen {
  position: relative;
  min-height: 900px;
  padding: 20px;
  background: var(--canvas);
}

.screen--chat { padding: 0; }
.screen--setup { padding-top: 30px; }

.topbar {
  display: flex;
  height: 40px;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.4px;
  line-height: 1;
}

.text-action {
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ash);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}

.primary,
.secondary {
  appearance: none;
  height: 56px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--canvas);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}

.secondary {
  border-color: var(--ash);
  background: var(--canvas);
  color: var(--graphite);
}

.media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.welcome-hero { margin-top: 20px; }
.welcome-hero__image { width: 350px; height: 420px; }
.welcome h1 {
  max-width: 342px;
  margin: 17px 0 12px;
  font-size: 44px;
  font-weight: 500;
  letter-spacing: -1.8px;
  line-height: 0.99;
}
.welcome p {
  max-width: 342px;
  margin: 0;
  color: var(--graphite);
  font-size: 16px;
  line-height: 1.5;
}
.welcome .primary { width: 350px; margin-top: 28px; }
.welcome__signin {
  width: 100%;
  margin-top: 14px;
  color: var(--ash);
  text-align: center;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
}

.setup-header {
  display: grid;
  grid-template-columns: 66px 1fr 66px;
  align-items: start;
}
.setup-header .text-action { text-align: left; }
.setup-header__title { text-align: center; line-height: 1.3; }
.step {
  color: var(--ash);
  text-align: right;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
}
.photo-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 15px;
  align-items: end;
  margin-top: 29px;
}
.profile-photo { width: 160px; height: 192px; }
.photo-copy { padding-bottom: 2px; }
.photo-copy p { margin: 0 0 4px; line-height: 1.4; }
.photo-picker { display: none; }
.form-stack { margin-top: 29px; }
.field { display: block; margin-top: 16px; }
.field:first-child { margin-top: 0; }
.field label {
  display: block;
  margin-bottom: 7px;
  color: var(--graphite);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
}
.field input,
.field textarea {
  display: block;
  width: 100%;
  border: 1px solid var(--ash);
  background: var(--canvas);
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
}
.field input { height: 52px; padding: 0 15px; }
.field textarea {
  height: 120px;
  padding: 18px 15px;
  resize: none;
  color: var(--graphite);
  line-height: 1.45;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.setup .primary { width: 100%; margin-top: 24px; }
.form-note {
  margin: 14px 0 0;
  color: var(--ash);
  text-align: center;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
}

.preferences h1,
.matches h1 {
  margin: 24px 0 0;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -1px;
  line-height: 1.06;
}
.preferences__intro {
  margin: 8px 0 0;
  color: var(--graphite);
  font-size: 16px;
  line-height: 1.45;
}
.preference-form { margin-top: 32px; }
.preference-label { margin: 0 0 12px; font-size: 16px; line-height: 1.3; }
.budget-row {
  display: grid;
  grid-template-columns: 1fr 32px 1fr;
  height: 52px;
  border: 1px solid var(--ash);
  align-items: center;
}
.budget-row input {
  min-width: 0;
  border: 0;
  outline-offset: -3px;
  padding: 0 15px;
  color: var(--ink);
  font-weight: 500;
}
.budget-row input:last-child { text-align: right; }
.budget-row span { color: var(--ash); text-align: center; }
.preference-group { margin-top: 30px; }
.date-input {
  width: 100%;
  height: 52px;
  border: 1px solid var(--ash);
  padding: 0 15px;
  color: var(--ink);
  background: var(--canvas);
}
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.choice {
  height: 50px;
  border: 1px solid var(--ash);
  background: var(--canvas);
  color: var(--graphite);
}
.choice.is-selected { border-color: var(--ink); background: var(--ink); color: var(--canvas); }
.preferences .primary { width: 100%; margin-top: 32px; }

.discover__profile { margin-top: 20px; }
.discover__image { width: 350px; height: 420px; }
.identity-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 13px;
}
.identity-row h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -1px;
  line-height: 1.1;
}
.identity-row span { color: var(--ash); font-size: 16px; }
.discover__bio {
  margin: 5px 0 0;
  color: var(--graphite);
  line-height: 1.5;
}
.facts {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  color: var(--graphite);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
}
.facts span:last-child { color: var(--ash); }
.discover__actions { display: grid; grid-template-columns: 137px 1fr; gap: 15px; margin-top: 27px; }

.bottom-nav {
  position: absolute;
  left: 20px;
  right: 20px;
  top: 798px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding-top: 13px;
  border-top: 1px solid var(--ash);
}
.bottom-nav button {
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ash);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
}
.bottom-nav button:first-child { text-align: left; }
.bottom-nav button:last-child { text-align: right; }
.bottom-nav button.is-active { color: var(--ink); }

.matches h1 { max-width: 300px; margin-top: 20px; }
.match-list { margin-top: 33px; }
.match {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 15px;
  min-height: 153px;
  padding: 10px 0 20px;
  border: 0;
  border-bottom: 1px solid var(--ash);
  background: var(--canvas);
  text-align: left;
}
.match:first-child { padding-top: 0; }
.match:last-child { border-bottom: 0; }
.match__image { width: 96px; height: 112px; }
.match__top { display: flex; align-items: baseline; justify-content: space-between; }
.match__name { font-size: 20px; line-height: 1.35; }
.match__time,
.match__shared { color: var(--ash); font-size: 12px; font-weight: 400; }
.match__message,
.match__shared { display: block; }
.match__message { margin: 4px 0 4px; color: var(--graphite); font-size: 16px; line-height: 1.45; }

.account__intro { display: grid; grid-template-columns: 128px 1fr; gap: 20px; align-items: end; margin-top: 20px; }
.account__photo { width: 128px; height: 160px; }
.account__identity { padding-bottom: 2px; }
.account__identity h1 { margin: 0; font-size: 32px; font-weight: 500; letter-spacing: -1px; line-height: 1.1; }
.account__identity p { margin: 5px 0 0; color: var(--ash); line-height: 1.3; }
.account__bio { margin: 18px 0 0; color: var(--graphite); line-height: 1.5; }
.settings { margin-top: 27px; border-top: 1px solid var(--ash); }
.setting-row {
  display: flex;
  width: 100%;
  height: 63px;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--ash);
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.setting-row span:last-child { color: var(--ash); }
.setting-row--signout { color: var(--graphite); }

.chat-header {
  display: grid;
  grid-template-columns: 64px 44px 1fr;
  gap: 0;
  height: 80px;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--ash);
}
.chat-header__photo { width: 44px; height: 44px; }
.chat-header__identity { padding-left: 12px; }
.chat-header__identity strong { display: block; font-size: 16px; line-height: 1.3; }
.chat-header__identity span { display: block; margin-top: 1px; color: var(--ash); font-size: 12px; font-weight: 400; line-height: 1.3; }
.messages { height: 686px; overflow-y: auto; padding: 32px 20px 20px; }
.message {
  width: fit-content;
  max-width: 276px;
  margin: 0 0 19px;
  padding: 15px;
  border: 1px solid var(--ash);
  background: var(--canvas);
  color: var(--graphite);
  font-size: 16px;
  line-height: 1.45;
}
.message--outgoing { margin-left: auto; border-color: var(--ink); background: var(--ink); color: var(--canvas); }
.composer {
  display: grid;
  grid-template-columns: 1fr 86px;
  gap: 15px;
  height: 134px;
  padding: 20px;
  border-top: 1px solid var(--ash);
}
.composer input {
  height: 56px;
  min-width: 0;
  border: 1px solid var(--ash);
  padding: 0 15px;
  color: var(--ink);
}
.composer input::placeholder { color: var(--ash); opacity: 1; }
.composer .primary { width: 86px; }

@media (max-width: 389px) {
  .app-shell { width: 100%; }
  .screen { padding-left: 16px; padding-right: 16px; }
  .welcome-hero__image,
  .discover__image,
  .welcome .primary { width: 100%; }
  .bottom-nav { left: 16px; right: 16px; }
}
