/* Gustora — warm, appetizing, mobile-first. */

:root {
  --terracotta: #C2451E;
  --terracotta-dark: #9E3312;
  --terracotta-soft: #F6E3DB;
  --espresso: #2B1A12;
  --cream: #FAF6F0;
  --card: #FFFFFF;
  --herb: #3E7C4F;
  --herb-soft: #E4EFE7;
  --gold: #E8A33D;
  /* Secondary text. Chosen for 7:1 against the cream page and the white
   * cards, so descriptions stay easy to read for older eyes; do not
   * lighten it, and never set text in --line or a light grey. */
  --muted: #5E5148;
  --line: #EADFD4;
  --danger: #B3261E;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(43, 26, 18, 0.08), 0 4px 14px rgba(43, 26, 18, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--cream);
  color: var(--espresso);
  line-height: 1.5;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
a { color: var(--terracotta); text-decoration: none; }

/* ---------- App bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(250, 246, 240, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--espresso); font-weight: 700; font-size: 1.15rem; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
}
.brand-mark svg { display: block; }
.topnav { display: flex; gap: 4px; align-items: center; }
.topnav a {
  padding: 8px 14px; border-radius: 999px; color: var(--espresso); font-weight: 600; font-size: 0.95rem;
  position: relative;
}
.topnav a.active { background: var(--terracotta-soft); color: var(--terracotta-dark); }
.topnav a .badge { position: absolute; top: 0; right: 2px; }
@media (max-width: 719px) { .topnav { display: none; } }

/* ---------- Bottom tab bar (mobile) ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; justify-content: space-around;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 2px; min-height: 48px;
  color: var(--muted); font-size: 0.7rem; font-weight: 600;
  position: relative;
}
.tabbar a.active { color: var(--terracotta); }
.tabbar a .ticon { font-size: 1.35rem; line-height: 1.2; }
.tabbar a .badge { position: absolute; top: 2px; right: calc(50% - 22px); }
@media (min-width: 720px) { .tabbar { display: none !important; } }

.badge {
  background: var(--terracotta); color: #fff;
  border-radius: 999px; min-width: 18px; height: 18px; padding: 0 5px;
  font-size: 0.7rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- Layout ---------- */
.app { max-width: 1080px; margin: 0 auto; padding: 16px 16px 96px; }
@media (min-width: 720px) { .app { padding: 24px 24px 48px; } }

.page-title { font-size: 1.5rem; font-weight: 800; margin: 8px 0 4px; }
.page-sub { color: var(--muted); margin: 0 0 16px; }
.section-title { font-size: 1.05rem; font-weight: 800; margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }
.section-title .count { color: var(--muted); font-weight: 600; }

/* ---------- Landing ---------- */
.hero {
  text-align: center;
  padding: 40px 12px 28px;
}
.hero .logo-plate {
  width: 150px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 4px 14px rgba(43, 26, 18, 0.22));
}
.hero .logo-plate svg { width: 150px; height: auto; }

/* Signed-in start hub — compact enough to fit one phone screen. */
.hub { padding: 10px 8px 6px; }
.hub .logo-plate, .hub .logo-plate svg { width: 108px; }
.hub .logo-plate { margin-bottom: 8px; }
.hub h1 { font-size: 1.65rem !important; margin: 0 !important; }
.hub .tagline { font-size: 0.98rem; margin: 4px 0 14px !important; }
.hub .role-cards { gap: 10px; }
/* Four doors still have to fit one phone screen, so the hub pairs them up. */
.hub .role-cards.hub-grid { grid-template-columns: 1fr 1fr; }
@media (min-width: 720px) { .hub .role-cards.hub-grid { grid-template-columns: repeat(4, 1fr); } }
.hub .role-card { padding: 14px 8px; }
.hub .role-card p { line-height: 1.35; }
.hub .role-card { padding: 12px 10px; }
.hub .role-card .emoji { font-size: 1.8rem; margin-bottom: 3px; }
.hub .role-card h3 { font-size: 1rem; }
.hub .role-card p { font-size: 0.83rem; }
.hub .landing-login { margin-top: 14px !important; font-size: 0.92rem; }
.hero h1 { font-size: 2.2rem; margin: 0 0 6px; letter-spacing: -0.5px; }
.hero .tagline { font-size: 1.15rem; font-weight: 700; color: var(--terracotta-dark); margin: 0 0 10px; }
.hero p.lede { color: var(--muted); max-width: 560px; margin: 0 auto 24px; }
.hero p.lede { text-wrap: balance; }
.role-cards { display: grid; gap: 14px; grid-template-columns: 1fr; max-width: 680px; margin: 0 auto; }
@media (min-width: 600px) { .role-cards { grid-template-columns: 1fr 1fr; } }

/* Three doors in. Two classes so this beats the generic .role-cards rule
 * above regardless of source order. Below 880px the third card drops to its
 * own full-width row rather than being squeezed. */
.role-cards.trio { max-width: 1000px; scroll-margin: 16px 0; }
@media (min-width: 880px) { .role-cards.trio { grid-template-columns: repeat(3, 1fr); } }
/* The third heading wraps to two lines; reserve the space on all three so
 * the body copy starts on the same line across the row. */
@media (min-width: 880px) { .role-cards.trio .role-card h3 { min-height: 3em; } }

/* The six doors, stated before anyone is asked to pick one. */
.doorstrip {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 7px;
  max-width: 560px; margin: 0 auto 24px;
}
.doorstrip .door {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--terracotta-soft); color: var(--espresso);
  border-radius: 999px; padding: 5px 12px;
  font-size: 0.86rem; font-weight: 600; white-space: nowrap;
}
.doorstrip .door .i { font-size: 0.98rem; }
.role-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 18px; text-align: center; cursor: pointer;
  box-shadow: var(--shadow); transition: transform 0.12s ease;
}
.role-card:active { transform: scale(0.98); }
.role-card .emoji { font-size: 2.4rem; display: block; margin-bottom: 8px; }
.role-card h3 { margin: 0 0 4px; font-size: 1.15rem; }
.role-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }
/* The three boxes describe; they no longer choose. Flat and compact so they
 * read as information rather than as buttons that fail to respond. */
.role-cards.trio.info .role-card {
  display: flex; gap: 14px; align-items: flex-start; text-align: left;
  padding: 14px 16px; cursor: default; box-shadow: none; background: transparent;
}
.role-cards.trio.info .role-card:active { transform: none; }
.role-cards.trio.info .role-card .emoji { font-size: 1.9rem; line-height: 1.15; margin: 0; }
.role-cards.trio.info .role-card h3 { font-size: 1.02rem; min-height: 0; }
.join-cta { text-align: center; margin-top: 20px; scroll-margin: 24px 0; }
.join-cta .join-note { margin: 0 auto 10px; }
.join-cta .btn { min-width: 250px; }
/* Three ways in, one account: said right where the choice is made. */
.join-note { text-align: center; color: var(--muted); font-size: 0.9rem; max-width: 420px;
  margin: 16px auto 0; text-wrap: balance; }
.landing-login { text-align: center; margin-top: 22px; color: var(--muted); }

/* Spacers that only come alive in the phone layout below. */
.first-screen .sp { display: none; }

/* The landing page on a phone, tightened so "Set up your account now" and
 * "Login" share the first screen with everything above them. The top padding
 * gives way to the status bar when Gustora runs from the home screen, so the
 * logo never sits under the clock. */
@media (max-width: 600px) {
  .hero.landing { padding-top: 0; }
  .hero.landing .first-screen {
    padding-top: max(6px, calc(env(safe-area-inset-top) - 14px));
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
  .hero.landing .logo-plate { width: 116px; margin-bottom: 8px; }
  .hero.landing .logo-plate svg { width: 116px; }
  .hero.landing h1 { font-size: 2rem; margin-bottom: 2px; }
  .hero.landing .tagline { margin-bottom: 6px; }
  .hero.landing p.lede { margin-bottom: 12px; }
  .hero.landing .doorstrip { margin-bottom: 12px; gap: 6px; }
  .hero.landing .role-cards.trio.info { gap: 8px; }
  .hero.landing .role-cards.trio.info .role-card { padding: 9px 14px; gap: 10px; }
  .hero.landing .role-cards.trio.info .role-card .emoji { font-size: 1.6rem; }
  .hero.landing .role-cards.trio.info .role-card h3 { font-size: 0.95rem; letter-spacing: -0.2px; margin-bottom: 2px; }
  .hero.landing .role-cards.trio.info .role-card p { font-size: 0.86rem; line-height: 1.35; }
  .hero.landing .join-cta { margin-top: 12px; }
  .hero.landing .join-cta .join-note { margin-bottom: 6px; }
  .hero.landing .landing-login { margin-top: 10px; }
}

/* On a phone the first screen is exactly one screen: logo to Login, centred,
 * so the next section never shows as a sliver along the bottom edge. Where
 * the content is taller than the screen (Safari with its toolbars showing)
 * the minimum has no effect and the page simply flows from the top. */
@supports (min-height: 100svh) {
  @media (max-width: 600px) {
    .hero.landing .first-screen {
      box-sizing: border-box;
      min-height: calc(100svh - 16px);   /* less .app's own top padding */
      display: flex; flex-direction: column;
    }
    /* Whatever height is left over is shared out between the parts instead
     * of sitting in two empty bands above and below: a little above the
     * logo and below Login, more between the groups, and some into the
     * three boxes themselves. On a screen with nothing to spare every
     * share is zero and the layout is the compact one. */
    .hero.landing .first-screen .sp { display: block; flex: var(--g, 1) 0 0px; }
    /* The boxes take a share for themselves (a little taller each) and for
     * the two gaps between them. 4px + spacer + 4px keeps the resting gap at
     * the same 8px the grid uses when there is nothing to share. */
    .hero.landing .first-screen .role-cards.trio.info {
      flex: 4.5 0 auto; display: flex; flex-direction: column; gap: 4px;
    }
    .hero.landing .first-screen .role-cards.trio.info .role-card { flex: 1 0 auto; align-items: center; }

    /* The signed-in home screen gets the same treatment: logo to "My
     * activity" fills exactly the space between the app bar and the tab
     * bar, so "How Gustora works" starts below the tab bar instead of
     * being cut in half by it. 26px = .app's 16px + the hub's 10px on top. */
    .hero.hub .first-screen {
      box-sizing: border-box;
      min-height: calc(100svh - var(--chrome, 130px) - 26px);
      display: flex; flex-direction: column;
    }
    .hero.hub .first-screen .sp { display: block; flex: var(--g, 1) 0 0px; }
    .hero.hub .first-screen .role-cards.hub-grid { flex: 4.5 0 auto; width: 100%; }
    .hero.hub .first-screen .role-card { display: flex; flex-direction: column; justify-content: center; }
    /* When neighbors are asking for something, the first screen ends one
     * line early, so the "Neighbors asking and offering" bar closes it, whole, just
     * above the tab bar. 66px is the bar with its margins. */
    .hero.hub.has-asks .first-screen { min-height: calc(100svh - var(--chrome, 130px) - 26px - 66px); }
    /* ...unless it would not fit: then the first screen is a full screen again. */
    .hero.hub.has-asks.asks-below .first-screen { min-height: calc(100svh - var(--chrome, 130px) - 26px); }
  }
}
.landing-foot { text-align: center; color: var(--muted); font-size: 0.8rem; margin-top: 48px; }

.how-row { display: grid; gap: 12px; grid-template-columns: 1fr; max-width: 900px; margin: 34px auto 0; }
@media (min-width: 720px) { .how-row { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); } }
.how-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; gap: 12px; align-items: flex-start; text-align: left; }
.how-card .n.plain { background: var(--terracotta-soft); }
.how-card .n {
  flex: none; width: 32px; height: 32px; border-radius: 999px; background: var(--herb-soft); color: var(--herb);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.05rem;
}
.how-card b { display: block; }
.how-card span { color: var(--muted); font-size: 0.9rem; }

/* ---------- Cards, buttons, forms ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--terracotta); color: #fff; border: none; border-radius: 12px;
  padding: 12px 20px; font-weight: 700; font-size: 1rem; cursor: pointer;
  min-height: 46px;
}
.btn:hover { background: var(--terracotta-dark); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.secondary { background: var(--terracotta-soft); color: var(--terracotta-dark); }
.btn.ghost { background: transparent; color: var(--terracotta-dark); border: 1.5px solid var(--line); }
.btn.green { background: var(--herb); }
.btn.green:hover { background: #2F6640; }
.btn.danger { background: transparent; color: var(--danger); border: 1.5px solid #EAC6C3; }
.btn.small { padding: 7px 14px; min-height: 36px; font-size: 0.9rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.btn-row .spacer { flex: 1; }

.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 5px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 0.82rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px; border: 1.5px solid var(--line); border-radius: 10px;
  background: #fff; font-size: 1rem; min-height: 46px;
}
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--terracotta);
}
.field-error { color: var(--danger); font-size: 0.85rem; margin-top: 4px; }
.form-grid { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px;
  padding: 9px 16px; font-weight: 600; font-size: 0.92rem; cursor: pointer; min-height: 40px;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip.on { background: var(--terracotta); border-color: var(--terracotta); color: #fff; }
.chip.small { padding: 5px 11px; min-height: 30px; font-size: 0.82rem; }
.chip-note { color: var(--muted); font-size: 0.85rem; margin-top: 8px; }

/* wizard */
.wizard-progress { display: flex; gap: 6px; margin: 14px 0 20px; }
.wizard-progress span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.wizard-progress span.done { background: var(--terracotta); }
.wizard-step-label { font-weight: 800; color: var(--terracotta-dark); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- Chef cards (guest home) ---------- */
.searchbar { display: flex; gap: 10px; margin-bottom: 12px; }
.searchbar input { flex: 1; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; font-size: 1rem; background: #fff; }
.filter-chips { margin: 4px 0 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.filter-chips .chips { flex-wrap: nowrap; padding-bottom: 4px; }
@media (min-width: 720px) { .filter-chips .chips { flex-wrap: wrap; } }

.chef-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .chef-grid { grid-template-columns: 1fr 1fr; } }
.chef-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow); cursor: pointer;
}
.chef-card.away { opacity: 0.65; }
.chef-avatar {
  flex: none; width: 58px; height: 58px; border-radius: 16px;
  background: var(--terracotta-soft); font-size: 1.8rem;
  display: flex; align-items: center; justify-content: center;
}
.chef-card h3 { margin: 0; font-size: 1.05rem; }
.chef-card .byline { color: var(--muted); font-size: 0.87rem; margin: 1px 0 6px; }
.chef-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 0.85rem; color: var(--muted); }
.chef-meta .rating { color: var(--gold); font-weight: 700; }
.chef-meta .dist { color: #2F5A3C; font-weight: 700; }
.pill {
  display: inline-block; background: var(--cream); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 9px; font-size: 0.75rem; font-weight: 600; color: var(--muted);
}
.pill.away { background: #FCEFC7; border-color: #EED9A0; color: #6B5210; }
.pill.green { background: var(--herb-soft); border-color: #CBDFD2; color: #2F5A3C; }
.pill.match { background: #FCF3DD; border-color: #EED9A0; color: #6B5210; }

/* ---------- Neighborhood map ---------- */
.map-card { padding: 0; overflow: hidden; }
@media (min-width: 720px) { .map-card { max-width: 620px; } }
.map-card svg { display: block; width: 100%; height: auto; }
.map-pin { cursor: pointer; }
.map-caption { padding: 10px 14px; color: var(--muted); font-size: 0.85rem; border-top: 1px solid var(--line); }

/* ---------- Menu / dishes ---------- */
.dish-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.dish-row:last-child { border-bottom: none; }
.dish-emoji {
  flex: none; width: 52px; height: 52px; border-radius: 14px; background: var(--cream);
  display: flex; align-items: center; justify-content: center; font-size: 1.7rem;
}
.dish-img {
  flex: none; width: 52px; height: 52px; border-radius: 14px; object-fit: cover;
  background: var(--cream);
}
.dish-body { flex: 1; min-width: 0; }
.dish-body h4 { margin: 0; font-size: 1rem; display: flex; justify-content: space-between; gap: 10px; }
.dish-body .price { color: var(--terracotta-dark); white-space: nowrap; }
.dish-body .desc { color: var(--muted); font-size: 0.88rem; margin: 3px 0 6px; }
.dish-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.qty-stepper { display: flex; align-items: center; gap: 2px; flex: none; }
.qty-stepper button {
  width: 34px; height: 34px; border-radius: 10px; border: 1.5px solid var(--line);
  background: #fff; font-size: 1.1rem; font-weight: 700; cursor: pointer; color: var(--terracotta-dark);
}
.qty-stepper .q { min-width: 26px; text-align: center; font-weight: 700; }

.orderbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 25;
  max-width: 640px; margin: 0 auto;
}
@media (min-width: 720px) { .orderbar { bottom: 24px; } }
.orderbar .btn { width: 100%; box-shadow: 0 6px 20px rgba(194, 69, 30, 0.35); }

/* ---------- Orders / tracking ---------- */
.order-card { cursor: pointer; }
.order-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.order-head h4 { margin: 0; }
.order-items { color: var(--muted); font-size: 0.9rem; margin: 4px 0; }
.status-chip {
  display: inline-block; border-radius: 999px; padding: 3px 11px; font-size: 0.78rem; font-weight: 700;
  background: var(--cream); border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.status-chip.pending { background: #FCEFC7; border-color: #EED9A0; color: #6B5210; }
.status-chip.confirmed { background: #E2ECF9; border-color: #C4D8F2; color: #2C5A9E; }
.status-chip.preparing { background: var(--terracotta-soft); border-color: #ECC9BB; color: var(--terracotta-dark); }
.status-chip.ready { background: var(--herb-soft); border-color: #CBDFD2; color: #2F5A3C; }
.status-chip.completed, .status-chip.rated { background: var(--herb-soft); border-color: #CBDFD2; color: #2F5A3C; }
.status-chip.declined, .status-chip.cancelled { background: #F8E3E1; border-color: #EAC6C3; color: var(--danger); }

.stepper { list-style: none; margin: 16px 0; padding: 0; }
.stepper li { display: flex; gap: 14px; position: relative; padding-bottom: 26px; }
.stepper li:last-child { padding-bottom: 0; }
.stepper .dot {
  flex: none; width: 30px; height: 30px; border-radius: 999px; z-index: 1;
  background: #fff; border: 2px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 800; color: var(--muted);
}
.stepper li::before {
  content: ""; position: absolute; left: 14px; top: 30px; bottom: 0; width: 2px; background: var(--line);
}
.stepper li:last-child::before { display: none; }
.stepper li.done .dot { background: var(--herb); border-color: var(--herb); color: #fff; }
.stepper li.done::before { background: var(--herb); }
.stepper li.current .dot { border-color: var(--terracotta); color: var(--terracotta); }
.stepper b { display: block; }
.stepper .sub { color: var(--muted); font-size: 0.88rem; }

.stars { display: inline-flex; gap: 4px; font-size: 1.7rem; cursor: pointer; user-select: none; }
.stars .star { color: #D9CEC2; }
.stars .star.on { color: var(--gold); }
.stars.readonly { font-size: 1rem; cursor: default; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(43, 26, 18, 0.45);
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 600px) { .modal-backdrop { align-items: center; } }
.modal {
  background: var(--card); width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
  border-radius: 20px 20px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
}
@media (min-width: 600px) { .modal { border-radius: 20px; padding: 24px; } }
.modal h3 { margin: 0 0 14px; }

/* ---------- Toast ---------- */
.toast-root {
  position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 12px; right: 12px; z-index: 80;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
}
.toast {
  background: var(--espresso); color: #fff; border-radius: 12px; padding: 11px 18px;
  font-weight: 600; font-size: 0.98rem; line-height: 1.4; box-shadow: var(--shadow);
  max-width: 480px; animation: toast-in 0.25s ease;
  pointer-events: auto; cursor: pointer;   /* tap to put it away */
}
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- Misc ---------- */
.empty { text-align: center; color: var(--muted); padding: 34px 12px; }
.empty .big { font-size: 2.4rem; display: block; margin-bottom: 8px; }
.note {
  background: var(--herb-soft); border: 1px solid #CBDFD2; color: #2F5A3C;
  border-radius: 12px; padding: 12px 14px; font-size: 0.9rem; margin: 12px 0;
}
.note.amber { background: #FCF3DD; border-color: #EED9A0; color: #7A5F17; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 0.95rem; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); }
.total-row { display: flex; justify-content: space-between; font-weight: 800; font-size: 1.1rem; padding-top: 10px; }
.divider { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
.demo-login-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; margin-bottom: 8px; cursor: pointer; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch { position: relative; width: 52px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 2; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background 0.15s;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 999px;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: transform 0.15s;
}
.switch input:checked + .track { background: var(--herb); }
.switch input:checked + .track::after { transform: translateX(22px); }

/* Chef attestation checklist */
.attest-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 9px 0; border-bottom: 1px dashed var(--line);
  font-size: 0.92rem; cursor: pointer;
}
.attest-row:last-of-type { border-bottom: none; }
.attest-row input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--herb); }

/* Batch-cook progress toward the minimum that makes it worth cooking */
.batch-bar {
  height: 7px; border-radius: 4px; background: var(--line);
  overflow: hidden; margin-top: 8px;
}
.batch-bar span { display: block; height: 100%; border-radius: 4px; transition: width 0.3s ease; }

/* Member avatars */
.avatar {
  flex: none; border-radius: 999px; object-fit: cover; background: var(--terracotta-soft);
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
}
.avatar-initials { color: var(--terracotta-dark); font-weight: 800; }

/* Weekly digest */
.digest { border-left: 3px solid var(--gold); }
.digest-list { margin: 6px 0 0; padding-left: 18px; }
.digest-list li { margin: 5px 0; font-size: 0.92rem; color: var(--espresso); }

/* A button that reads as a link. Real buttons, not bare <a> tags: iOS
   Safari won't reliably deliver bubbled clicks from an anchor with no
   href, and such an anchor is invisible to keyboards and screen readers. */
.linkbtn {
  background: none; border: none; padding: 0; margin: 0;
  font: inherit; color: var(--terracotta); font-weight: 700;
  cursor: pointer; text-align: inherit;
  -webkit-tap-highlight-color: rgba(194, 69, 30, 0.15);
}
.linkbtn:hover { color: var(--terracotta-dark); text-decoration: underline; }
.linkbtn:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 2px; border-radius: 4px; }
/* Comfortable tap target without disturbing the surrounding text flow. */
.landing-foot .linkbtn, .landing-login .linkbtn { padding: 6px 2px; }

/* Taking someone off a guest list: quiet until you look for it, and a
 * comfortable tap target on a phone. */
.guest-x {
  appearance: none; background: none; border: 0; cursor: pointer;
  color: var(--muted); font-size: 0.92rem; line-height: 1;
  padding: 6px 8px; margin-left: 4px; border-radius: 8px;
}
.guest-x:hover, .guest-x:focus-visible { color: var(--danger); background: var(--terracotta-soft); }

/* Hints inside empty fields: iOS draws these very pale by default. Dark
 * enough to read (5.3:1), still clearly lighter than something typed in. */
input::placeholder, textarea::placeholder { color: #766960; opacity: 1; }

/* Shorter phones: the top bar already carries the logo and the name, so the
 * signed-in home screen drops its own copy and gives the room to the six
 * doors. Decided by height on purpose: a tall phone (Pro Max, Plus) keeps
 * the logo; on anything shorter it cannot fit above the tab bar. */
@media (max-width: 600px) and (max-height: 900px) {
  .hero.hub .logo-plate, .hero.hub h1, .hero.hub .byline { display: none; }
  .hero.hub .tagline { margin-top: 2px !important; }
  /* Room for the "Neighbors asking and offering" bar on the first screen. */
  .hero.hub.has-asks .role-card { padding: 9px 10px; }
}
/* The shortest screens (iPhone SE and similar): trim padding, never type. */
@media (max-width: 600px) and (max-height: 700px) {
  .hero.hub .role-cards.hub-grid { gap: 8px; }
  .hero.hub .role-card { padding: 8px; }
  .hero.hub .role-card .emoji { font-size: 1.5rem; margin-bottom: 1px; }
  .hero.hub .tagline { margin-bottom: 8px !important; }
  .hero.hub .landing-login { margin-top: 8px !important; }
}

/* ---------- Add to home screen ---------- */
.install-pill {
  appearance: none; border: 0; cursor: pointer; font: inherit; white-space: nowrap;
  background: var(--terracotta); color: #fff; font-weight: 700; font-size: 0.9rem;
  padding: 8px 14px; min-height: 36px; border-radius: 999px;
}
.install-pill[hidden] { display: none; }
.install-lead { margin: 6px 0 10px; font-size: 1rem; line-height: 1.45; }
.install-steps { list-style: none; margin: 4px 0 14px; padding: 0; counter-reset: step; }
.install-steps li {
  display: flex; gap: 12px; align-items: center; padding: 12px 0;
  border-bottom: 1px dashed var(--line); font-size: 1.02rem; line-height: 1.4;
}
.install-steps li:last-child { border-bottom: 0; }
.install-steps li::before {
  counter-increment: step; content: counter(step);
  flex: none; width: 32px; height: 32px; border-radius: 999px;
  background: var(--terracotta); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
/* The pictured buttons use iOS's own blue so they match what is on screen. */
.install-steps .ico {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  width: 32px; height: 32px; margin: 0 2px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: #007AFF;
}
/* A second, quieter line under a step, for the "if your phone looks
 * different" case. Still dark enough to read. */
.install-steps .aside { display: block; margin-top: 4px; font-size: 0.93rem; color: var(--muted); }
.install-steps .aside .ico { width: 26px; height: 26px; }
.install-steps .aside .ico svg { width: 18px; height: 18px; }
.install-quiet { text-align: center; margin: 12px 0 0; font-size: 0.92rem; }

/* ---------- Activity: finished items and taking them off the list ---------- */
.act-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 24px; }
.act-head .section-title { margin: 0; }
.act-item .card { margin-bottom: 0; }
.act-foot { text-align: right; margin: 0 2px 12px; }
.act-remove {
  appearance: none; background: none; border: 0; cursor: pointer; font: inherit;
  font-size: 0.92rem; font-weight: 600; color: var(--muted);
  padding: 8px 10px; min-height: 38px; border-radius: 8px;
}
.act-remove:hover, .act-remove:focus-visible { color: var(--danger); background: var(--terracotta-soft); }
/* Removed items are marked by their outline, not by fading: faded text is
 * exactly what older eyes struggle with. */
.act-item.removed .card { border-style: dashed; box-shadow: none; }
.act-removed-toggle { text-align: center; margin: 24px 0 12px; }

/* While the "Neighbors asking and offering" bar is showing, the phone home screen
 * gives up a little height so the bar fits whole above the tab bar even on
 * the tall phones that keep the logo: a smaller logo, tighter margins, and
 * the "part of ANIVA AI" line (still in the footer) steps aside. Door text
 * is untouched. */
@media (max-width: 600px) {
  .hero.hub.has-asks .logo-plate, .hero.hub.has-asks .logo-plate svg { width: 88px; }
  .hero.hub.has-asks .logo-plate { margin-bottom: 4px; }
  .hero.hub.has-asks .byline { display: none; }
  .hero.hub.has-asks .tagline { margin-bottom: 8px !important; }
  .hero.hub.has-asks .role-card { padding: 9px 10px; }
  .hero.hub.has-asks .landing-login { margin-top: 8px !important; }
}

/* ---------- Home: how many neighbors are asking or offering ---------- */
.asks { max-width: 760px; margin: 0 auto; text-align: left; }
.asks-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--terracotta-soft); color: var(--espresso);
  font-weight: 700; font-size: 1rem; padding: 0 14px; height: 48px; border-radius: 12px;
  margin: 8px 0 10px;
}
.asks-head .count {
  background: var(--terracotta); color: #fff; border-radius: 999px;
  min-width: 28px; padding: 3px 9px; font-size: 0.9rem; text-align: center;
}

/* ---------- "It's on": an agreed ride or favor, said plainly at the top ---------- */
.confirm-card { border: 2px solid var(--herb); background: var(--herb-soft); }
.confirm-card b { display: block; font-size: 1.08rem; color: #234A30; }
.confirm-card p { margin: 6px 0 12px; color: var(--espresso); }
.confirm-card .confirm-note { margin: 0; color: var(--muted); }
.confirm-card .btn { width: 100%; }
.confirm-card .cal-alt, .cal-alt { margin: 10px 0 0; text-align: center; font-size: 0.94rem; }
.cal-alt a { color: var(--terracotta-dark); font-weight: 600; text-decoration: underline; }
.confirm-card .confirm-second { margin-top: 10px; }

/* "Ask again" beside a guest's reply: plain text, but a full-size tap target. */
.guest-again {
  appearance: none; background: none; border: 0; cursor: pointer; font: inherit;
  color: var(--terracotta-dark); font-weight: 600; font-size: 0.88rem;
  padding: 6px 8px; margin-left: 6px; min-height: 34px; border-radius: 8px;
}
.guest-again:hover, .guest-again:focus-visible { background: var(--terracotta-soft); }
