:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-soft: #eef4f8;
  --surface-warm: #fff7ed;
  --text: #18202a;
  --muted: #677282;
  --line: #dbe2ea;
  --blue: #1769e0;
  --blue-dark: #0f4da8;
  --green: #16835f;
  --amber: #b86b00;
  --red: #c2362b;
  --sky: #0b7fab;
  --shadow: 0 12px 30px rgba(24, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 64px;
  padding: 10px max(20px, calc((100vw - 1180px) / 2));
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand,
.user-chip,
nav button,
.back {
  border: 0;
  background: transparent;
  color: var(--text);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  text-align: left;
}

.brand span:last-child {
  display: grid;
  gap: 1px;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.brand-mark,
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: white;
  font-weight: 700;
  font-size: 13px;
}

nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

nav button,
.segmented button {
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--muted);
}

nav button.active,
.segmented button.active {
  background: var(--surface-soft);
  color: var(--text);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.user-chip small {
  color: var(--muted);
}

main {
  min-height: calc(100vh - 64px);
}

.eyebrow {
  color: #d7e6f8;
  font-weight: 600;
  margin: 0 0 14px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.home-hero {
  width: min(1180px, calc(100% - 40px));
  min-height: 560px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, .98fr);
  gap: 34px;
  align-items: center;
  padding: 54px 0 34px;
}

.hero-copy h1 {
  font-size: 50px;
  line-height: 1.05;
  margin-bottom: 18px;
  max-width: 680px;
}

.hero-copy p {
  font-size: 18px;
  line-height: 1.65;
  max-width: 650px;
}

.hero-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero-notes span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}

.hero-visual {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #cdd9e7;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .86), rgba(255, 255, 255, .96)),
    linear-gradient(135deg, #e7f0ff, #eef8f4 52%, #fff7ed);
  box-shadow: 0 24px 60px rgba(24, 32, 42, 0.16);
}

.visual-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-bottom: 6px;
  color: var(--muted);
}

.visual-bar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #c6d1de;
}

.visual-bar strong {
  margin-left: auto;
  font-size: 13px;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.match-preview,
.message-preview,
.visual-grid div {
  border: 1px solid rgba(210, 220, 231, .9);
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
}

.match-preview {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.match-preview p,
.message-preview span {
  margin: 3px 0 0;
  color: var(--muted);
}

.match-preview b {
  color: var(--green);
  font-size: 24px;
}

.visual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.visual-grid div {
  padding: 14px;
}

.visual-grid span {
  color: var(--muted);
  font-size: 13px;
}

.visual-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
}

.message-preview {
  padding: 16px;
  background: var(--surface-warm);
}

.message-preview p {
  margin-bottom: 4px;
  font-weight: 700;
}

.hero-actions,
.card-actions,
.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary,
.secondary {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 9px 15px;
  font-weight: 600;
}

.primary {
  background: var(--blue);
  color: white;
}

.primary:hover {
  background: var(--blue-dark);
}

.secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

.secondary.dark {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: white;
}

.wide {
  width: 100%;
}

.metric-strip,
.browse-kpis,
.section,
.page-head,
.toolbar,
.profile-grid,
.browse-layout,
.detail-layout,
.chat-shell,
.guidelines,
.profile-hero,
.profile-readiness,
.profile-form,
.list,
.admin-table,
.admin-insights,
.admin-search {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 28px 0 8px;
}

.metric-strip.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-strip div,
.browse-kpis div,
.panel,
.profile-card,
.step,
.external-card,
.conversation,
.admin-row,
.profile-hero,
.profile-readiness,
.profile-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-strip div {
  padding: 18px;
}

.browse-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 2px 0 12px;
}

.browse-kpis div {
  padding: 14px 16px;
  border-radius: 8px;
}

.metric-strip span,
.browse-kpis span,
.muted,
.page-head p,
.profile-card p,
.admin-row small,
.conversation small,
dt,
.footer,
.filter-panel p,
.profile-readiness p {
  color: var(--muted);
}

.metric-strip strong {
  display: block;
  font-size: 28px;
  line-height: 1.15;
  margin-top: 6px;
}

.browse-kpis strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.section {
  padding: 28px 0;
}

.split-band,
.dashboard-band {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 22px;
  align-items: center;
}

.dashboard-band {
  align-items: stretch;
}

.lead-panel {
  display: grid;
  align-content: center;
}

.status-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.status-list div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.status-list span {
  color: var(--muted);
  font-size: 13px;
}

.status-list strong {
  display: block;
  margin-top: 5px;
}

.eyebrow.dark {
  color: var(--sky);
}

.mini-dashboard {
  display: grid;
  gap: 12px;
  align-content: center;
}

.progress-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 12px;
  align-items: center;
}

.progress-row strong {
  font-size: 16px;
}

.progress-track {
  grid-column: 1 / -1;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf4;
}

.progress-track.compact {
  height: 7px;
}

.progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

.steps,
.two-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.step,
.external-card,
.panel {
  padding: 22px;
}

.step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #e7f0ff;
  color: var(--blue);
  font-weight: 700;
  margin-bottom: 16px;
}

.external-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  border-color: #c9d9ed;
}

.external-card span {
  color: var(--blue);
}

.footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 36px 20px 48px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 42px 0 16px;
}

.page-head h1,
.profile-hero h1 {
  font-size: 34px;
  line-height: 1.12;
  margin-bottom: 8px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0 22px;
}

.toolbar input,
.profile-form input,
.profile-form select,
.profile-form textarea,
.composer input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 9px 12px;
  color: var(--text);
}

.toolbar input {
  width: min(420px, 100%);
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #e9eef4;
  border-radius: 8px;
}

.segmented button {
  border: 0;
  background: transparent;
}

.segmented.wide {
  flex-wrap: wrap;
}

.segmented.vertical {
  width: 100%;
  display: grid;
}

.browse-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding-bottom: 42px;
}

.filter-panel {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.filter-panel h2,
.saved-box h3 {
  font-size: 18px;
  margin-bottom: 0;
}

.saved-box {
  display: grid;
  gap: 8px;
}

.saved-box button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
  text-align: left;
}

.saved-box button span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--text);
  color: white;
  font-weight: 700;
}

.browse-results {
  width: 100%;
  margin: 0;
  padding-bottom: 0;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding-bottom: 42px;
}

.profile-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  min-width: 0;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.profile-card:hover {
  transform: translateY(-2px);
  border-color: #c5d5e8;
  box-shadow: 0 18px 38px rgba(24, 32, 42, 0.12);
}

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.card-head div {
  flex: 1;
  min-width: 0;
}

.card-head h3 {
  margin-bottom: 3px;
  font-size: 20px;
}

.score {
  align-self: start;
  padding: 4px 8px;
  border-radius: 8px;
  background: #e7f6ee;
  color: var(--green);
  font-weight: 700;
}

.profile-avatar {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #e4f0fb;
  color: var(--blue-dark);
  font-weight: 700;
}

.profile-avatar.large {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  font-size: 24px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chips span {
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 14px;
}

.profile-card dl,
.detail-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.profile-card dl div,
.detail-list div {
  padding: 10px;
  border-radius: 8px;
  background: #f5f7fa;
}

dt {
  font-size: 13px;
}

dd {
  margin: 2px 0 0;
  font-weight: 600;
}

.bio {
  min-height: 48px;
  line-height: 1.45;
}

.reason-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reason-list span {
  padding: 4px 8px;
  border-radius: 8px;
  background: #eef8f4;
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
}

.reason-list.stacked {
  display: grid;
  margin: 16px 0;
}

.card-actions {
  margin-top: auto;
}

.card-actions button {
  flex: 1 1 120px;
}

.card-actions .icon-button {
  flex: 0 1 96px;
}

.icon-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
  padding: 9px 12px;
  font-weight: 600;
}

.icon-button.saved,
.secondary.saved {
  border-color: #b8d9c8;
  background: #e7f6ee;
  color: var(--green);
}

.detail-layout {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 18px;
  padding: 42px 0;
}

.detail-card {
  position: sticky;
  top: 86px;
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.compatibility {
  display: grid;
  gap: 6px;
  margin-top: 18px;
}

.compatibility strong {
  font-size: 28px;
}

.detail-main {
  display: grid;
  gap: 14px;
}

.back {
  padding: 0;
  margin-bottom: 18px;
  color: var(--blue);
}

.prewrap {
  white-space: pre-wrap;
  line-height: 1.6;
}

.list,
.admin-table {
  display: grid;
  gap: 10px;
  padding-bottom: 42px;
}

.conversation,
.admin-row {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  text-align: left;
}

.conversation {
  border: 1px solid var(--line);
}

.conversation span:nth-child(2) {
  display: grid;
  gap: 2px;
}

.conversation time,
.admin-row time {
  color: var(--muted);
  font-size: 14px;
}

.chat-shell {
  padding: 42px 0;
}

.chat-header,
.composer {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 14px 16px;
}

.chat-header {
  border-radius: 8px 8px 0 0;
}

.chat-header span {
  color: var(--muted);
}

.chat-body {
  min-height: 380px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #edf2f7;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 18px;
}

.bubble {
  max-width: 68%;
  padding: 11px 13px;
  border-radius: 8px;
  line-height: 1.45;
}

.bubble.theirs {
  background: var(--surface);
}

.bubble.mine {
  align-self: flex-end;
  background: var(--blue);
  color: white;
}

.composer {
  border-radius: 0 0 8px 8px;
}

.composer input {
  flex: 1;
}

.profile-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  margin-top: 42px;
}

.profile-readiness {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: 18px;
  align-items: center;
  padding: 18px 22px;
  margin-top: 14px;
}

.profile-readiness strong {
  display: block;
  font-size: 28px;
  margin: 4px 0 8px;
}

.profile-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 22px;
  margin-bottom: 42px;
}

.profile-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 600;
}

.profile-form label.full,
.form-actions {
  grid-column: 1 / -1;
}

.profile-form textarea {
  min-height: 100px;
  resize: vertical;
}

.admin-row {
  grid-template-columns: 1.4fr .7fr .6fr .6fr;
}

.admin-insights {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr);
  gap: 16px;
  padding-bottom: 42px;
}

.checklist {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checklist span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.checklist .done {
  background: var(--green);
}

.checklist .warn {
  background: var(--amber);
}

.admin-search {
  padding-bottom: 14px;
}

.admin-search input {
  width: min(420px, 100%);
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
}

.admin-row div {
  display: grid;
  gap: 3px;
}

.recovery-panel ul {
  margin-bottom: 0;
  line-height: 1.8;
}

code {
  padding: 2px 5px;
  border-radius: 6px;
  background: #edf2f7;
}

.guidelines {
  padding: 42px 0;
}

.guidelines article {
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
}

.guidelines article:last-child {
  border-bottom: 0;
}

.guidelines h1 {
  font-size: 34px;
  margin-bottom: 8px;
}

.guidelines h2 {
  font-size: 20px;
  margin-bottom: 10px;
}

.guidelines p {
  line-height: 1.65;
}

.empty {
  width: min(1120px, calc(100% - 40px));
  margin: 28px auto;
  padding: 34px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
}

.auth-layout {
  width: min(1120px, calc(100% - 40px));
  min-height: calc(100vh - 64px);
  margin: 0 auto;
  display: grid;
  align-items: center;
  padding: 48px 0;
}

.auth-layout.embedded {
  min-height: 420px;
}

.auth-panel {
  width: min(520px, 100%);
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-panel h1 {
  font-size: 34px;
  margin-bottom: 12px;
}

.auth-panel p {
  color: var(--muted);
  line-height: 1.6;
}

.auth-panel label {
  display: grid;
  gap: 7px;
  margin: 16px 0;
}

.auth-panel label span {
  font-weight: 700;
}

.auth-panel input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.oauth-login {
  display: grid;
  gap: 10px;
  margin: 20px 0 18px;
}

.oauth-button {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.oauth-button:hover {
  transform: translateY(-1px);
  border-color: #b8c4d6;
  box-shadow: 0 10px 24px rgba(34, 45, 62, 0.11);
}

.oauth-button.apple {
  color: #fff;
  background: #111827;
  border-color: #111827;
}

.provider-mark {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 800;
  background: #eef2f7;
  color: #1f2937;
}

.oauth-button.apple .provider-mark {
  color: #111827;
  background: #fff;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.notice {
  margin: 14px 0;
  padding: 12px;
  border-radius: 8px;
  background: #edf6ff;
  border: 1px solid #c8ddf5;
  color: var(--blue-dark);
}

@media (max-width: 860px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    padding: 10px 16px;
  }

  nav {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .user-chip {
    width: fit-content;
  }

  .home-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 34px;
  }

  .hero-copy h1 {
    font-size: 36px;
  }

  .metric-strip,
  .metric-strip.compact,
  .browse-kpis,
  .steps,
  .two-col,
  .profile-grid,
  .browse-layout,
  .detail-layout,
  .profile-form,
  .split-band,
  .dashboard-band,
  .status-list,
  .profile-readiness,
  .admin-insights {
    grid-template-columns: 1fr;
  }

  .page-head,
  .toolbar,
  .profile-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar input {
    width: 100%;
  }

  .detail-card {
    position: static;
  }

  .filter-panel {
    position: static;
  }

  .admin-row {
    grid-template-columns: 1fr;
  }

  .bubble {
    max-width: 88%;
  }
}
