/* RoomieLove — mobile-first, warm sticker-book look.
   Designed to feel like a native app on a phone: bottom tab bar,
   big tap targets, safe-area padding. Works fine on desktop too. */

:root {
  --accent: #d3541e;
  --accent-deep: #b33c0e;
  --ink: #3d2314;
  --dim: #8a6a52;
  --bg: #fff7ec;
  --surface: #fffdf8;
  --line: #e8cdb2;
  --line-strong: #6e2408;
  --good: #2e7d4f;
  --radius: 16px;
  --tabbar-h: 62px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
h1 { font-size: 1.9rem; line-height: 1.15; margin: 0.4rem 0 0.8rem; }
h2 { font-size: 1.4rem; margin: 0 0 0.8rem; }
h3 { margin: 0.4rem 0; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 1rem;
  background: rgba(255, 247, 236, 0.96);
  border-bottom: 2px solid var(--line);
}
.brand { font-weight: 900; font-size: 1.35rem; letter-spacing: -0.02em; }
.brand span { color: var(--accent); }
.top-actions { display: flex; gap: 0.5rem; align-items: center; }
.greeting { color: var(--dim); font-weight: 600; font-size: 0.95rem; }

.btn {
  border: 2px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(84, 48, 16, 0.35);
}
.btn:active { transform: translateY(1px); box-shadow: 1px 1px 0 rgba(84,48,16,.35); }
.btn.primary {
  background: linear-gradient(to bottom, #e05a28, var(--accent-deep));
  color: #fff;
}
.btn.ghost { box-shadow: none; }
.btn.big { padding: 0.75rem 1.5rem; font-size: 1.05rem; }
.btn.block { width: 100%; }
.btn.danger { border-color: #a12622; color: #a12622; background: #fff5f4; box-shadow: none; }
.btn:disabled { opacity: 0.55; }
.linklike { background: none; border: none; color: var(--accent-deep); text-decoration: underline; cursor: pointer; padding: 0; }

main { max-width: 720px; margin: 0 auto; padding: 0 1rem 3rem; }
.app-main { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 1.5rem); }

.hero { padding: 2rem 0 1rem; text-align: left; }
.eyebrow {
  display: inline-block; font-weight: 800; color: var(--accent-deep);
  background: #ffe8d2; border: 2px solid var(--line-strong); border-radius: 999px;
  padding: 0.15rem 0.8rem; font-size: 0.85rem;
}
.lede { font-size: 1.12rem; }
.hero-cta { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 1rem 0; }
a.btn { text-decoration: none; display: inline-block; }
.promise-pills { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 1rem 0 0; }
.promise-pills li {
  background: var(--surface); border: 2px solid var(--line-strong); border-radius: 999px;
  padding: 0.3rem 0.9rem; font-weight: 700; box-shadow: 2px 2px 0 rgba(84,48,16,.3);
}

.band { padding: 1.8rem 0; border-top: 2px dashed var(--line); }
.band.alt { background: #ffefdc; margin: 0 -1rem; padding-left: 1rem; padding-right: 1rem; }
.steps li { margin-bottom: 0.7rem; }

.price-card, .card {
  background: var(--surface);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 rgba(84, 48, 16, 0.35);
  padding: 1.1rem;
  margin-bottom: 1rem;
}
.price-line { font-size: 1.05rem; margin: 0.4rem 0; }
.guarantee { background: #eafaf0; border: 2px solid var(--good); border-radius: 12px; padding: 0.6rem 0.8rem; }
.fineprint, .form-note, .note { color: var(--dim); font-size: 0.92rem; }
.form-error { color: #a12622; font-weight: 700; }

.card-form label, .field label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.8rem; }
.card-form input, .card-form select, .card-form textarea,
.field input, .field select, .field textarea {
  display: block; width: 100%; margin-top: 0.25rem;
  border: 2px solid var(--line-strong); border-radius: 12px;
  background: var(--surface); padding: 0.6rem 0.8rem; color: var(--ink);
}
.card-form { max-width: 520px; }
fieldset { border: 2px solid var(--line); border-radius: var(--radius); margin: 0 0 1rem; padding: 0.8rem 1rem; }
legend { font-weight: 800; padding: 0 0.4rem; }
.radio-row { display: block; padding: 0.45rem 0.5rem; border-radius: 10px; }
.radio-row:hover { background: #fff3e2; }
.radio-row input { margin-right: 0.5rem; }
.radio-row .desc { display: block; color: var(--dim); font-size: 0.9rem; margin-left: 1.6rem; }

.footer { text-align: center; color: var(--dim); padding: 2rem 1rem 3rem; font-size: 0.92rem; }

/* ---- App shell ---- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; background: var(--surface);
  border-top: 2px solid var(--line-strong);
}
.tabbar button {
  flex: 1; background: none; border: none; font-weight: 700; color: var(--dim);
  cursor: pointer; font-size: 0.95rem; position: relative;
}
.tabbar button.active { color: var(--accent-deep); }
.badge {
  background: var(--accent); color: #fff; border-radius: 999px;
  font-size: 0.75rem; padding: 0.05rem 0.45rem; vertical-align: super;
}

.status-banner {
  border: 2px solid var(--line-strong); border-radius: var(--radius);
  background: #ffe8d2; padding: 1rem; margin: 1rem 0;
}
.status-banner.good { background: #eafaf0; border-color: var(--good); }

/* ---- Profile cards: living situation leads, bigger than the name ---- */
.profile-card { overflow: hidden; padding: 0; }
.profile-card .photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #f3ddc4; }
.profile-card .body { padding: 1rem; }
.living-line { font-size: 1.45rem; font-weight: 900; line-height: 1.2; margin: 0 0 0.2rem; }
.living-detail { color: var(--dim); margin: 0 0 0.4rem; }
.person-name { font-size: 1.1rem; font-weight: 700; margin: 0; }
.person-meta { color: var(--dim); margin: 0.1rem 0 0.6rem; }
.compat {
  display: inline-block; font-weight: 800; color: var(--good);
  background: #eafaf0; border: 2px solid var(--good); border-radius: 999px;
  padding: 0.1rem 0.7rem; font-size: 0.9rem;
}
.reasons { margin: 0.5rem 0 0; padding-left: 1.1rem; color: var(--ink); }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.6rem 0; }
.tags span { background: #fff3e2; border: 1.5px solid var(--line-strong); border-radius: 999px; padding: 0.1rem 0.65rem; font-size: 0.85rem; font-weight: 600; }
.thumbs { display: flex; gap: 0.5rem; margin-top: 0.6rem; }
.thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 2px solid var(--line); }

.swipe-actions { display: flex; gap: 0.8rem; margin: 1rem 0; }
.swipe-actions .btn { flex: 1; padding: 0.9rem; font-size: 1.05rem; }

.deck-nav { display: flex; justify-content: space-between; align-items: center; margin: 0.8rem 0; }
.grid-list { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 560px) { .grid-list { grid-template-columns: 1fr 1fr; } }

/* ---- Matches & messages ---- */
.match-row {
  display: flex; gap: 0.8rem; align-items: center; width: 100%; text-align: left;
  background: var(--surface); border: 2px solid var(--line-strong); border-radius: var(--radius);
  padding: 0.7rem; margin-bottom: 0.7rem; cursor: pointer; box-shadow: 3px 3px 0 rgba(84,48,16,.3);
}
.match-row img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); }
.match-row .who { font-weight: 800; }
.match-row .last { color: var(--dim); font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
.unread-dot { background: var(--accent); color: #fff; border-radius: 999px; font-size: 0.75rem; padding: 0.05rem 0.5rem; font-weight: 800; }

.thread { display: flex; flex-direction: column; gap: 0.5rem; margin: 1rem 0; }
.msg { max-width: 82%; padding: 0.55rem 0.85rem; border-radius: 18px; border: 2px solid var(--line-strong); background: var(--surface); }
.msg.mine { align-self: flex-end; background: #ffe8d2; }
.msg .when { display: block; color: var(--dim); font-size: 0.75rem; margin-top: 0.2rem; }
.icebreakers { display: flex; flex-direction: column; gap: 0.5rem; margin: 1rem 0; }
.icebreakers .btn { text-align: left; box-shadow: none; border-radius: 14px; font-weight: 600; }
.composer { display: flex; gap: 0.5rem; position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 0.5rem); background: var(--bg); padding: 0.4rem 0; }
.composer input { flex: 1; border: 2px solid var(--line-strong); border-radius: 999px; padding: 0.6rem 1rem; background: var(--surface); }
.thread-tools { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.6rem 0; }
.meet-plan textarea {
  display: block; width: 100%; margin-top: 0.25rem;
  border: 2px solid var(--line-strong); border-radius: 12px;
  background: var(--surface); padding: 0.6rem 0.8rem; color: var(--ink);
}
.shared-ideas { background: #eafaf0; border: 2px solid var(--good); border-radius: 12px; padding: 0.8rem; margin-top: 1rem; }
.plan-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.7rem; }

.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
.photo-slot { border: 2px dashed var(--line-strong); border-radius: 12px; padding: 0.6rem; text-align: center; }
.photo-slot img { border-radius: 8px; margin: 0 auto 0.4rem; max-height: 160px; }

.counter-pill {
  display: inline-block; font-weight: 800; background: var(--surface);
  border: 2px solid var(--line-strong); border-radius: 999px; padding: 0.25rem 0.9rem;
  box-shadow: 2px 2px 0 rgba(84,48,16,.3);
}

.empty {
  text-align: center; padding: 2.2rem 1.2rem; border: 2px dashed var(--line-strong);
  border-radius: var(--radius); background: var(--surface); margin: 1rem 0;
}
.empty .big { font-size: 1.25rem; font-weight: 800; }

#toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px);
  background: var(--ink); color: #fff; padding: 0.6rem 1.1rem; border-radius: 999px;
  font-weight: 600; opacity: 0; pointer-events: none; transition: opacity 0.25s; z-index: 50;
  max-width: 92vw; text-align: center;
}
#toast.show { opacity: 1; }

dialog { border: 2px solid var(--line-strong); border-radius: var(--radius); max-width: min(520px, 92vw); }
dialog::backdrop { background: rgba(61, 35, 20, 0.45); }

@media (min-width: 760px) {
  h1 { font-size: 2.5rem; }
  main { padding: 0 1.5rem 3rem; }
  .band.alt { margin: 0 -1.5rem; padding-left: 1.5rem; padding-right: 1.5rem; }
}

/* Improvement round 1 (Oct 24, 2026) */
.hero-art { width: 100%; height: auto; display: block; border-radius: 18px; margin-top: 1.25rem; box-shadow: 0 12px 32px rgba(90, 30, 5, .25); }
.founding-badge { display: inline-block; background: #b33c0e; color: #fff; font-size: .78rem; font-weight: 700; letter-spacing: .02em; padding: .18rem .55rem; border-radius: 999px; }
.meter-card .meter { background: #f0e2d8; border-radius: 999px; height: 10px; overflow: hidden; margin: .5rem 0; }
.meter-card .meter span { display: block; height: 100%; background: #b33c0e; border-radius: 999px; }
.share-card { border: 2px dashed #b33c0e; background: #fff8f2; }

/* Improvement round 2 (Oct 24, 2026) */
.met-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.idea-group h3 { color: #b33c0e; }
.activity-card .counter-pill { background: #f0e2d8; color: #7a2a08; padding: .15rem .55rem; border-radius: 999px; font-size: .82rem; font-weight: 700; }

/* Front-page design round (Oct 24, 2026) — warm, visual, sticker-book */
.hero {
  background: linear-gradient(165deg, #ffe7c7 0%, #ffd3a3 48%, #f9bd8a 100%);
  margin: 0 -1rem; padding: 2rem 1rem 1.8rem;
  border-bottom: 2px solid var(--line-strong);
  border-radius: 0 0 28px 28px;
}
@media (min-width: 760px) { .hero { margin: 0 -1.5rem; padding-left: 1.5rem; padding-right: 1.5rem; } }
.hero .note { color: #6d4526; }
h2 { position: relative; }
.you-grid { display: grid; gap: 1rem; margin-top: 1rem; }
@media (min-width: 560px) { .you-grid { grid-template-columns: repeat(3, 1fr); } }
.you-card {
  background: var(--surface); border: 2px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: 4px 4px 0 rgba(84, 48, 16, 0.35); padding: 1.1rem; text-align: center;
}
.you-card p { margin: 0.3rem 0; }
.you-emoji { font-size: 2.2rem; line-height: 1; }
.you-title { font-weight: 900; font-size: 1.05rem; }
.you-close { text-align: center; font-size: 1.08rem; margin: 1.2rem 0 0.4rem; }
.who-head { text-align: center; margin-top: 1.4rem; }
.tiles { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin: 0.6rem 0; }
.tile {
  background: #ffe8d2; border: 2px solid var(--line-strong); border-radius: 999px;
  padding: 0.45rem 1.1rem; font-weight: 800; box-shadow: 2px 2px 0 rgba(84,48,16,.3);
}
.steps { list-style: none; padding: 0; display: grid; gap: 1rem; counter-reset: step; }
@media (min-width: 560px) { .steps { grid-template-columns: 1fr 1fr; } }
.steps li {
  counter-increment: step; position: relative; margin: 0;
  background: var(--surface); border: 2px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: 4px 4px 0 rgba(84, 48, 16, 0.35); padding: 1rem 1rem 1rem 3.6rem;
}
.steps li::before {
  content: counter(step); position: absolute; left: 1rem; top: 1rem;
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--line-strong);
}
.example-card { max-width: 520px; margin-left: auto; margin-right: auto; }
.example-tag {
  background: var(--accent-deep); color: #fff; font-weight: 900; letter-spacing: 0.08em;
  text-align: center; padding: 0.4rem; margin: 0; font-size: 0.85rem; text-transform: uppercase;
}
.example-photo {
  aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, #ffd9ae, #f2a56b); color: #7a3c14;
  font-weight: 900; font-size: 1.3rem; letter-spacing: 0.02em;
}
.faq-item {
  background: var(--surface); border: 2px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: 3px 3px 0 rgba(84, 48, 16, 0.3); padding: 0.9rem 1.1rem; margin-bottom: 0.8rem;
}
.faq-item summary { font-weight: 800; cursor: pointer; }
.faq-item p { margin: 0.6rem 0 0.2rem; }

/* Front-page design round 2 (Oct 24, 2026) — Fred: "add borders", richer frame */
.hero {
  margin: 1rem 0 0; padding: 2rem 1.2rem 1.8rem;
  border: 4px solid var(--line-strong); border-radius: 28px;
  box-shadow: 10px 10px 0 rgba(110, 36, 8, 0.28);
}
@media (min-width: 760px) { .hero { margin: 1rem 0 0; padding-left: 1.2rem; padding-right: 1.2rem; } }
.wavy { text-decoration: underline wavy var(--accent) 3px; text-underline-offset: 7px; }
.hero-art-wrap { position: relative; margin-top: 1.25rem; }
.hero-art-wrap .hero-art { margin-top: 0; border: 4px solid var(--line-strong); transform: rotate(-1.2deg); }
.sticker {
  position: absolute; top: -14px; right: 10px; transform: rotate(4deg);
  background: var(--accent-deep); color: #fff; font-weight: 900; font-size: 0.85rem;
  border: 3px solid var(--line-strong); border-radius: 999px; padding: 0.3rem 0.9rem;
  box-shadow: 3px 3px 0 rgba(84, 48, 16, 0.4);
}
.ticker {
  overflow: hidden; background: var(--accent-deep); color: #fff;
  border: 3px solid var(--line-strong); border-radius: 999px;
  margin: 1.1rem 0 0; transform: rotate(-1deg);
  box-shadow: 4px 4px 0 rgba(84, 48, 16, 0.3);
}
.ticker-track {
  display: flex; width: max-content; white-space: nowrap;
  font-weight: 900; letter-spacing: 0.04em; padding: 0.45rem 0;
  animation: ticker-move 26s linear infinite;
}
.ticker-track span { padding-right: 0.5rem; }
@keyframes ticker-move { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }
.band h2::after, .hero h1::after {
  content: ""; display: block; width: 64px; height: 6px; border-radius: 999px;
  background: var(--accent); border: 2px solid var(--line-strong); margin-top: 0.4rem;
}
.hero h1::after { margin-top: 0.6rem; }
.card, .price-card, .you-card, .steps li, .faq-item, .tile { border-width: 3px; }
.card, .price-card, .you-card, .steps li { box-shadow: 6px 6px 0 rgba(84, 48, 16, 0.35); }
.band.alt { border-top: 3px solid var(--line-strong); border-bottom: 3px solid var(--line-strong); }
.guarantee { outline: 2px dashed var(--good); outline-offset: -7px; }
.example-photo { border-bottom: 3px solid var(--line-strong); }
.example-tag { border-bottom: 3px solid var(--line-strong); }
.you-card { transform: rotate(-0.6deg); }
.you-card:nth-child(2) { transform: rotate(0.6deg); }
.you-card:nth-child(3) { transform: rotate(-0.4deg); }

/* Header fix (Oct 24, 2026) — solid top bar (no see-through ghosting while scrolling) + anchor offset */
.topbar { background: var(--bg); }
html { scroll-padding-top: 84px; }

/* Round 2 fix (Oct 24, 2026) — hero frame fully rounded on all corners */
.hero { border-radius: 28px; }
