:root {
  color-scheme: light;
  --ink: #1f2524;
  --muted: #697470;
  --line: #d9dfdc;
  --surface: #f7f8f4;
  --panel: #ffffff;
  --sage: #5e7f73;
  --sage-dark: #365a4f;
  --coral: #d96c5f;
  --gold: #bd8a3d;
  --blue: #496f91;
  --shadow: 0 18px 60px rgba(31, 37, 36, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(94, 127, 115, 0.18), transparent 42%),
    linear-gradient(300deg, rgba(217, 108, 95, 0.12), transparent 45%),
    var(--surface);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.label,
.eyebrow {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.nav-tabs {
  display: grid;
  gap: 8px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.nav-tab span:first-child {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
}

.nav-tab.is-active {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 26px rgba(31, 37, 36, 0.08);
}

.market-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.market-panel strong {
  display: block;
  margin-top: 2px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3aa66d;
  box-shadow: 0 0 0 6px rgba(58, 166, 109, 0.14);
}

main {
  width: min(1220px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.topbar h1 {
  max-width: 760px;
  margin: 3px 0 0;
  font-size: clamp(1.75rem, 3vw, 3.2rem);
  line-height: 1;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0;
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 7px 12px 7px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  white-space: nowrap;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background:
    linear-gradient(rgba(31, 37, 36, 0), rgba(31, 37, 36, 0.2)),
    url("https://images.unsplash.com/photo-1517841905240-472988babdf9?auto=format&fit=crop&w=120&q=80") center/cover;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.discover-grid,
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
  gap: 22px;
  align-items: start;
}

.match-stage,
.queue-panel,
.editor-panel,
.phone-preview,
.review-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.match-stage {
  overflow: hidden;
}

.photo-stack {
  position: relative;
  min-height: 420px;
  background: #d6ded7;
}

.profile-photo {
  display: block;
  width: 100%;
  height: 520px;
  object-fit: cover;
}

.home-photo {
  position: absolute;
  right: 22px;
  bottom: 22px;
  width: min(42%, 320px);
  aspect-ratio: 4 / 3;
  border: 6px solid #fff;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
}

.match-copy {
  padding: 22px;
}

.match-title-row,
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.match-title-row p,
.bio,
.phone-content p,
.review-panel p {
  color: var(--muted);
}

.match-title-row p,
.bio {
  margin: 5px 0 0;
}

.verified-badge,
.panel-heading span,
.rule-card.is-complete strong {
  color: var(--sage-dark);
}

.verified-badge,
.panel-heading span {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(94, 127, 115, 0.14);
  font-size: 0.78rem;
  font-weight: 700;
}

.verified-badge.muted {
  background: rgba(189, 138, 61, 0.15);
  color: #7c5b27;
}

.home-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0 0;
}

.home-facts div,
.rule-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

dt {
  color: var(--muted);
  font-size: 0.75rem;
}

dd {
  margin: 5px 0 0;
  font-weight: 700;
}

.action-row {
  display: grid;
  grid-template-columns: 54px 1fr 54px;
  gap: 10px;
  padding: 0 22px 22px;
}

.icon-button,
.primary-action {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

.icon-button {
  background: #eef1ee;
  color: var(--ink);
  font-size: 1.35rem;
}

.primary-action {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 10px 24px rgba(217, 108, 95, 0.25);
}

.primary-action.full {
  width: 100%;
}

.queue-panel,
.editor-panel,
.phone-preview,
.review-panel {
  padding: 20px;
}

.panel-heading {
  margin-bottom: 18px;
}

.mini-card-list {
  display: grid;
  gap: 12px;
}

.mini-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.mini-card img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
}

.mini-card strong,
.mini-card span {
  display: block;
}

.mini-card span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.9rem;
}

.editor-panel {
  display: grid;
  gap: 15px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input,
select {
  height: 46px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  min-height: 108px;
  padding: 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 4px rgba(94, 127, 115, 0.14);
}

.toggle-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.toggle-line strong,
.toggle-line span {
  display: block;
}

.toggle-line span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.88rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 54px;
  height: 30px;
}

.switch input {
  opacity: 0;
  position: absolute;
  inset: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #c9d0cd;
  transition: 0.18s ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: 0.18s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.switch input:checked + span {
  background: var(--sage);
}

.switch input:checked + span::after {
  transform: translateX(24px);
}

.phone-preview {
  background:
    linear-gradient(rgba(31, 37, 36, 0.04), rgba(31, 37, 36, 0.02)),
    #fff;
}

.phone-frame {
  overflow: hidden;
  max-width: 390px;
  margin: 0 auto;
  border: 10px solid var(--ink);
  border-radius: 32px;
  background: #fff;
}

.phone-frame img {
  display: block;
  width: 100%;
  height: 430px;
  object-fit: cover;
}

.phone-content {
  padding: 18px;
}

.home-preview {
  display: grid;
  gap: 5px;
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(73, 111, 145, 0.12);
}

.home-preview.is-hidden {
  opacity: 0.46;
  filter: grayscale(0.7);
}

.check-list {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.check-list label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-weight: 600;
}

.check-list input {
  width: 18px;
  height: 18px;
}

.review-panel {
  position: sticky;
  top: 28px;
}

.verification-meter {
  width: 138px;
  height: 138px;
  margin-bottom: 22px;
  border-radius: 50%;
  background: conic-gradient(var(--gold) 0deg, #ecefeb 0deg);
  display: grid;
  place-items: center;
}

.verification-meter span {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: #fff;
  font-size: 1.6rem;
  font-weight: 900;
}

.rule-grid {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.rule-card {
  display: grid;
  gap: 4px;
}

.rule-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.rule-card.is-complete {
  border-color: rgba(94, 127, 115, 0.45);
  background: rgba(94, 127, 115, 0.1);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 44px));
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  opacity: 0;
  transform: translateY(12px);
  transition: 0.2s ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 14px;
    overflow-x: auto;
  }

  .nav-tabs {
    display: flex;
    min-width: max-content;
  }

  .market-panel {
    min-width: 150px;
  }

  .discover-grid,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .review-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  main {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar h1 {
    font-size: 2rem;
    line-height: 1.05;
  }

  .profile-photo {
    height: 420px;
  }

  .home-photo {
    width: calc(100% - 36px);
    right: 18px;
    bottom: 18px;
  }

  .home-facts {
    grid-template-columns: 1fr;
  }

  .match-title-row,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .action-row {
    grid-template-columns: 50px 1fr 50px;
  }
}
