:root {
  --bg: #fbf7f1;
  --surface: rgba(241, 233, 221, 0.85);
  --surface-strong: #f1e9dd;
  --line: #e1d6c6;
  --text: #4c443d;
  --text-strong: #201b17;
  --muted: #8b7e71;
  --apricot: #c46a3c;
  --apricot-soft: rgba(196, 106, 60, 0.12);
  --moss: #6f7c6b;
  --moss-soft: rgba(111, 124, 107, 0.12);
  --charcoal: #23313a;
  --gray-soft: rgba(76, 68, 61, 0.06);
  --shadow: 0 24px 70px rgba(35, 49, 58, 0.08);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Instrument Sans", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(196, 106, 60, 0.12), transparent 26rem),
    radial-gradient(circle at top right, rgba(111, 124, 107, 0.12), transparent 32rem),
    var(--bg);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.hero {
  padding: 24px 0 36px;
  max-width: 760px;
}

.eyebrow,
.section-label {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--apricot);
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.5rem, 7vw, 4rem);
  line-height: 0.95;
  color: var(--text-strong);
}

.hero-copy {
  max-width: 600px;
  margin: 18px 0 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
}

.layout {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}

.layout.single-panel {
  grid-template-columns: 1fr;
}

.panel {
  background: rgba(251, 247, 241, 0.78);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(225, 214, 198, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
}

.panel-head h2,
.block-head h3 {
  margin: 0;
  color: var(--text-strong);
}

.panel-head h2 {
  font-size: 28px;
  line-height: 1.15;
}

.session-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.stack {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 10px;
}

.field-label {
  font-size: 14px;
  line-height: 18px;
  font-weight: 700;
  color: var(--text-strong);
}

.field-help {
  margin: -4px 0 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  position: relative;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip span,
.segmented label,
.role-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  min-height: 42px;
  padding: 0 16px;
  color: var(--text);
  transition: 180ms ease;
}

.chip input:checked + span,
.segmented input:checked + span,
.role-pill.is-active {
  border-color: rgba(196, 106, 60, 0.45);
  background: var(--apricot-soft);
  color: var(--text-strong);
}

.segmented label span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.segmented label {
  cursor: pointer;
  padding: 0;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented label span,
.segmented label {
  padding: 0 16px;
}

.button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  min-height: 46px;
  padding: 0 18px;
  font-weight: 700;
  cursor: pointer;
}

.button-primary {
  background: var(--apricot);
  color: #fff9f4;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  color: var(--charcoal);
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.range-row {
  display: grid;
  gap: 12px;
}

.range-row output {
  font-size: 14px;
  line-height: 20px;
  color: var(--text-strong);
  font-weight: 700;
}

.range-row input[type="range"] {
  width: 100%;
  accent-color: var(--apricot);
}

.divider {
  margin: 26px 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--line), transparent);
}

.status-banner,
.compatibility-summary {
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.status-banner.is-warm {
  background: var(--apricot-soft);
  border-color: rgba(196, 106, 60, 0.25);
}

.status-banner.is-cool {
  background: var(--moss-soft);
  border-color: rgba(111, 124, 107, 0.24);
}

.muted {
  color: var(--muted);
}

.meta-grid {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.meta-card {
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--gray-soft);
  border: 1px solid var(--line);
}

.meta-card strong {
  display: block;
  margin-top: 6px;
  color: var(--text-strong);
  font-size: 18px;
}

.role-card {
  margin-top: 18px;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(196, 106, 60, 0.25);
  background: linear-gradient(180deg, rgba(196, 106, 60, 0.1), rgba(255, 255, 255, 0.72));
}

.role-card h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 24px;
  line-height: 1.1;
}

.role-card p:last-child {
  margin: 8px 0 0;
}

.invite-card,
.section-block {
  margin-top: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
  padding: 18px;
}

.invite-card.hidden {
  display: none;
}

.invite-link,
.text-input {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-strong);
  padding: 12px 14px;
}

.invite-link {
  min-height: 92px;
  resize: vertical;
}

.block-head {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.role-picker {
  display: flex;
  gap: 8px;
}

.role-pill {
  cursor: pointer;
}

.pair-stage {
  display: grid;
  gap: 14px;
}

.pair-stage.empty {
  min-height: 120px;
  place-items: center;
  text-align: center;
  color: var(--muted);
  background: var(--gray-soft);
  border-radius: var(--radius-md);
  border: 1px dashed var(--line);
}

.pair-grid {
  display: grid;
  gap: 14px;
}

.name-card {
  padding: 22px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(241, 233, 221, 0.8)),
    var(--surface-strong);
}

.name-card h4 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2rem, 8vw, 2.8rem);
  line-height: 0.95;
  color: var(--text-strong);
}

.name-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.name-card button {
  margin-top: 18px;
  width: 100%;
}

.bucket-grid {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.bucket {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  padding: 16px;
  background: rgba(255, 255, 255, 0.76);
}

.bucket.overlap {
  background: rgba(196, 106, 60, 0.08);
}

.bucket.one-sided {
  background: rgba(111, 124, 107, 0.08);
}

.bucket.both-disagree {
  background: rgba(76, 68, 61, 0.05);
}

.bucket.insufficient {
  background: rgba(35, 49, 58, 0.05);
}

.bucket-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 12px;
}

.bucket-head h4 {
  margin: 0;
}

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

.bucket-item {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(225, 214, 198, 0.88);
}

.bucket-item-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.bucket-item strong {
  color: var(--text-strong);
}

.bucket-item small {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

@media (min-width: 960px) {
  .layout {
    grid-template-columns: 400px minmax(0, 1fr);
    align-items: start;
  }

  .layout.single-panel {
    grid-template-columns: minmax(0, 820px);
    justify-content: center;
  }

  .panel {
    padding: 28px;
  }

  .pair-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
