@font-face {
  font-family: Figtree;
  src: url("/fonts/figtree.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Fraunces;
  src: url("/fonts/fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Heebo;
  src: url("/fonts/heebo.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Frank Ruhl Libre";
  src: url("/fonts/frank-ruhl-libre.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f3eee4;
  --paper-deep: #e7ddcc;
  --ink: #1c1915;
  --muted: #3c342c;
  --teal: #1b4f4a;
  --teal-deep: #123833;
  --line: #e3d5c2;
  --card: #fffdf8;
  --terra: #9a3b28;
  --gold: #7a4e12;
  --rose: #8d2c2c;
  --shadow: 0 18px 50px rgba(60, 40, 20, 0.1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  max-width: 100%;
  /* A sideways drag must not scroll or shift the page. clip does not
     create a scroll container, so the fixed nav stays put. */
  overflow-x: clip;
  overscroll-behavior-x: none;
}
body {
  font-family: Figtree, Heebo, sans-serif;
  font-size: 17px;
  font-weight: 450;
  line-height: 1.45;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 50% -10%, #fff 0%, transparent 60%),
    linear-gradient(180deg, #f7f3ea 0%, var(--paper) 40%, #efe4d2 100%);
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, p { margin: 0; }
a { color: var(--teal-deep); }

.skip {
  position: absolute;
  inset-inline-start: 12px;
  top: -40px;
  background: var(--ink);
  color: white;
  padding: 8px 12px;
  z-index: 80;
}
.skip:focus { top: 8px; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.app { min-height: 100dvh; overflow-x: clip; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 8px;
  max-width: 1120px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  min-height: 48px;
}
.mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--teal);
  color: #f6f1e7;
  display: grid;
  place-items: center;
  font-family: "Frank Ruhl Libre", serif;
  font-size: 22px;
  font-weight: 700;
}
.word {
  font-family: Fraunces, "Frank Ruhl Libre", serif;
  font-weight: 560;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}
.top-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.install-chip {
  border: 0;
  background: transparent;
  color: var(--teal-deep);
  font-size: 0.82rem;
  font-weight: 650;
  min-height: 44px;
  padding: 0 8px;
  border-radius: 999px;
}
.langs { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--card); }
.langs button {
  border: 0;
  background: transparent;
  min-height: 40px;
  padding: 0 12px;
}
.langs button.on { background: var(--teal); color: white; }
.code-pill, .status {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  min-height: 40px;
  padding: 0 12px;
  letter-spacing: 0.08em;
  font-weight: 650;
}
.status { letter-spacing: 0; font-weight: 600; color: var(--muted); font-size: 0.85rem; }
.status.on { color: var(--teal); }
.status.on::before, .status.off::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 99px;
  margin-inline-end: 6px;
  background: var(--muted);
}
.status.on::before { background: #2f8f62; }

.layout { max-width: 1120px; margin: 0 auto; }
.main {
  padding: 12px 20px calc(112px + env(safe-area-inset-bottom));
  max-width: 560px;
}
.rail { display: none; }

.kicker {
  color: var(--terra);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin-bottom: 8px;
}
h1 {
  font-family: Fraunces, "Frank Ruhl Libre", serif;
  font-weight: 640;
  font-variation-settings: "opsz" 72, "SOFT" 20, "WONK" 0;
  font-size: clamp(2rem, 8vw, 3.1rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink);
}
[dir="rtl"] h1, [dir="rtl"] .word, [dir="rtl"] .name {
  font-family: "Frank Ruhl Libre", Fraunces, serif;
  letter-spacing: 0;
  font-weight: 700;
  /* Fraunces axes (opsz, SOFT, WONK) are not in this font. Setting them
     drops the weight axis and the Hebrew letters render as hairlines. */
  font-variation-settings: "wght" 700;
}
.lede { margin-top: 12px; color: var(--muted); font-size: 1.05rem; }
.steps {
  list-style: none;
  padding: 0;
  margin: 22px 0;
  display: grid;
  gap: 10px;
}
.steps li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 14px 14px 16px;
  display: grid;
  gap: 4px;
}
.steps strong { font-size: 1.02rem; }
.steps span, .hint { color: var(--muted); }
.hint { font-size: 0.95rem; margin: 6px 0; }

.stack { display: grid; gap: 10px; margin-top: 8px; }
.btn {
  min-height: 56px;
  border-radius: 16px;
  border: 1.5px solid transparent;
  padding: 0 16px;
  font-weight: 700;
  font-size: 1.05rem;
}
.btn:disabled { opacity: 0.45; }
.btn.primary { background: var(--teal); color: white; }
.btn.secondary { background: var(--card); border-color: var(--line); }
.btn.quiet { background: transparent; color: var(--teal-deep); min-height: 48px; }
.btn.danger { background: transparent; color: var(--rose); min-height: 48px; }
.btn.love { background: var(--teal); color: white; flex: 1.4; }
.btn.pass { background: var(--card); border-color: #cbbba6; flex: 1; }
.btn.save { background: #f6e7cb; color: var(--gold); border-color: #e2c48a; flex: 1; }
.btn.veto { background: var(--card); color: var(--rose); border-color: #e3b4b4; flex: 1; }
.btn.veto.armed { background: var(--rose); color: white; border-color: var(--rose); }
.textlink { min-height: 48px; display: inline-flex; align-items: center; }

.continues { display: grid; gap: 8px; margin-bottom: 16px; }
.continues h2 { font-size: 1rem; font-weight: 700; }
.continue {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 56px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 0 14px;
  text-align: start;
}
.continue .code { letter-spacing: 0.12em; color: var(--muted); }

.sheet, .prose { display: grid; gap: 12px; }
.home {
  display: grid;
  gap: 20px;
  padding-top: 28px;
}
.home h1 { max-width: 12em; }
.home .lede { max-width: 28rem; margin-top: 0; }
.home-actions { display: grid; gap: 12px; margin-top: 12px; }
.quiet-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: center;
}
.quiet-row button, .quiet-row a {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-height: 44px;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}
details.more { margin-top: 8px; }
details.more summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 650;
  color: var(--teal-deep);
}
details.more summary::-webkit-details-marker { color: var(--teal-deep); }
.back {
  justify-self: start;
  border: 0;
  background: transparent;
  color: var(--teal-deep);
  min-height: 48px;
  padding: 0;
  font-weight: 700;
}
.field { display: grid; gap: 6px; margin-top: 8px; }
.field label, legend, .stepper-label { font-weight: 700; }
input[type="text"] {
  min-height: 56px;
  border-radius: 16px;
  border: 1.5px solid #d9cbb8;
  background: var(--card);
  padding: 0 14px;
  width: 100%;
}
fieldset { border: 0; padding: 0; margin: 14px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.chip.on { background: #e7f0ee; color: var(--teal-deep); border-color: transparent; }
.check { font-weight: 800; }
.segment { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  position: relative;
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
}
.choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
}
.choice.on { background: #e7f0ee; color: var(--teal-deep); }
.stepper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}
.stepper { display: flex; align-items: center; gap: 8px; direction: ltr; }
.stepper button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 1.2rem;
}
.stepper-value { min-width: 1.6rem; text-align: center; font-weight: 750; font-size: 1.25rem; }
.error {
  background: #fdeceb;
  color: var(--rose);
  border-radius: 12px;
  padding: 10px 12px;
}
.code-hero {
  font-family: Figtree, sans-serif;
  font-weight: 750;
  font-size: clamp(2rem, 10vw, 3rem);
  letter-spacing: 0.18em;
  text-align: center;
  margin: 8px 0;
}
.invite, .coach { display: grid; gap: 10px; }
.coach-list { margin: 8px 0; padding-inline-start: 1.1rem; display: grid; gap: 8px; }

.card {
  position: relative;
  background: var(--card);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 28px 22px 18px;
  margin-top: 20px;
  animation: card-in 0.28s ease;
  touch-action: pan-y;
}
.card.is-dragging { will-change: transform; }
.name {
  font-family: Fraunces, "Frank Ruhl Libre", serif;
  font-weight: 650;
  font-variation-settings: "opsz" 144, "SOFT" 20, "WONK" 0;
  font-size: clamp(3.2rem, 14vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 4px 0 8px;
  color: var(--ink);
}
[dir="rtl"] .name {
  font-family: "Frank Ruhl Libre", Fraunces, serif;
  font-weight: 700;
  font-variation-settings: "wght" 700;
  letter-spacing: 0;
}
.alt { color: var(--muted); font-size: 1.15rem; margin-bottom: 6px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); margin: 8px 0; }
.meaning { font-size: 1.2rem; margin: 8px 0 4px; }
.why {
  border: 0;
  background: transparent;
  color: var(--teal-deep);
  min-height: 44px;
  padding: 0;
  font-weight: 700;
  text-align: start;
}
.why-body {
  background: #f6f1e7;
  border-radius: 14px;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}
.swipe { position: relative; touch-action: pan-y; }
.stamp {
  position: absolute;
  top: 0;
  opacity: 0;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 3px solid;
  border-radius: 10px;
  padding: 4px 8px;
  pointer-events: none;
  will-change: opacity;
}
.stamp.love { inset-inline-start: 0; color: var(--teal); }
.stamp.nope { inset-inline-end: 0; color: var(--rose); }
.swipe-hint, .left { color: var(--muted); font-size: 0.92rem; }
.budgets {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 4px;
  color: var(--muted);
  font-weight: 550;
  font-size: 0.88rem;
}
.actions { display: flex; gap: 10px; direction: ltr; margin-top: 14px; }
.actions.secondary { margin-top: 8px; }
.actions.secondary .btn { min-height: 46px; font-weight: 650; background: transparent; }
.invite-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.linkish {
  border: 0;
  background: transparent;
  color: var(--teal-deep);
  font-weight: 700;
  min-height: 44px;
  padding: 0;
  white-space: nowrap;
}
.card.leaving-like { transform: translate3d(110%, 0, 0) rotate(8deg); opacity: 0; transition: transform .18s ease, opacity .18s ease; }
.card.leaving-pass { transform: translate3d(-110%, 0, 0) rotate(-8deg); opacity: 0; transition: transform .18s ease, opacity .18s ease; }
.card.leaving-veto { transform: translate3d(0, 24px, 0) scale(0.98); opacity: 0; transition: transform .16s ease, opacity .16s ease; }
@keyframes card-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.listpage, .people, .empty { display: grid; gap: 10px; }
.listcard {
  background: var(--card);
  border-radius: 20px;
  padding: 16px;
  border: 1px solid var(--line);
}
.listcard h2 {
  font-family: Fraunces, "Frank Ruhl Libre", serif;
  font-size: 2rem;
  font-weight: 560;
  letter-spacing: -0.03em;
}
[dir="rtl"] .listcard h2 {
  font-family: "Frank Ruhl Libre", Fraunces, serif;
  letter-spacing: 0;
  font-weight: 700;
  font-variation-settings: "wght" 700;
}
.who { font-weight: 650; }
.members { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.members li {
  background: var(--card);
  border-radius: 16px;
  padding: 12px 14px;
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
}
.loading { padding: 24px 0; color: var(--muted); }

.nav {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 20;
}
.nav button {
  min-height: 64px;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-weight: 650;
  font-size: 0.78rem;
  line-height: 1.15;
  padding: 6px 2px;
  position: relative;
  text-wrap: balance;
}
.nav button.on { color: var(--teal-deep); }
.badge {
  position: absolute;
  top: 8px;
  inset-inline-end: 18%;
  background: var(--terra);
  color: white;
  border-radius: 99px;
  min-width: 1.2rem;
  height: 1.2rem;
  font-size: 0.75rem;
  display: grid;
  place-items: center;
  padding: 0 4px;
}

.toast {
  position: fixed;
  inset-inline: 16px;
  top: calc(72px + env(safe-area-inset-top));
  z-index: 50;
  background: var(--ink);
  color: white;
  border-radius: 14px;
  padding: 12px 14px;
  text-align: center;
  font-weight: 700;
}
.offline {
  background: #3d342c;
  color: white;
  margin: 0;
  padding: 8px 16px;
  text-align: center;
}
.banner {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  margin: 8px 0 14px;
  display: grid;
  gap: 8px;
}
.banner p { font-weight: 700; }
.banner-actions { display: flex; gap: 8px; }
.banner-actions .btn { flex: 1; min-height: 48px; }
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 21, 0.46);
  z-index: 60;
  display: grid;
  align-items: end;
  padding: 12px;
}
.install {
  background: var(--card);
  border-radius: 24px;
  padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
  width: min(100%, 480px);
  margin: 0 auto;
  display: grid;
  gap: 8px;
}
.sharemark { display: inline-flex; width: 28px; height: 28px; margin-inline-end: 8px; vertical-align: middle; color: var(--teal); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

@media (min-width: 960px) {
  .layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 280px;
    gap: 22px;
    align-items: start;
    padding: 8px 20px 40px;
  }
  .main { max-width: none; padding: 0 0 24px; }
  .nav {
    position: static;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--card);
    display: grid;
    grid-template-columns: 1fr;
    padding: 8px;
  }
  .nav button { min-height: 52px; flex-direction: row; justify-content: flex-start; padding-inline: 12px; border-radius: 12px; }
  .nav button.on { background: #e7f0ee; }
  .badge { position: static; margin-inline-start: 8px; }
  .rail {
    display: block;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 16px;
  }
  .rail h2 { font-size: 1.1rem; margin-bottom: 8px; }
  .rail-name { font-family: Fraunces, serif; font-size: 1.4rem; margin: 6px 0; }
  .banner { margin: 8px 0 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .card.leaving-like, .card.leaving-pass, .card.leaving-veto { animation: none; transition: none; }
}
