@import url('tokens.css');

.otp-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 20px 0;
}
.otp-row input {
  width: 44px;
  height: 52px;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  border: 0;
}
.tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.check-list {
  display: grid;
  gap: 8px;
}
.check-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--surface);
  border-radius: 16px;
  min-height: 48px;
}
.role-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
}
.flash {
  background: var(--primary-soft);
  color: var(--primary);
  padding: 12px 16px;
  border-radius: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}
.flash-error {
  background: var(--danger-soft);
  color: var(--danger);
}
.grocery-cat {
  margin-top: 18px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.warn-card {
  background: var(--token-soft);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 16px;
}
.bottom-nav.nav-5 {
  grid-template-columns: repeat(5, 1fr);
}
.bottom-nav.nav-4 {
  grid-template-columns: repeat(4, 1fr);
}
.bottom-nav.nav-3 {
  grid-template-columns: repeat(3, 1fr);
}
.muted { color: var(--text-secondary); }
.stack { display: grid; gap: 12px; }

.thread-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.thread-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  min-height: 76px;
}
.avatar--beige { background: #f3eee6; }
.avatar--green { background: var(--primary-soft); color: var(--primary); }
.avatar--gold { background: var(--token-soft); color: #c48410; }
.meal-stack { display: grid; gap: 12px; }
.meal-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.meal-card__copy { flex: 1; min-width: 0; }
.meal-card__copy strong { display: block; font-size: 16px; }
.week-total {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.week-total__amount { color: var(--primary); font-weight: 700; }
.hero-image--empty {
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 42px;
}
.package-price { font-weight: 700; }
.meal-thumb {
  display: grid;
  place-items: center;
  color: var(--primary);
}

@media (min-width: 768px) {
  .app-frame, .bottom-nav { max-width: 480px; }
}

@media (min-width: 1024px) {
  body { background: #f3f1ec; }
  .app-shell { padding: 24px 16px 32px; }
  .app-shell--resident .app-frame {
    display: block;
    max-width: 430px;
    background: var(--app-bg);
    border-radius: 0;
    box-shadow: none;
    min-height: 100dvh;
    overflow: visible;
  }
  .page, .chat-page {
    max-width: 430px;
    width: 100%;
    margin: 0 auto;
  }
  .desktop-home { display: block; }
}

.meal-book-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
  align-items: stretch;
}
.meal-book-grid > * {
  min-width: 0;
}
.meal-book-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fff;
  border-radius: 20px;
  padding: 8px 8px 12px;
  text-align: left;
  color: inherit;
  border: 0;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(40, 60, 120, .06);
}
.meal-book-card img {
  display: block;
  width: 100%;
  height: 110px;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 14px;
  background: #eef2ff;
}
.meal-book-card strong {
  font-size: 14px;
  line-height: 1.25;
  padding: 0 4px;
}
.meal-book-card span { color: var(--text-secondary); font-size: 12px; padding: 0 4px; }
.meal-book-grid--sheet { max-height: 52vh; overflow: auto; }

.search-bar { margin: 8px 0 4px; }
.module-card { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 20px; }
.module-card h2 { margin: 0; font-size: 20px; }
.module-card__icon {
  width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center;
  background: #eef2ff; color: #5E81FF;
}
.module-card--purple .module-card__icon { background: #eee6ff; color: #6b5ce0; }
.module-card--peach .module-card__icon { background: #ffe6d6; color: #e07a3d; }
.module-card--gold .module-card__icon { background: #fff4d6; color: #c48410; }
.module-card--green .module-card__icon { background: #e4f7ea; color: #2f9e62; }
.toggle {
  min-width: 64px; height: 36px; border-radius: 999px; border: 0; font-weight: 800;
  background: #eceae4; color: #6b6b66;
}
.toggle.is-on { background: #111; color: #fff; }
.task-card, .conversation-card, .incident-card, .event-card, .week-item, .status-row, .more-link {
  display: flex; align-items: center; gap: 12px; padding: 16px 18px; text-decoration: none; color: inherit;
}
.task-badge { width: 10px; height: 10px; border-radius: 50%; background: #8b74e8; flex: none; }
.task-badge--high { background: #e08a4f; }
.task-badge--low { background: #9aa3b5; }
.conversation-meta { text-align: right; font-size: 12px; color: var(--text-secondary); display: grid; gap: 4px; justify-items: end; }
.badge-unread {
  min-width: 20px; height: 20px; border-radius: 999px; background: #111; color: #fff;
  font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 6px;
}
.home-mod-card { display: block; margin-top: 14px; padding: 18px; }
.home-mod-card h2 { margin: 4px 0 0; font-size: 20px; }
.home-mod-card--purple { background: #f4f0ff; }
.home-mod-card--blue { background: #eef3ff; }
.home-mod-card--gold { background: #fff6e4; }
.chat-thread { display: flex; flex-direction: column; min-height: 70vh; }
.chat-messages { flex: 1; display: grid; gap: 8px; padding: 8px 0 16px; overflow: auto; }
.chat-bubble {
  max-width: 82%; padding: 10px 14px; border-radius: 18px; background: #fff; box-shadow: 0 4px 16px rgba(40,60,120,.05);
}
.chat-bubble.is-mine { margin-left: auto; background: #111; color: #fff; }
.chat-bubble img { max-width: 100%; border-radius: 12px; }
.chat-reply { font-size: 12px; opacity: .75; border-left: 2px solid currentColor; padding-left: 8px; margin-bottom: 4px; }
.chat-time { display: block; font-size: 11px; opacity: .65; margin-top: 4px; }
.chat-composer { display: flex; gap: 8px; align-items: center; position: sticky; bottom: 72px; background: var(--background); padding: 8px 0; }
.chat-composer .input { flex: 1; }
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.status-option {
  display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 16px; background: #fff;
}
.incident-card--urgent { box-shadow: inset 3px 0 0 #e25b5b; }
.incident-card--high { box-shadow: inset 3px 0 0 #e08a4f; }
.week-item--purple { background: #f7f4ff; }
.week-item--blue { background: #f3f6ff; }
.week-item--gold { background: #fff8ea; }
.event-time { min-width: 64px; font-weight: 700; color: #5E81FF; }

.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 16px;
}
.week-days { display: grid; gap: 12px; }
.week-day-card__body { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.meal-photo--sm { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; }

.eaters-meta--link { display: inline-flex; color: inherit; }
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(20, 24, 40, .35); z-index: 60;
}
.sheet-backdrop.is-hidden { display: none; }
.day-chip input { position: absolute; opacity: 0; pointer-events: none; }
.day-chip { position: relative; }

.filter-chip {
  display: inline-flex; align-items: center; padding: 8px 12px; border-radius: 999px;
  background: #eef2ff; font-size: 13px; font-weight: 600;
}
.filter-chip input { display: none; }
.filter-chip.is-on { background: #5E81FF; color: #fff; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.log-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; }
.log-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; }
.log-dot--green { background: #3dba7a; }
.log-dot--red { background: #e25b5b; }
.log-dot--purple { background: #8b74e8; }
.log-dot--blue { background: #5E81FF; }
.log-dot--peach { background: #e08a4f; }
.log-day { margin: 22px 0 10px; font-size: 15px; }

.resident-grid { display: grid; gap: 12px; margin-top: 16px; }
.resident-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px; }
.menu-pop { position: relative; }
.menu-pop summary { list-style: none; }
.menu-pop__list {
  position: absolute; right: 0; top: 40px; background: #fff; border-radius: 16px;
  box-shadow: 0 12px 32px rgba(20,30,60,.14); min-width: 210px; z-index: 5; overflow: hidden;
}
.menu-pop__list a, .menu-pop__list button {
  display: block; width: 100%; text-align: left; padding: 12px 14px; background: none; border: 0; font-weight: 600;
}

@media (min-width: 860px) {
  .meal-book-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .meal-book-card img { height: 120px; }
  .resident-grid { grid-template-columns: 1fr 1fr; }
}

