:root {
  color-scheme: light;
  --background: #f7f2ea;
  --surface: #fffdf9;
  --surface-strong: #ffffff;
  --text: #26211d;
  --muted: #70675f;
  --line: #ded1c4;
  --rose: #c3435d;
  --rose-dark: #8d2f45;
  --teal: #16756f;
  --green: #16845b;
  --gold: #d49a2d;
  --shadow: 0 24px 60px rgba(52, 38, 27, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  height: 100%;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(140deg, rgba(195, 67, 93, 0.14), transparent 34%),
    linear-gradient(230deg, rgba(22, 117, 111, 0.13), transparent 38%),
    var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.app-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.hero h1 {
  max-width: 720px;
  margin: 6px 0 8px;
  font-size: clamp(2.6rem, 6vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.intro {
  max-width: 660px;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.eyebrow {
  margin: 0;
  color: var(--rose-dark);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.person-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.78);
}

.hero-actions {
  display: grid;
  gap: 10px;
  min-width: min(100%, 260px);
}

.mobile-toolbar,
.mobile-settings,
.mobile-match-toast,
.drawer-overlay,
.drawer-close {
  display: none;
}

.person-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 850;
  text-decoration: none;
}

.reset-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--rose-dark);
  padding: 0 14px;
  font-weight: 850;
}

.person-switch a.active {
  background: var(--surface-strong);
  color: var(--rose-dark);
  box-shadow: 0 8px 20px rgba(52, 38, 27, 0.1);
}

.panel,
.match-banner {
  background: var(--surface-strong);
  border: 1px solid rgba(222, 209, 196, 0.92);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.match-banner {
  position: relative;
  overflow-y: auto;
  display: none;
  max-height: 520px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(195, 67, 93, 0.16), rgba(22, 117, 111, 0.12)),
    var(--surface-strong);
}

.match-banner.visible {
  display: block;
}

.match-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.match-heading h2 {
  margin: 6px 0 0;
  font-size: 1.4rem;
  line-height: 1;
}

.match-heading p:last-child {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

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

.empty-match-list {
  display: grid;
  min-height: 478px;
  align-content: center;
}

.empty-match-list h2 {
  margin: 8px 0;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.empty-match-list p:last-child {
  margin: 0;
  color: var(--muted);
}

.match-item {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-strong);
}

.match-item h3 {
  margin-top: 4px;
  font-size: 1rem;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.match-label {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.heart-score {
  display: inline-grid;
  place-items: center;
  min-width: 54px;
  min-height: 40px;
  border-radius: 8px;
  color: white;
  font-size: 1rem;
  font-weight: 950;
  white-space: nowrap;
}

.match-item.hearts-2 {
  border-color: rgba(195, 67, 93, 0.32);
  background: #fff6f8;
}

.match-item.hearts-2 .match-label {
  color: var(--rose-dark);
}

.match-item.hearts-2 .heart-score {
  background: #d75a71;
}

.match-item.hearts-3 {
  border-color: rgba(195, 67, 93, 0.42);
  background: #fff3f6;
}

.match-item.hearts-3 .match-label {
  color: var(--rose-dark);
}

.match-item.hearts-3 .heart-score {
  background: var(--rose);
}

.match-item.hearts-4 {
  border-color: rgba(212, 154, 45, 0.75);
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 220, 108, 0.5), transparent 25%),
    radial-gradient(circle at 82% 22%, rgba(195, 67, 93, 0.34), transparent 26%),
    linear-gradient(135deg, rgba(255, 245, 184, 0.9), rgba(255, 239, 246, 0.92) 45%, rgba(231, 250, 246, 0.88)),
    var(--surface-strong);
  box-shadow: 0 28px 80px rgba(195, 67, 93, 0.2);
}

.match-item.hearts-4::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  pointer-events: none;
}

.match-item.hearts-4 .match-label {
  color: #9c5b00;
}

.match-item.hearts-4 .heart-score {
  background: linear-gradient(135deg, var(--gold), var(--rose));
  box-shadow: 0 12px 26px rgba(195, 67, 93, 0.24);
}

.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.confetti span {
  position: absolute;
  top: -18px;
  width: 10px;
  height: 18px;
  border-radius: 3px;
  animation: fall 1.8s ease-in-out infinite;
}

.confetti span:nth-child(1) {
  left: 12%;
  background: var(--rose);
}

.confetti span:nth-child(2) {
  left: 30%;
  background: var(--gold);
  animation-delay: 0.22s;
}

.confetti span:nth-child(3) {
  left: 50%;
  background: var(--teal);
  animation-delay: 0.4s;
}

.confetti span:nth-child(4) {
  left: 68%;
  background: #f05f88;
  animation-delay: 0.12s;
}

.confetti span:nth-child(5) {
  left: 86%;
  background: #35a87f;
  animation-delay: 0.3s;
}

@keyframes fall {
  0% {
    opacity: 0;
    transform: translateY(0) rotate(0deg);
  }

  15% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateY(150px) rotate(240deg);
  }
}

.add-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.78fr) minmax(0, 1.5fr);
  gap: 20px;
  align-items: end;
  padding: 20px;
  margin-bottom: 20px;
}

h2,
h3 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

.muted {
  margin: 8px 0 0;
  color: var(--muted);
}

.activity-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 180px) minmax(120px, 150px);
  gap: 12px;
  align-items: end;
}

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

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
  padding: 0 13px;
}

select:disabled {
  color: var(--text);
  opacity: 1;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(22, 117, 111, 0.25);
  outline-offset: 2px;
}

.activity-form button {
  min-height: 46px;
  border-radius: 8px;
  background: var(--rose);
  color: white;
  padding: 0 18px;
  font-weight: 850;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(240px, 0.78fr) minmax(0, 1.3fr) minmax(280px, 0.86fr);
  gap: 20px;
  align-items: start;
}

.match-banner,
.swipe-panel,
.activity-list {
  min-height: 520px;
  padding: 20px;
}

.swipe-panel {
  display: grid;
}

.swipe-card,
.empty-state {
  display: grid;
  min-height: 478px;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.swipe-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.94), rgba(255, 250, 242, 0.92)),
    var(--surface-strong);
  padding: clamp(24px, 6vw, 58px);
}

.swipe-card::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px dashed rgba(195, 67, 93, 0.22);
  border-radius: 8px;
  pointer-events: none;
}

.swipe-card > * {
  position: relative;
}

.swipe-card h2,
.empty-state h2 {
  width: 100%;
  margin-top: 12px;
  font-size: clamp(2.3rem, 6vw, 5rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.swipe-actions {
  display: grid;
    grid-template-columns: repeat(3, 82px);
  margin-top: 36px;
}

.round-button {
  display: inline-grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  box-shadow: 0 16px 36px rgba(52, 38, 27, 0.14);
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
}

.round-button.strong {
  box-shadow: 0 16px 36px rgba(52, 38, 27, 0.2);
}

.round-button.light {
  opacity: 0.82;
}

.round-button.dislike {
  color: var(--rose);
}

.round-button.like {
  color: var(--green);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  background: rgba(212, 154, 45, 0.18);
  color: #735119;
  padding: 0 11px;
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

.list {
  display: grid;
  gap: 12px;
}

.activity-item {
  display: grid;
  gap: 13px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.activity-item.matched {
  border-color: rgba(22, 132, 91, 0.45);
  background: #f3fbf7;
}

.activity-item h3 {
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.activity-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-row span {
  border-radius: 999px;
  background: #eef6f4;
  color: var(--teal);
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 850;
}

.delete-button {
  justify-self: start;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff8f8;
  color: var(--rose-dark);
  padding: 0 12px;
  font-size: 0.86rem;
  font-weight: 850;
}

.empty {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 860px) {
  body.drawer-active {
    overflow: hidden;
  }

  .app-shell {
    width: min(100% - 22px, 1160px);
    padding: 12px 0 86px;
  }

  .hero {
    display: none;
  }

  .mobile-toolbar {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 80;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 8px;
    border: 1px solid rgba(222, 209, 196, 0.92);
    border-radius: 8px;
    background: var(--surface-strong);
    box-shadow: 0 18px 48px rgba(52, 38, 27, 0.18);
    backdrop-filter: none;
  }

  .mobile-toolbar button {
    position: relative;
    min-height: 42px;
    border-radius: 7px;
    background: var(--surface-strong);
    color: var(--rose-dark);
    font-size: 0.86rem;
    font-weight: 900;
  }

  .mobile-toolbar button.active {
    background: var(--rose);
    color: white;
  }

  .mobile-toolbar button.active::after {
    content: "";
    position: absolute;
    right: 12px;
    bottom: 6px;
    left: 12px;
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
  }

  .drawer-overlay {
    display: none;
  }

  .mobile-match-toast {
    position: fixed;
    top: 12px;
    right: 12px;
    left: 12px;
    z-index: 45;
    display: grid;
    gap: 4px;
    min-height: 86px;
    border: 1px solid rgba(195, 67, 93, 0.34);
    border-radius: 8px;
    background: #fff6f8;
    box-shadow: 0 20px 50px rgba(52, 38, 27, 0.2);
    padding: 14px 16px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-130%);
    transition: opacity 180ms ease, transform 220ms ease;
  }

  .mobile-match-toast.show {
    opacity: 1;
    transform: translateY(0);
  }

  .mobile-match-toast p,
  .mobile-match-toast span {
    margin: 0;
    color: var(--rose-dark);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
  }

  .mobile-match-toast strong {
    color: var(--text);
    font-size: 1.05rem;
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  .mobile-match-toast.hearts-3 {
    background: #fff3f6;
    border-color: rgba(195, 67, 93, 0.45);
  }

  .mobile-match-toast.hearts-4 {
    overflow: hidden;
    border-color: rgba(212, 154, 45, 0.75);
    background:
      radial-gradient(circle at 18% 18%, rgba(255, 220, 108, 0.5), transparent 25%),
      radial-gradient(circle at 82% 22%, rgba(195, 67, 93, 0.34), transparent 26%),
      linear-gradient(135deg, rgba(255, 245, 184, 0.94), rgba(255, 239, 246, 0.96) 48%, rgba(231, 250, 246, 0.9));
  }

  .mobile-match-toast.hearts-4 p,
  .mobile-match-toast.hearts-4 span {
    color: #9c5b00;
  }

  body.drawer-active .drawer-overlay {
    opacity: 0;
    pointer-events: none;
  }

  .drawer-close {
    display: none;
    align-items: center;
    justify-content: center;
    justify-self: end;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-strong);
    color: var(--rose-dark);
    padding: 0 14px;
    font-size: 0.82rem;
    font-weight: 900;
  }

  [data-drawer] {
    position: fixed;
    top: 0;
    bottom: 70px;
    left: 0;
    z-index: 60;
    display: block;
    width: 100vw;
    max-height: none;
    min-height: calc(100svh - 70px);
    overflow-y: auto;
    border: 0;
    border-radius: 0;
    transform: translateX(100%);
    transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  [data-drawer].drawer-before {
    transform: translateX(-100%);
  }

  [data-drawer].drawer-after {
    transform: translateX(100%);
  }

  [data-drawer].drawer-open {
    transform: translateX(0);
  }

  .mobile-settings {
    align-content: start;
    gap: 18px;
    padding: 18px 18px 28px;
  }

  .mobile-settings h2 {
    font-size: 1.45rem;
  }

  .add-panel {
    align-content: start;
    padding: 18px 18px 28px;
  }

  .match-banner {
    padding: 18px 18px 28px;
  }

  .activity-list {
    padding: 18px 18px 28px;
  }

  .hero,
  .add-panel,
  .workspace,
  .activity-form {
    grid-template-columns: 1fr;
  }

  .person-switch {
    width: 100%;
  }

  .hero-actions {
    width: 100%;
  }

  .match-heading {
    display: grid;
  }

  .match-heading p:last-child {
    max-width: none;
  }

  .swipe-panel,
  .activity-list {
    min-height: auto;
  }

  .workspace {
    display: block;
  }

  .swipe-panel {
    height: calc(100svh - 110px);
    padding: 0;
    border: 0;
    background: var(--surface-strong);
    box-shadow: none;
    overflow: hidden;
  }

  .swipe-card,
  .empty-state {
    height: 100%;
    min-height: auto;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: min(100% - 18px, 1160px);
    padding: 10px 0 84px;
  }

  .add-panel,
  .swipe-panel,
  .activity-list,
  .match-banner {
    padding: 16px;
  }

  .swipe-card,
  .empty-state {
    height: 100%;
    min-height: auto;
  }

  .swipe-card h2,
  .empty-state h2 {
    font-size: clamp(2.15rem, 12vw, 3.4rem);
  }

  .round-button {
    width: 66px;
    height: 66px;
    font-size: 1.55rem;
  }

  .swipe-actions {
    grid-template-columns: repeat(3, 66px);
    gap: 8px;
  }
}
