/* =========================================================================
   Receitas — design system
   Tokens no :root, tema escuro pelo sistema ou pela escolha salva (data-theme).
   Fontes do sistema: sem requisição a terceiros (privacidade/LGPD e CSP).
   ========================================================================= */

:root {
  --bg: #fbf8f4;
  --surface: #ffffff;
  --surface-2: #f6f0e8;
  --surface-3: #efe6da;
  --text: #1f1a14;
  --text-2: #4a4138;
  --muted: #7a6f63;
  --border: #ebe2d6;
  --border-strong: #ddd1c1;
  --primary: #d9480f;
  --primary-hover: #c03d0b;
  --primary-soft: #fff0e6;
  --primary-text: #b23a0a;
  --on-primary: #ffffff;
  --accent: #2f7d4f;
  --accent-soft: #e6f4ec;
  --danger: #c92a2a;
  --danger-hover: #a51d1d;
  --danger-soft: #fdecec;
  --gold-1: #f5b544;
  --gold-2: #e8890c;
  --gold-soft: #fff6e0;
  --gold-text: #8a5300;
  --overlay: rgba(20, 15, 10, 0.5);
  --shadow-sm: 0 1px 2px rgba(60, 40, 20, 0.06), 0 1px 3px rgba(60, 40, 20, 0.06);
  --shadow-md: 0 4px 12px rgba(60, 40, 20, 0.08), 0 2px 4px rgba(60, 40, 20, 0.05);
  --shadow-lg: 0 18px 40px rgba(60, 40, 20, 0.14), 0 4px 10px rgba(60, 40, 20, 0.06);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --font-sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, ui-serif, serif;
  --header-h: 64px;
  --tabbar-h: 0px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #14110e;
    --surface: #1c1814;
    --surface-2: #25201a;
    --surface-3: #2f2820;
    --text: #f4eee6;
    --text-2: #d6ccc0;
    --muted: #a69a8c;
    --border: #322a22;
    --border-strong: #42382d;
    --primary: #ff7a3d;
    --primary-hover: #ff9160;
    --primary-soft: #3a2114;
    --primary-text: #ffa476;
    --on-primary: #1a0d05;
    --accent: #5cc68a;
    --accent-soft: #15301f;
    --danger: #ff6b6b;
    --danger-hover: #ff8787;
    --danger-soft: #3a1717;
    --gold-soft: #33260c;
    --gold-text: #f7c66b;
    --overlay: rgba(0, 0, 0, 0.6);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #14110e;
  --surface: #1c1814;
  --surface-2: #25201a;
  --surface-3: #2f2820;
  --text: #f4eee6;
  --text-2: #d6ccc0;
  --muted: #a69a8c;
  --border: #322a22;
  --border-strong: #42382d;
  --primary: #ff7a3d;
  --primary-hover: #ff9160;
  --primary-soft: #3a2114;
  --primary-text: #ffa476;
  --on-primary: #1a0d05;
  --accent: #5cc68a;
  --accent-soft: #15301f;
  --danger: #ff6b6b;
  --danger-hover: #ff8787;
  --danger-soft: #3a1717;
  --gold-soft: #33260c;
  --gold-text: #f7c66b;
  --overlay: rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

/* ---------- base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--tabbar-h);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--primary-text);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0;
  color: var(--text);
}

h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.15rem;
  font-weight: 650;
}

h3 {
  font-size: 1rem;
  font-weight: 650;
}

p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

[hidden] {
  display: none !important;
}

.icon {
  flex-shrink: 0;
}

.muted {
  color: var(--muted);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- topo ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar__inner {
  max-width: 1200px;
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, #f76707, #d9480f);
  color: #fff;
  box-shadow: 0 4px 10px rgba(217, 72, 15, 0.3);
}

.brand__name {
  font-family: var(--font-serif);
  font-size: 1.3rem;
}

.nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-2);
  font-weight: 550;
  font-size: 0.95rem;
  transition: background 0.15s, color 0.15s;
}

.nav__link:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.nav__link.is-active {
  background: var(--primary-soft);
  color: var(--primary-text);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.account {
  position: relative;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, #ffd8a8, #ffa94d);
  color: #7a2e00;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  position: relative;
}

.avatar--premium::after {
  content: '';
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-1), var(--gold-2));
  border: 2px solid var(--bg);
}

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 240px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: pop-in 0.16s var(--ease);
}

.menu__header {
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.menu__name {
  font-weight: 650;
}

.menu__email {
  font-size: 0.85rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
}

.menu__item:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.menu__item--danger {
  color: var(--danger);
}

/* barra inferior (celular) */
.tabbar {
  display: none;
}

/* ---------- página ---------- */

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 96px;
  outline: none;
  animation: fade-up 0.28s var(--ease);
}

.page--narrow {
  max-width: 760px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.page-header__text p {
  margin-top: 6px;
  color: var(--muted);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary-text);
  margin-bottom: 8px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  color: var(--muted);
  font-weight: 550;
  font-size: 0.95rem;
}

.back-link:hover {
  color: var(--text);
  text-decoration: none;
}

/* ---------- botões ---------- */

.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-border: var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--btn-border);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s, opacity 0.15s;
  position: relative;
}

.btn:hover {
  text-decoration: none;
  background: var(--surface-2);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  --btn-bg: var(--primary);
  --btn-fg: var(--on-primary);
  --btn-border: var(--primary);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 30%, transparent);
}

.btn--primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn--danger {
  --btn-bg: var(--danger);
  --btn-fg: #fff;
  --btn-border: var(--danger);
}

.btn--danger:hover {
  background: var(--danger-hover);
  border-color: var(--danger-hover);
}

.btn--danger-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--danger);
  --btn-border: color-mix(in srgb, var(--danger) 35%, transparent);
}

.btn--danger-ghost:hover {
  background: var(--danger-soft);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-border: transparent;
}

.btn--soft {
  --btn-bg: var(--primary-soft);
  --btn-fg: var(--primary-text);
  --btn-border: transparent;
}

.btn--soft:hover {
  background: color-mix(in srgb, var(--primary-soft) 70%, var(--primary) 12%);
}

.btn--sm {
  min-height: 36px;
  padding: 7px 14px;
  font-size: 0.88rem;
}

.btn--block {
  width: 100%;
}

.btn.is-busy {
  color: transparent !important;
}

.btn.is-busy::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid var(--btn-fg);
  border-right-color: transparent;
  border-radius: 999px;
  animation: spin 0.7s linear infinite;
}

/* ---------- formulários ---------- */

.form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field label,
.label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-2);
}

.field .hint {
  font-size: 0.82rem;
  color: var(--muted);
}

.req {
  color: var(--primary-text);
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='number'],
input[type='url'],
input[type='tel'],
input[type='date'],
input[type='search'],
textarea,
select {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 75%, transparent);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
}

input:disabled {
  background: var(--surface-2);
  color: var(--muted);
}

.input-group {
  position: relative;
}

.input-group input {
  padding-right: 48px;
}

.input-group__btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.input-group__btn:hover {
  color: var(--text);
}

.grid-2,
.grid-3 {
  display: grid;
  gap: 16px;
}

@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text-2);
}

.check input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--primary);
  flex-shrink: 0;
}

/* interruptor */
.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
}

.switch__text strong {
  display: block;
  font-weight: 600;
}

.switch__text span {
  font-size: 0.88rem;
  color: var(--muted);
}

.switch input {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 48px;
  height: 28px;
  margin: 0;
  border-radius: 999px;
  background: var(--border-strong);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}

.switch input::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease);
}

.switch input:checked {
  background: var(--accent);
}

.switch input:checked::after {
  transform: translateX(20px);
}

/* chips selecionáveis (selos) */
.chip-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip-toggle span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.chip-toggle span .icon {
  display: none;
}

.chip-toggle input:checked + span {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-text);
}

.chip-toggle input:checked + span .icon {
  display: inline;
}

.chip-toggle input:focus-visible + span {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---------- cartões / superfícies ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card__body {
  padding: 24px;
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.section-card + .section-card {
  margin-top: 16px;
}

.section-card__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.section-card__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary-text);
  flex-shrink: 0;
}

.section-card__head p {
  margin-top: 2px;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---------- selos ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge--neutral {
  background: var(--surface-2);
  color: var(--text-2);
}

.badge--like {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge--dislike {
  background: var(--danger-soft);
  color: var(--danger);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.plan-badge--premium {
  background: linear-gradient(135deg, var(--gold-1), var(--gold-2));
  color: #3d2300;
}

/* ---------- busca (lista) ---------- */

.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: clamp(28px, 5vw, 56px);
  margin-bottom: 28px;
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--primary) 22%, transparent) 0%, transparent 55%),
    radial-gradient(90% 120% at 0% 100%, color-mix(in srgb, var(--gold-1) 22%, transparent) 0%, transparent 55%),
    var(--surface);
  border: 1px solid var(--border);
}

.hero h1 {
  max-width: 640px;
}

.hero p {
  max-width: 560px;
  margin-top: 10px;
  color: var(--text-2);
  font-size: 1.05rem;
}

.search {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 26px;
  max-width: 820px;
}

@media (min-width: 720px) {
  .search {
    grid-template-columns: 1fr 240px auto;
    padding: 8px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  .search input {
    border: 0;
    background: transparent;
    min-height: 44px;
  }

  .search input:focus {
    box-shadow: none;
  }

  .search .search__field + .search__field {
    border-left: 1px solid var(--border);
  }
}

.search__field {
  position: relative;
}

.search__field .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search__field input {
  padding-left: 44px;
  border-radius: 999px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.toolbar__info {
  color: var(--muted);
  font-size: 0.95rem;
}

.toolbar__info strong {
  color: var(--text);
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px 5px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-text);
  font-size: 0.85rem;
  font-weight: 600;
  border: 0;
  cursor: pointer;
}

.filter-chip:hover {
  background: color-mix(in srgb, var(--primary-soft) 70%, var(--primary) 15%);
}

/* ---------- grade de receitas ---------- */

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

.recipe-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s;
}

.recipe-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}

.recipe-card.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
}

.recipe-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  overflow: hidden;
}

.recipe-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.recipe-card:hover .recipe-card__media img {
  transform: scale(1.04);
}

.placeholder-art {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: color-mix(in srgb, var(--primary) 55%, var(--muted));
  background:
    radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 60%),
    radial-gradient(circle at 75% 80%, color-mix(in srgb, var(--gold-1) 18%, transparent), transparent 55%),
    var(--surface-2);
}

.recipe-card__category {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 650;
  box-shadow: var(--shadow-sm);
}

.recipe-card__select {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow-md);
  cursor: pointer;
}

.recipe-card__select input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.recipe-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px 18px;
  flex: 1;
}

.recipe-card__title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipe-card__subtitle {
  font-size: 0.9rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipe-card__meta {
  display: flex;
  gap: 16px;
  margin-top: auto;
  padding-top: 10px;
  color: var(--text-2);
  font-size: 0.88rem;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.meta-item .icon {
  color: var(--muted);
}

/* esqueleto de carregamento */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-card .recipe-card__media {
  border-radius: 0;
}

.skeleton-line {
  height: 14px;
}

/* barra de seleção em massa */
.selection-bar {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--tabbar-h));
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 20px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, 140%);
  opacity: 0;
  transition: transform 0.3s var(--ease), opacity 0.3s;
  max-width: calc(100vw - 32px);
}

.selection-bar.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.selection-bar__count {
  font-weight: 600;
  white-space: nowrap;
}

.selection-bar .btn--ghost {
  --btn-fg: var(--bg);
}

.selection-bar .btn--ghost:hover {
  background: color-mix(in srgb, var(--bg) 15%, transparent);
}

/* paginação */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.page-btn {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.page-btn:hover:not(:disabled) {
  background: var(--surface-2);
}

.page-btn.is-current {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-gap {
  color: var(--muted);
  padding: 0 4px;
}

/* estado vazio / erro */
.empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 56px 24px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.empty__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--primary-soft);
  color: var(--primary-text);
  margin-bottom: 6px;
}

.empty p {
  color: var(--muted);
  max-width: 420px;
}

.empty .btn {
  margin-top: 8px;
}

/* ---------- detalhe da receita ---------- */

.recipe-hero {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  min-height: 340px;
  display: flex;
  align-items: flex-end;
  background: var(--surface-2);
  box-shadow: var(--shadow-md);
}

.recipe-hero__media {
  position: absolute;
  inset: 0;
}

.recipe-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 30%, rgba(15, 10, 5, 0.82) 100%);
}

.recipe-hero__share {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(15, 10, 5, 0.45);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.15s ease, transform 0.15s ease;
}

.recipe-hero__share:hover {
  background: rgba(15, 10, 5, 0.65);
}

.recipe-hero__share:active {
  transform: scale(0.94);
}

.recipe-hero__share:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.recipe-hero__content {
  position: relative;
  z-index: 1;
  padding: clamp(22px, 4vw, 40px);
  color: #fff;
  width: 100%;
}

.recipe-hero__content h1 {
  color: #fff;
  font-size: clamp(2rem, 5vw, 3.2rem);
  max-width: 820px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.3);
}

.recipe-hero__content p {
  margin-top: 8px;
  max-width: 680px;
  font-size: 1.08rem;
  color: rgba(255, 255, 255, 0.88);
}

.recipe-hero__content .badges {
  margin-bottom: 14px;
}

.recipe-hero__content .badge {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0 28px;
}

.stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stat__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary-text);
  flex-shrink: 0;
}

.stat__label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.stat__value {
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-layout {
  display: grid;
  gap: 24px;
  align-items: start;
}

@media (min-width: 960px) {
  .detail-layout {
    grid-template-columns: 360px 1fr;
    gap: 32px;
  }

  .detail-layout__aside {
    position: sticky;
    top: calc(var(--header-h) + 20px);
  }
}

.detail-section + .detail-section {
  margin-top: 28px;
}

.detail-section > h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-family: var(--font-serif);
  font-size: 1.45rem;
}

.detail-section > h2 .icon {
  color: var(--primary-text);
}

.ingredient-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ingredient-list li + li {
  border-top: 1px solid var(--border);
}

.ingredient {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 2px;
  cursor: pointer;
  color: var(--text);
}

.ingredient input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

.ingredient input:checked + span {
  color: var(--muted);
  text-decoration: line-through;
}

.ingredient-progress {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 8px;
}

.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.nutrient {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.nutrient--highlight {
  grid-column: 1 / -1;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nutrient__label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

.nutrient__value {
  font-weight: 700;
  font-size: 1.1rem;
}

.nutrient--highlight .nutrient__value {
  font-size: 1.5rem;
  color: var(--primary-text);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}

.step {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  padding-bottom: 22px;
  counter-increment: step;
}

.step::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 19px;
  top: 44px;
  bottom: 4px;
  width: 2px;
  background: var(--border);
}

.step p {
  padding-top: 8px;
  color: var(--text);
  font-size: 1.02rem;
}

.steps--soft .step::before {
  background: var(--primary-soft);
  color: var(--primary-text);
}

.tips {
  display: grid;
  gap: 10px;
}

.tip {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--gold-soft);
  color: var(--text);
}

.tip .icon {
  color: var(--gold-text);
  margin-top: 2px;
}

.owner-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.feedback-card {
  margin-top: 28px;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}

.feedback-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.feedback-card p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.vote-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.vote-btn:hover:not(:disabled) {
  border-color: var(--text-2);
}

.vote-btn:disabled {
  cursor: default;
  opacity: 1;
}

.vote-btn__count {
  min-width: 26px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.vote-btn.is-active .vote-btn__count {
  background: color-mix(in srgb, #fff 24%, transparent);
  color: #fff;
}

.feedback-card .feedback-card__hint {
  margin-top: 14px;
}

.feedback-card__hint a {
  color: var(--primary-text);
  font-weight: 700;
}

.vote-btn[data-value='LIKE'].is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.vote-btn[data-value='DISLIKE'].is-active {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

/* ---------- editor de receita ---------- */

.editor-layout {
  display: grid;
  gap: 16px;
}

.list-editor {
  display: grid;
  gap: 8px;
}

.list-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid transparent;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.list-row textarea,
.list-row input {
  background: var(--surface);
  min-height: 42px;
}

.list-row textarea {
  min-height: 64px;
}

.list-row.dragging {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  background: var(--surface);
  position: relative;
  z-index: 2;
}

.drag-handle {
  display: grid;
  place-items: center;
  width: 32px;
  height: 40px;
  color: var(--muted);
  cursor: grab;
  touch-action: none;
  border-radius: var(--radius-sm);
}

.drag-handle:hover {
  background: var(--surface-3);
  color: var(--text);
}

.list-row.dragging .drag-handle {
  cursor: grabbing;
}

.row-index {
  min-width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-2);
}

.remove-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.remove-btn:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.list-empty {
  padding: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.add-row-btn {
  margin-top: 10px;
  justify-self: start;
}

.save-bar {
  position: sticky;
  bottom: calc(16px + var(--tabbar-h));
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding: 12px 12px 12px 20px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.save-bar__text {
  font-size: 0.9rem;
  color: var(--muted);
}

.dropzone {
  display: grid;
  gap: 16px;
}

@media (min-width: 640px) {
  .dropzone {
    grid-template-columns: 240px 1fr;
    align-items: center;
  }
}

.dropzone__preview {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
}

.dropzone__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dropzone__target {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 28px 20px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone__target:hover,
.dropzone__target.is-over {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-text);
}

.dropzone__target strong {
  color: var(--text);
}

.dropzone__target input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
}

.notice {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.92rem;
}

.notice .icon {
  color: var(--primary-text);
  margin-top: 1px;
}

/* ---------- autenticação ---------- */

.auth {
  display: grid;
  min-height: calc(100vh - var(--header-h) - 64px);
  align-items: center;
}

.auth__shell {
  display: grid;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

@media (min-width: 880px) {
  .auth__shell {
    grid-template-columns: 1fr 1fr;
  }
}

.auth__art {
  display: none;
  position: relative;
  padding: 48px;
  color: #fff;
  background:
    radial-gradient(80% 60% at 20% 10%, rgba(255, 212, 59, 0.45), transparent 60%),
    radial-gradient(70% 70% at 90% 90%, rgba(255, 255, 255, 0.12), transparent 60%),
    linear-gradient(160deg, #f76707 0%, #d9480f 45%, #a52a0a 100%);
}

@media (min-width: 880px) {
  .auth__art {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
}

.auth__art h2 {
  color: #fff;
  font-family: var(--font-serif);
  font-size: 2.1rem;
  line-height: 1.15;
  margin-top: 28px;
}

.auth__art p {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.02rem;
}

.auth__perks {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth__perks li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 550;
}

.auth__perks .icon {
  padding: 7px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
}

.auth__art .brand__mark {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: none;
}

.auth__form {
  padding: clamp(28px, 5vw, 52px);
}

.auth__form h1 {
  font-size: clamp(1.7rem, 3.4vw, 2.2rem);
}

.auth__form > p {
  margin-top: 8px;
  color: var(--muted);
}

.auth__form .form {
  margin-top: 28px;
}

.auth__footer {
  margin-top: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.form-row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.form-row-between a {
  font-size: 0.9rem;
  font-weight: 550;
}

.otp-input {
  font-size: 1.6rem !important;
  letter-spacing: 0.5em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* tela de mensagem (links de e-mail) */
.message-card {
  max-width: 520px;
  margin: 6vh auto 0;
  padding: clamp(28px, 5vw, 44px);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.message-card__icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 24px;
  background: var(--primary-soft);
  color: var(--primary-text);
}

.message-card__icon--success {
  background: var(--accent-soft);
  color: var(--accent);
}

.message-card__icon--danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.message-card h1 {
  font-size: clamp(1.6rem, 3.6vw, 2rem);
}

.message-card p {
  margin-top: 10px;
  color: var(--muted);
}

.message-card .vote-group,
.message-card .actions {
  justify-content: center;
  margin-top: 24px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- perfil ---------- */

.profile-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
}

.profile-head .avatar {
  width: 72px;
  height: 72px;
  font-size: 1.6rem;
  cursor: default;
}

.profile-head h1 {
  font-size: clamp(1.6rem, 3.6vw, 2.1rem);
}

.profile-head p {
  color: var(--muted);
  margin-top: 4px;
  word-break: break-all;
}

.profile-layout {
  display: grid;
  gap: 16px;
  align-items: start;
}

@media (min-width: 960px) {
  .profile-layout {
    grid-template-columns: 1fr 1fr;
  }

  .profile-layout__full {
    grid-column: 1 / -1;
  }
}

.premium-card {
  position: relative;
  overflow: hidden;
  padding: 26px;
  border-radius: var(--radius-lg);
  color: #2b1800;
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(255, 255, 255, 0.45), transparent 60%),
    linear-gradient(135deg, #ffd43b 0%, #f5b544 40%, #e8890c 100%);
  box-shadow: 0 10px 30px rgba(232, 137, 12, 0.25);
}

.premium-card h2 {
  color: #2b1800;
  font-family: var(--font-serif);
  font-size: 1.6rem;
}

.premium-card p {
  margin-top: 6px;
  color: rgba(43, 24, 0, 0.78);
}

.premium-card .icon-bg {
  position: absolute;
  right: -20px;
  top: -20px;
  opacity: 0.18;
  color: #2b1800;
}

.basic-card {
  padding: 26px;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-strong);
  background: var(--surface);
}

.basic-card h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-top: 12px;
}

.basic-card p {
  margin-top: 8px;
  color: var(--muted);
}

.perk-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.perk-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--text-2);
}

.perk-list .icon {
  color: var(--accent);
  margin-top: 2px;
}

.taste {
  display: grid;
  gap: 14px;
}

.taste__row {
  display: grid;
  gap: 8px;
}

.taste__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--text-2);
}

.stats-inline {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.stats-inline .stat {
  flex: 1;
  padding: 12px 14px;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
}

.timeline li + li {
  border-top: 1px solid var(--border);
}

.timeline__date {
  flex-shrink: 0;
  width: 52px;
  text-align: center;
  padding: 6px 0;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  line-height: 1.1;
}

.timeline__date strong {
  display: block;
  font-size: 1.15rem;
}

.timeline__date span {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 650;
}

.timeline__title {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.divider {
  height: 1px;
  border: 0;
  background: var(--border);
  margin: 22px 0;
}

/* ---------- diálogo ---------- */

.dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.dialog[open] {
  animation: pop-in 0.2s var(--ease);
}

.dialog::backdrop {
  background: var(--overlay);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.dialog__body {
  display: grid;
  gap: 12px;
  padding: 26px;
}

.dialog__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary-text);
}

.dialog__icon--danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.dialog__title {
  font-size: 1.25rem;
}

.dialog__text {
  color: var(--muted);
}

.dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

/* ---------- toasts ---------- */

.toast-region {
  position: fixed;
  z-index: 60;
  top: calc(var(--header-h) + 12px);
  right: 16px;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-lg);
  font-size: 0.95rem;
  color: var(--text);
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.25s, transform 0.25s var(--ease);
  pointer-events: auto;
}

.toast--visible {
  opacity: 1;
  transform: none;
}

.toast .icon {
  margin-top: 1px;
}

.toast--success {
  border-left-color: var(--accent);
}

.toast--success .icon {
  color: var(--accent);
}

.toast--error {
  border-left-color: var(--danger);
}

.toast--error .icon {
  color: var(--danger);
}

.toast--info .icon {
  color: var(--primary-text);
}

/* ---------- animações ---------- */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- celular ---------- */

@media (max-width: 760px) {
  :root {
    --header-h: 58px;
    --tabbar-h: calc(64px + env(safe-area-inset-bottom));
  }

  .topbar__inner {
    padding: 0 12px 0 16px;
    gap: 8px;
  }

  .nav {
    display: none;
  }

  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    height: var(--tabbar-h);
    padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-top: 1px solid var(--border);
  }

  .tabbar__item {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 3px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
  }

  .tabbar__item:hover {
    text-decoration: none;
  }

  .tabbar__item.is-active {
    color: var(--primary-text);
  }

  .tabbar__item--cta .tabbar__bubble {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-top: -18px;
    border-radius: 16px;
    background: var(--primary);
    color: var(--on-primary);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 40%, transparent);
  }

  .page {
    padding: 20px 16px 40px;
  }

  .hero {
    border-radius: var(--radius-lg);
    margin: 0 0 20px;
  }

  .recipe-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .recipe-hero {
    min-height: 300px;
    margin: 0 -16px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }

  .recipe-detail .back-link {
    position: relative;
  }

  .stats {
    gap: 8px;
  }

  .stat {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
  }

  .stat__icon {
    width: 34px;
    height: 34px;
  }

  .section-card {
    padding: 18px;
  }

  .list-row {
    grid-template-columns: auto 1fr auto;
  }

  .list-row .row-index {
    display: none;
  }

  .save-bar {
    border-radius: var(--radius-lg);
    padding: 12px;
  }

  .save-bar__text {
    display: none;
  }

  .save-bar .btn {
    flex: 1;
  }

  .toast-region {
    top: auto;
    bottom: calc(var(--tabbar-h) + 12px);
    left: 16px;
    right: 16px;
    width: auto;
  }

  .selection-bar {
    bottom: calc(var(--tabbar-h) + 12px);
  }

  .auth {
    min-height: auto;
  }

  .auth__shell {
    border-radius: var(--radius-lg);
  }

  .dialog__actions {
    flex-direction: column-reverse;
  }

  .dialog__actions .btn {
    width: 100%;
  }
}

@media (min-width: 761px) {
  .hide-desktop {
    display: none !important;
  }
}

/* ---------- utilitários (substituem estilos inline, bloqueados pela CSP) ---------- */

.skeleton-line--title {
  width: 75%;
  height: 20px;
}

.skeleton-line--mid {
  width: 55%;
}

.skeleton-line--short {
  width: 40%;
  margin-top: 12px;
}

.skeleton-hero {
  height: 340px;
  border-radius: var(--radius-xl);
}

.skeleton-stat {
  height: 72px;
  border-radius: var(--radius);
}

.skeleton-plan {
  height: 160px;
  border-radius: var(--radius-lg);
}

.owner-actions {
  margin-bottom: 24px;
}

.section-note {
  margin: -6px 0 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

.nutrition-fields {
  margin-top: 20px;
}

.message-card__icon--start {
  margin: 0 0 18px;
}

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

.basic-card__cta {
  margin-top: 20px;
}

/* ---------- oferta do Premium e bloco da assinatura ---------- */

/* "7 dias grátis, sem cartão" nos avisos do Premium. */
.trial-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--gold-soft);
  color: var(--gold-text);
  font-size: 0.92rem;
  line-height: 1.45;
  text-align: left;
}

.trial-hint .icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.trial-hint--offer {
  margin-top: 10px;
}

.offer-card {
  border-style: solid;
  border-color: color-mix(in srgb, var(--gold-2) 45%, var(--border));
  background:
    radial-gradient(90% 120% at 100% 0%, var(--gold-soft), transparent 60%),
    var(--surface);
}

.offer-card .offer-card__price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 10px;
  color: var(--text);
}

.offer-card__price strong {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  line-height: 1;
}

.offer-card__price span {
  color: var(--muted);
  font-weight: 600;
}

.offer-card .offer-card__fine {
  margin-top: 14px;
  font-size: 0.85rem;
}

.offer-card__fine a {
  color: var(--primary-text);
  font-weight: 700;
}

.subscription {
  margin-top: 20px;
}

.subscription__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.subscription__actions:empty {
  display: none;
}

.subscription__actions .btn {
  min-height: 48px;
}

.subscription .subscription__status {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 12px;
  font-weight: 600;
  color: var(--text-2);
}

.subscription__status .icon {
  flex-shrink: 0;
  margin-top: 3px;
}

.subscription__status--ok .icon {
  color: var(--accent);
}

/* No cartão dourado: textos escuros e botão discreto. */
.subscription--premium {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}

.subscription--premium .subscription__status,
.premium-card .subscription--premium .subscription__status {
  margin-bottom: 10px;
  color: #2b1800;
}

.premium-card .subscription--premium .subscription__status:last-child {
  margin-bottom: 0;
}

.subscription--premium .subscription__status--ok .icon {
  color: #2f7a3c;
}

.subscription--premium .subscription__cancel {
  color: #5a3500;
  border-color: rgba(43, 24, 0, 0.25);
  background: transparent;
}

@media (max-width: 480px) {
  .subscription__actions .btn {
    flex: 1 1 100%;
  }
}

.plan-badge--on-gold {
  background: rgba(255, 255, 255, 0.55);
  color: #3d2300;
}

.premium-card h2 {
  margin-top: 14px;
}

.premium-card__panel {
  margin-top: 20px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}

.premium-card__panel .switch__text strong {
  color: #2b1800;
}

.premium-card__panel .switch__text span {
  color: rgba(43, 24, 0, 0.7);
}

.stat__icon--like {
  background: var(--accent-soft);
  color: var(--accent);
}

.stat__icon--dislike {
  background: var(--danger-soft);
  color: var(--danger);
}

.profile-layout .section-card {
  margin: 0;
}

.dropzone__target {
  position: relative;
}

@media (max-width: 420px) {
  .hide-xs {
    display: none !important;
  }
}

/* categoria longa: uma linha só, com reticências */
.recipe-card__category {
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* detalhe sem foto: fundo quente com o ícone de lado, em vez de atrás do título */
.recipe-hero--no-image {
  background:
    radial-gradient(80% 90% at 15% 0%, rgba(255, 212, 59, 0.4), transparent 60%),
    linear-gradient(135deg, #f76707 0%, #d9480f 55%, #a52a0a 100%);
}

.recipe-hero--no-image::after {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(60, 15, 0, 0.35) 100%);
}

.recipe-hero--no-image .recipe-hero__media {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 28px;
  color: rgba(255, 255, 255, 0.18);
}

.recipe-hero--no-image .placeholder-art {
  all: unset;
}

@media (max-width: 760px) {
  .recipe-card__media {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 760px) {
  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .stat--wide {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
  }
}

/* receitas de outras pessoas no modo seleção */
.recipe-card.is-locked {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

.recipe-card.is-locked:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}

.recipe-card.is-locked:hover .recipe-card__media img {
  transform: none;
}

.recipe-card__own {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* ---------- busca por ingredientes ---------- */

.tag-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 46px;
  padding: 6px 12px 6px 44px;
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  background: var(--surface);
  cursor: text;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tag-input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
}

.tag-input #ingredient-tags {
  display: contents;
}

.tag-input input,
.tag-input input:focus {
  flex: 1;
  min-width: 140px;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.search__field--tags .icon {
  top: 23px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 4px 4px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-text);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
}

.tag__remove {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.tag__remove:hover {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
}

@media (min-width: 720px) {
  .search {
    grid-template-columns: 1fr 1.4fr auto;
    align-items: center;
    border-radius: 32px;
  }

  .search .tag-input {
    border: 0;
    background: transparent;
    border-radius: 0;
    border-left: 1px solid var(--border);
  }

  .search .tag-input:focus-within {
    box-shadow: none;
  }

  .search .search__field + .search__field {
    border-left: 0;
  }
}

.match-info {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.84rem;
  color: var(--text-2);
}

.match-info__count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-weight: 700;
  color: var(--primary-text);
}

.match-info--all {
  background: var(--accent-soft);
}

.match-info--all .match-info__count {
  color: var(--accent);
}

.match-info__have {
  font-weight: 600;
  color: var(--text);
}

.match-info__missing {
  color: var(--muted);
}

/* ---------- favoritas ---------- */

.recipe-card-wrap {
  position: relative;
  display: flex;
}

.recipe-card-wrap > .recipe-card {
  flex: 1;
}

.fav-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text-2);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform 0.2s var(--ease), color 0.15s, background 0.15s;
}

.recipe-card-wrap:hover .fav-btn {
  transform: translateY(-3px);
}

.fav-btn:hover {
  color: #e03131;
}

.fav-btn.is-favorite,
.fav-toggle.is-favorite {
  color: #e03131;
}

.fav-btn.is-favorite svg,
.fav-toggle.is-favorite svg {
  fill: currentColor;
}

.fav-btn.is-favorite {
  animation: fav-pop 0.3s var(--ease);
}

.fav-btn:disabled {
  cursor: progress;
}

@keyframes fav-pop {
  50% {
    transform: scale(1.18);
  }
}

.fav-toggle.is-favorite {
  --btn-border: color-mix(in srgb, #e03131 35%, transparent);
  background: color-mix(in srgb, #e03131 8%, var(--surface));
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.detail-actions .owner-actions {
  display: flex;
  gap: 10px;
  margin: 0;
}

/* ---------- abas do perfil ---------- */

.tabs {
  display: flex;
  gap: 4px;
  margin: -8px 0 24px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--text-2);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
}

.tabs__item:hover {
  color: var(--text);
  text-decoration: none;
}

.tabs__item.is-active {
  background: var(--surface);
  color: var(--primary-text);
  box-shadow: var(--shadow-sm);
}

@media (min-width: 761px) {
  .tabs {
    display: inline-flex;
  }

  .tabs__item {
    flex: 0 0 auto;
  }
}

@media (max-width: 760px) {
  .tabs__item {
    padding: 10px 10px;
    font-size: 0.9rem;
  }

  .tabs__item .icon {
    display: none;
  }
}

/* ---------- perfil: nada pode ficar mais largo que a tela ---------- */

/* Itens de grid têm min-width: auto por padrão: um texto que não quebra linha
   alargava a coluna inteira (e a caixa Premium junto) além da tela no celular. */
.profile-layout > * {
  min-width: 0;
}

/* Gostos aprendidos podem ser longos ("receitas da categoria OVOS, LEGUMINOSAS E..."). */
.taste .badge {
  white-space: normal;
  line-height: 1.35;
  text-align: left;
  max-width: 100%;
}

/* Receitas enviadas: título em até 2 linhas, sem empurrar a data nem o voto. */
.timeline__title {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.35;
}

.timeline li > .badge {
  flex-shrink: 0;
}

/* ---------- modo Passo a Passo ---------- */

/* Botão sobre a foto/fundo da receita: sempre branco, para contrastar com qualquer imagem
   e nos dois temas (a foto tem sempre um degradê escuro por baixo do texto). */
.recipe-hero__cta {
  --btn-bg: #ffffff;
  --btn-fg: #b23a0a;
  --btn-border: #ffffff;
  margin-top: 18px;
  min-height: 48px;
  padding: 12px 22px;
  font-size: 1rem;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
}

.recipe-hero__cta:hover {
  background: #fff3ea;
  border-color: #fff3ea;
}

body.is-step-mode-open {
  overflow: hidden;
}

/* Deslizar para os lados troca de passo: o navegador não pode tratar isso como
   "voltar página" (gesto do Chrome no Android) enquanto o modo está aberto. */
html.is-step-mode-open,
body.is-step-mode-open,
.step-mode {
  overscroll-behavior: none;
}

.step-mode__body {
  touch-action: pan-y;
}

.step-mode {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--bg);
  color: var(--text);
}

.step-mode[open] {
  animation: fade-up 0.25s var(--ease);
}

.step-mode::backdrop {
  background: var(--bg);
}

.step-mode__frame {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  height: 100%;
}

.step-mode__top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.step-mode__heading {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.step-mode__mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary-text);
}

.step-mode__recipe {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-mode__close {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}

.step-mode__close:hover {
  background: var(--surface-3);
}

.step-mode__progress {
  height: 6px;
  background: var(--surface-3);
}

.step-mode__bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #f76707, var(--primary));
  border-radius: 0 999px 999px 0;
  transition: width 0.3s var(--ease);
}

.step-mode__body {
  overflow-y: auto;
  padding: clamp(24px, 6vh, 64px) 20px 32px;
  outline: none;
}

.step-mode__body > * {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.step-mode__eyebrow {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary-text);
  margin-bottom: 12px;
}

.step-mode__title {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 5vw, 2.4rem);
}

.step-mode__hint {
  margin-top: 8px;
  font-size: 1.05rem;
  color: var(--muted);
}

.step-mode__step {
  font-size: clamp(1.45rem, 4.6vw, 2.15rem);
  line-height: 1.45;
  font-weight: 500;
  color: var(--text);
}

.step-mode__ingredients {
  display: grid;
  gap: 10px;
  margin: 24px auto 0;
  padding: 0;
  list-style: none;
}

.step-mode__ingredient {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 60px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: clamp(1.08rem, 3.6vw, 1.25rem);
  line-height: 1.35;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.step-mode__ingredient input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.step-mode__check {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 2px solid var(--border-strong);
  border-radius: 10px;
  color: transparent;
  transition: all 0.15s;
}

.step-mode__ingredient input:checked + .step-mode__check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.step-mode__ingredient input:focus-visible + .step-mode__check {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.step-mode__ingredient:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: var(--accent-soft);
}

.step-mode__ingredient:has(input:checked) .step-mode__ingredient-text {
  color: var(--muted);
  text-decoration: line-through;
}

.step-mode__tally {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.95rem;
}

.step-mode__done {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 4px;
}

.step-mode__done-icon {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin-bottom: 12px;
  border-radius: 28px;
  background: var(--accent-soft);
  color: var(--accent);
}

.step-mode__tips {
  display: grid;
  gap: 10px;
  width: 100%;
  margin-top: 28px;
  text-align: left;
}

.step-mode__tip {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--gold-soft);
  font-size: 1.05rem;
  line-height: 1.45;
}

.step-mode__tip .icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--gold-text);
}

.step-mode__done-actions {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 360px;
  margin-top: 32px;
}

.step-mode__nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.step-mode__btn {
  min-height: 56px;
  padding: 12px 22px;
  font-size: 1.05rem;
}

.step-mode__nav .step-mode__btn {
  flex: 1;
  max-width: 260px;
}

.step-mode__nav [data-action='next'] {
  margin-left: auto;
}

.step-mode__counter {
  color: var(--muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Na tela final, a navegação de baixo some: os botões ficam no conteúdo. */
.step-mode--done .step-mode__nav [data-action='next'] {
  display: none;
}

@media (max-width: 480px) {
  .step-mode__counter {
    display: none;
  }

  .step-mode__nav .step-mode__btn {
    max-width: none;
  }
}

/* ---------- timer do modo Passo a Passo ---------- */

.step-mode__timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: 48px;
  height: 48px;
  padding: 0 16px 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.step-mode__timer:hover {
  background: var(--surface-3);
}

.step-mode__timer.is-active {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  background: var(--primary-soft, var(--surface-2));
  color: var(--primary-text);
}

.step-mode__timer.is-paused {
  border-style: dashed;
  color: var(--muted);
}

.step-mode__timer.is-ringing {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  animation: cook-timer-pulse 1s ease-in-out infinite;
}

@keyframes cook-timer-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 55%, transparent); }
  50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--primary) 0%, transparent); }
}

/* No celular, sem timer ativo o botão fica só com o ícone para sobrar espaço ao título. */
@media (max-width: 480px) {
  .step-mode__timer:not(.is-active) {
    width: 48px;
    padding: 0;
  }

  .step-mode__timer:not(.is-active) .step-mode__timer-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .step-mode__timer.is-active {
    padding: 0 12px 0 10px;
  }
}

.cook-timer {
  width: min(420px, calc(100vw - 24px));
  padding: 20px 20px 22px;
}

.cook-timer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.cook-timer__head .dialog__title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.cook-timer__head .dialog__title .icon {
  color: var(--primary-text);
}

.cook-timer__view {
  display: grid;
  gap: 16px;
}

.cook-timer__view[hidden] {
  display: none;
}

.cook-timer__hint {
  color: var(--muted);
  line-height: 1.45;
}

.cook-timer__note {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--gold-soft);
  color: var(--text-2);
  font-size: 0.88rem;
  line-height: 1.4;
}

.cook-timer__note .icon {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--gold-text);
}

.cook-timer__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cook-timer__field {
  display: grid;
  gap: 6px;
}

.cook-timer__field label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-2);
  text-align: center;
}

.cook-timer__stepper {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow: hidden;
}

.cook-timer__stepper:focus-within {
  border-color: var(--primary);
}

.cook-timer__step {
  display: grid;
  place-items: center;
  height: 56px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.cook-timer__step:hover {
  background: var(--surface-3);
}

.cook-timer__input {
  width: 100%;
  min-width: 0;
  height: 56px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
  outline: none;
  appearance: textfield;
  -moz-appearance: textfield;
}

.cook-timer__input::-webkit-outer-spin-button,
.cook-timer__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cook-timer__presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.cook-timer__preset {
  min-height: 40px;
  padding: 6px 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

.cook-timer__preset:hover {
  border-color: var(--primary);
  color: var(--primary-text);
}

.cook-timer__error {
  color: var(--danger, #c92a2a);
  font-size: 0.92rem;
  font-weight: 600;
}

.cook-timer__actions {
  display: flex;
  gap: 10px;
}

.cook-timer__actions .btn {
  flex: 1;
  min-height: 50px;
}

.cook-timer__actions .btn[hidden] {
  display: none;
}

.cook-timer__display {
  margin: 4px 0 0;
  font-size: clamp(3rem, 16vw, 4.2rem);
  font-weight: 800;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.cook-timer__display.is-paused {
  color: var(--muted);
}

.cook-timer__progress {
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  appearance: none;
  background: var(--surface-3);
}

.cook-timer__progress::-webkit-progress-bar {
  background: var(--surface-3);
}

.cook-timer__progress::-webkit-progress-value {
  background: linear-gradient(90deg, #f76707, var(--primary));
  border-radius: 999px;
}

.cook-timer__progress::-moz-progress-bar {
  background: linear-gradient(90deg, #f76707, var(--primary));
  border-radius: 999px;
}

.cook-timer__status {
  margin-top: -6px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}

.cook-timer__controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.cook-timer__controls .btn {
  min-height: 48px;
  padding-left: 8px;
  padding-right: 8px;
}

.cook-timer__back,
.cook-timer__stop {
  min-height: 54px;
}

.cook-timer__ringing {
  justify-items: center;
  text-align: center;
  gap: 10px;
}

.cook-timer__ringing .btn {
  width: 100%;
}

.cook-timer__bell {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 28px;
  background: var(--primary);
  color: #fff;
  animation: cook-timer-shake 0.9s ease-in-out infinite;
}

@keyframes cook-timer-shake {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(-14deg); }
  30% { transform: rotate(12deg); }
  45% { transform: rotate(-8deg); }
  60% { transform: rotate(5deg); }
}

.cook-timer__done-title {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: 700;
}

.cook-timer__done-text {
  color: var(--muted);
  margin-bottom: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .step-mode__timer.is-ringing,
  .cook-timer__bell {
    animation: none;
  }
}

/* ---------- marmitas da semana (Premium) ---------- */

.meal-prep {
  display: grid;
  gap: 16px;
  align-items: start;
}

.meal-prep > * {
  min-width: 0;
}

.meal-prep .section-card + .section-card {
  margin-top: 0;
}

@media (min-width: 1000px) {
  .meal-prep {
    grid-template-columns: minmax(300px, 360px) 1fr;
  }

  .meal-prep__form {
    position: sticky;
    top: calc(var(--header-h) + 16px);
  }
}

.meal-prep fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.meal-prep legend {
  padding: 0;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-2);
}

.household-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

.household-grid > .field {
  align-content: start;
}

.stepper {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.stepper input {
  min-width: 0;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 650;
  background: transparent;
  -moz-appearance: textfield;
  appearance: textfield;
}

.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stepper__btn {
  display: grid;
  place-items: center;
  min-height: 44px;
  border: 0;
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
}

.stepper__btn:hover {
  background: var(--primary-soft);
  color: var(--primary-text);
}

.chip-picker__label {
  margin: 18px 0 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-2);
}

.chip-picker__label span {
  font-weight: 400;
  color: var(--muted);
}

.meal-plan__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 12px;
}

.meal-plan__head .section-card__head {
  flex: 1 1 240px;
}

.meal-plan__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

/* Celular: os três números lado a lado, sem ícone, para não ocupar a tela toda. */
@media (max-width: 640px) {
  .meal-plan__stats {
    gap: 6px;
  }

  .meal-plan__stats .stat {
    padding: 10px;
  }

  .meal-plan__stats .stat__icon {
    display: none;
  }

  .meal-plan__stats .stat__caption {
    font-size: 0.66rem;
    letter-spacing: 0.03em;
  }

  .meal-plan__stats .stat__value {
    font-size: 1rem;
  }

  .meal-plan__stats .stat__sub {
    font-size: 0.76rem;
  }
}

.meal-plan__stats .stat {
  align-items: flex-start;
}

.stat__caption {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat__sub {
  font-size: 0.85rem;
  color: var(--muted);
}

.stat--over .stat__icon {
  background: var(--gold-soft);
  color: var(--gold-text);
}

.meal-plan__budget {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent);
}

.meal-plan__budget--over {
  color: var(--gold-text);
}

#meal-plan-body > .notice {
  margin-top: 12px;
}

.notice--warn {
  background: var(--gold-soft);
  color: var(--gold-text);
}

.notice--warn .icon {
  color: var(--gold-text);
}

.meal-plan__title {
  margin: 28px 0 4px;
  font-family: var(--font-serif);
  font-size: 1.3rem;
}

.meal-plan__lead {
  margin-bottom: 14px;
  font-size: 0.92rem;
  color: var(--muted);
}

.prep-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.prep-item {
  display: flex;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.prep-item__thumb {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
  color: var(--muted);
}

.prep-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prep-item__body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.prep-item__pool {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--primary-text);
}

.prep-item__title {
  font-size: 1.02rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.prep-item__title a {
  color: var(--text);
}

.prep-item__meta {
  font-size: 0.9rem;
  color: var(--text-2);
}

.prep-item__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.prep-item__reason {
  font-size: 0.85rem;
  color: var(--muted);
}

.prep-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

/* ---------- painel de ingredientes (marmitas) ---------- */

.sheet-dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: min(88vh, 760px);
  display: none;
  overflow: hidden;
}

.sheet-dialog[open] {
  display: flex;
  flex-direction: column;
}

.sheet-dialog__head {
  display: grid;
  gap: 6px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--border);
}

.sheet-dialog__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sheet-dialog__title-row .dialog__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sheet-dialog__recipe {
  font-weight: 600;
  color: var(--text-2);
}

.sheet-dialog__note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--muted);
}

.sheet-dialog__note .icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.sheet-dialog__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 22px 12px;
}

.sheet-dialog__loading {
  display: grid;
  gap: 12px;
  padding: 12px 0;
}

.sheet-skeleton {
  height: 20px;
  border-radius: 6px;
}

.sheet-dialog__error,
.sheet-dialog__empty {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 16px 0;
  color: var(--text-2);
}

.sheet-dialog__foot {
  display: grid;
  gap: 8px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.sheet-dialog__foot .dialog__actions {
  margin-top: 0;
}

.sheet-dialog__hint {
  font-size: 0.86rem;
  color: var(--muted);
}

@media (max-width: 520px) {
  .sheet-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
  }
  .sheet-dialog__foot .dialog__actions {
    flex-direction: column-reverse;
  }
  .sheet-dialog__foot .dialog__actions .btn {
    width: 100%;
  }
}

.badge--cold {
  background: #e7f1fb;
  color: #1c5d99;
}

.week {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin: 14px 0 16px;
}

.week__day {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  min-width: 0;
}

.week__name {
  margin-bottom: 8px;
  font-weight: 700;
}

.week__meals {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.week__meals li {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.week__meal {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.week__recipe {
  font-size: 0.92rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.week__recipe a {
  color: var(--text);
}

.week__freeze {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #1c5d99;
}

/* Mover e trocar marmitas na grade da semana. */
.week__help {
  display: block;
  line-height: 1.6;
}

.week__help .icon {
  vertical-align: -2px;
}

.week__slot {
  position: relative;
  padding: 6px 6px 6px 8px;
  margin: 0 -6px 0 -8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.week__slot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 30px;
}

.week__tools {
  display: inline-flex;
  gap: 2px;
  flex-shrink: 0;
}

.week__tool {
  width: 34px;
  height: 34px;
}

.week__grip {
  cursor: grab;
  /* O dedo arrasta a marmita em vez de rolar a página. */
  touch-action: none;
}

.week__grip[aria-pressed='true'] {
  background: var(--primary-soft);
  color: var(--primary-text);
}

.week__slot.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.week__slot.is-movable {
  border-style: dashed;
  border-color: var(--border-strong);
}

.week__slot.is-dragging {
  opacity: 0.45;
}

.week__slot.is-drop-target {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.week__slot.is-drop-invalid {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.week.is-busy {
  opacity: 0.6;
  pointer-events: none;
}

.week__ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  max-width: 220px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 600;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (prefers-reduced-motion: reduce) {
  .week__slot {
    transition: none;
  }
}

/* Escolher a receita que entra (trocar receita). */
.picker__search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
}

.picker__search input[type='search'] {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 10px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  outline: none;
  box-shadow: none;
}

/* O foco aparece na caixa inteira (com a lupa), não só no campo. */
.picker__search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
}

.picker__list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 8px 0;
  list-style: none;
}

.picker__option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.picker__option:hover,
.picker__option:focus-visible {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.picker__thumb {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
  color: var(--muted);
}

.picker__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.picker__text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.picker__text strong {
  overflow-wrap: anywhere;
}

.picker__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}

.picker__warn {
  font-size: 0.8rem;
  color: var(--danger);
}

.calendar-form {
  display: grid;
  gap: 14px;
  text-align: left;
}

.calendar-form select {
  width: 100%;
}

.tabs__label--short {
  display: none;
}

@media (max-width: 420px) {
  .household-grid {
    gap: 10px;
  }

  .stepper {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
  }

  /* "Minhas receitas" vira "Receitas" para as 4 abas caberem sem rolar. */
  .tabs__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .tabs__label--short {
    display: inline;
  }

  .prep-item__thumb {
    width: 56px;
    height: 56px;
  }

  .tabs__item {
    padding: 9px 8px;
    font-size: 0.84rem;
  }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .badge--cold {
    background: #13283d;
    color: #8cc4f5;
  }

  :root:not([data-theme='light']) .week__freeze {
    color: #8cc4f5;
  }
}

:root[data-theme='dark'] .badge--cold {
  background: #13283d;
  color: #8cc4f5;
}

:root[data-theme='dark'] .week__freeze {
  color: #8cc4f5;
}

@media (max-width: 360px) {
  .tabs {
    gap: 2px;
  }

  .tabs__item {
    padding: 9px 5px;
    font-size: 0.8rem;
  }
}

/* ---------- alimentação: filtro da busca e preferências ---------- */

.diet-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.diet-filter__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.diet-filter__chip .icon {
  display: none;
}

.diet-filter__chip:hover {
  border-color: var(--primary);
}

.diet-filter__chip[aria-pressed='true'] {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-text);
}

.diet-filter__chip[aria-pressed='true'] .icon {
  display: inline;
}

.diet-filter__chip:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.food-prefs__options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.food-prefs__option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.food-prefs__box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  height: 100%;
  padding: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.food-prefs__box strong {
  display: block;
}

.food-prefs__box small {
  display: block;
  margin-top: 2px;
  font-size: 0.85rem;
  color: var(--muted);
}

.food-prefs__check {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-strong);
  border-radius: 7px;
  color: transparent;
}

.food-prefs__option input:checked + .food-prefs__box {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.food-prefs__option input:checked + .food-prefs__box .food-prefs__check {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--on-primary);
}

.food-prefs__option input:focus-visible + .food-prefs__box {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.food-prefs__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.meal-prep__diets {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-2);
}

.meal-prep__diets .icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--primary-text);
}

@media (max-width: 420px) {
  .diet-filter {
    gap: 6px;
  }

  .diet-filter__chip {
    min-height: 36px;
    padding: 7px 11px;
    font-size: 0.84rem;
  }
}

/* ---------- ordem de descoberta da tela inicial ---------- */

/* "Corrigimos a digitação" da busca por texto. */
.search-correction {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 0.92rem;
  color: var(--text-2);
}

.search-correction .icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--primary-text);
}

.search-correction p {
  margin: 0;
}

.search-correction .link-btn {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary-text);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.discovery-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin: -4px 0 16px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.discovery-bar__text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-2);
}

.discovery-bar__text .icon {
  flex-shrink: 0;
  color: var(--primary-text);
}

.discovery-bar__actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ---------- cartão sem foto: selo da marca ---------- */

/* Deixa espaço embaixo para a etiqueta da categoria não cobrir o selo. */
.placeholder-art--brand {
  padding-bottom: 34px;
}

.brand-seal {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.brand-seal__text {
  display: grid;
  gap: 1px;
  line-height: 1.15;
}

.brand-seal__text small {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-seal__text strong {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-text);
}

/* ---------- social ---------- */

.avatar--xs,
.avatar--sm,
.avatar--xl {
  cursor: default;
  flex-shrink: 0;
}

.avatar--xs {
  width: 26px;
  height: 26px;
  font-size: 0.68rem;
}

.avatar--sm {
  width: 40px;
  height: 40px;
  font-size: 0.9rem;
}

.avatar--xl {
  width: 92px;
  height: 92px;
  font-size: 2rem;
}

.people {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  min-width: 0;
}

.person__body {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.person__link {
  color: var(--text);
}

.person__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person__meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.person__badge {
  color: var(--accent);
  font-weight: 600;
}

.person__private {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--muted);
}

.person__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

@media (max-width: 420px) {
  .person {
    flex-wrap: wrap;
  }

  .person__actions {
    width: 100%;
    justify-content: stretch;
  }

  .person__actions .btn {
    flex: 1;
  }
}

.people-search {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.people-search .search__field {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
}

.people-search__hint {
  margin-bottom: 16px;
}

#people-results > .toolbar__info,
#social-content > .toolbar__info {
  display: block;
  margin-bottom: 10px;
}

.social-suggestions {
  margin-top: 16px;
}

.feed-item {
  display: grid;
  gap: 8px;
  min-width: 0;
  align-content: start;
}

.feed-item__head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.feed-item__text {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.35;
  min-width: 0;
}

.feed-item__text a {
  color: var(--text);
}

.feed-item__text time {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}

.social-profile {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(70% 120% at 100% 0%, color-mix(in srgb, var(--primary) 10%, transparent), transparent 60%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}

.social-profile__info {
  min-width: 0;
}

.social-profile__info h1 {
  overflow-wrap: anywhere;
}

.social-profile__since {
  margin-top: 4px;
  color: var(--muted);
}

.social-profile__counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.social-profile__counts strong {
  margin-right: 5px;
  color: var(--text);
  font-size: 1.1rem;
}

.social-profile__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 640px) {
  .social-profile {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    padding: 22px 16px;
  }

  .social-profile__counts,
  .social-profile__actions {
    justify-content: center;
  }
}

.section-title {
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-size: 1.4rem;
}

/* Autor na foto da receita (texto branco sobre a imagem). */
.recipe-author {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: 14px;
}

.recipe-author:empty {
  display: none;
}

.recipe-author__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.92rem;
}

.recipe-author__link:hover {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.28);
}

.recipe-author .follow-btn.btn--soft {
  --btn-bg: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

@media (max-width: 760px) {
  .tabbar__item {
    font-size: 0.66rem;
  }
}

/* ---------- cadastro: erros por campo, força da senha e aceite dos termos ---------- */

.field__error {
  font-size: 0.84rem;
  font-weight: 550;
  color: var(--danger);
}

.field__error:empty {
  display: none;
}

.field--invalid input {
  border-color: var(--danger);
}

.field--invalid input:focus {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 16%, transparent);
}

.field__links {
  font-size: 0.88rem;
  font-weight: 550;
}

.strength {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 18px;
}

.strength__bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  flex: 1;
  max-width: 180px;
}

.strength__bars span {
  height: 5px;
  border-radius: 99px;
  background: var(--surface-3);
  transition: background 0.2s;
}

.strength__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.strength[data-level='0'] {
  display: none;
}

.strength[data-level='1'] .strength__bars span:nth-child(-n + 1) {
  background: var(--danger);
}

.strength[data-level='1'] .strength__label {
  color: var(--danger);
}

.strength[data-level='2'] .strength__bars span:nth-child(-n + 2) {
  background: var(--gold-2);
}

.strength[data-level='2'] .strength__label {
  color: var(--gold-text);
}

.strength[data-level='3'] .strength__bars span:nth-child(-n + 3),
.strength[data-level='4'] .strength__bars span {
  background: var(--accent);
}

.strength[data-level='3'] .strength__label,
.strength[data-level='4'] .strength__label {
  color: var(--accent);
}

.terms-consent {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  transition: border-color 0.2s, background 0.2s;
}

.terms-consent.is-accepted {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-soft);
}

.terms-consent__head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.terms-consent__head p {
  margin-top: 2px;
  font-size: 0.88rem;
  color: var(--muted);
}

.terms-consent__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-text);
}

.terms-consent.is-accepted .terms-consent__icon {
  background: var(--surface);
  color: var(--accent);
}

.terms-consent__check input:disabled + span {
  color: var(--muted);
}

/* ---------- leitor dos termos (diálogo) ---------- */

.legal-dialog {
  width: min(720px, calc(100vw - 24px));
  max-height: min(88vh, 860px);
  display: none;
  overflow: hidden;
}

.legal-dialog[open] {
  display: flex;
  flex-direction: column;
}

.legal-dialog__head {
  display: grid;
  gap: 10px;
  padding: 20px 22px 0;
  border-bottom: 1px solid var(--border);
}

.legal-dialog__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.legal-dialog__intro {
  font-size: 0.92rem;
  color: var(--muted);
}

.legal-tabs {
  display: flex;
  gap: 4px;
}

.legal-tabs__tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.legal-tabs__tab[aria-selected='true'] {
  color: var(--text);
  border-bottom-color: var(--primary);
}

.legal-tabs__state {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
}

.legal-tabs__tab.is-read .legal-tabs__state {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.legal-tabs__short {
  display: none;
}

@media (max-width: 420px) {
  .legal-tabs__label {
    display: none;
  }
  .legal-tabs__short {
    display: inline;
  }
}

.legal-dialog__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 22px 26px;
}

.legal-dialog__body:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.legal-dialog__loading {
  display: grid;
  gap: 12px;
}

.legal-skeleton {
  height: 18px;
  border-radius: 6px;
}

.legal-dialog__error {
  display: grid;
  gap: 12px;
  justify-items: start;
  color: var(--text-2);
}

.legal-dialog__foot {
  display: grid;
  gap: 8px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.legal-dialog__foot .dialog__actions {
  margin-top: 0;
}

.legal-dialog__hint {
  font-size: 0.86rem;
  color: var(--muted);
}

.legal-progress {
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: 99px;
  overflow: hidden;
  appearance: none;
  background: var(--surface-3);
}

.legal-progress::-webkit-progress-bar {
  background: var(--surface-3);
}

.legal-progress::-webkit-progress-value {
  background: var(--primary);
  transition: width 0.15s;
}

.legal-progress::-moz-progress-bar {
  background: var(--primary);
}

@media (max-width: 520px) {
  .legal-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
  }
  .legal-dialog__foot .dialog__actions {
    flex-direction: column-reverse;
  }
  .legal-dialog__foot .dialog__actions .btn {
    width: 100%;
  }
}

/* ---------- texto dos documentos ---------- */

.legal-doc {
  display: grid;
  gap: 18px;
  color: var(--text-2);
  line-height: 1.6;
}

.legal-doc__meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.legal-summary {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--text);
}

.legal-summary strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-text);
}

.legal-summary ul,
.legal-section ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
}

.legal-section {
  display: grid;
  gap: 8px;
}

.legal-section h3 {
  font-size: 1.02rem;
  color: var(--text);
}

/* ---------- páginas #/terms e #/privacy ---------- */

.legal-page__inner {
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.legal-page__head {
  display: grid;
  gap: 12px;
}

.legal-page__head h1 {
  font-size: clamp(1.7rem, 3.4vw, 2.2rem);
}

.legal-page__switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legal-switch__link {
  padding: 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 600;
}

.legal-switch__link:hover {
  text-decoration: none;
  border-color: var(--primary);
}

.legal-switch__link.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-text);
}

.legal-callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--gold-soft);
  color: var(--gold-text);
  font-weight: 550;
}

.legal-callout span {
  flex: 1;
  min-width: 180px;
}

.legal-page__other {
  color: var(--muted);
}

/* ---------- faixa de novo aceite e aba Conta ---------- */

.consent-banner {
  border-bottom: 1px solid var(--border);
  background: var(--gold-soft);
  color: var(--text);
}

.consent-banner__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
}

.consent-banner__inner p {
  flex: 1;
  min-width: 220px;
  font-size: 0.92rem;
}

.consent-banner__icon {
  color: var(--gold-text);
  display: inline-grid;
}

.terms-status {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 14px;
  font-weight: 550;
}

.terms-status--ok {
  color: var(--accent);
}

.terms-status--warn {
  color: var(--gold-text);
}

/* ---------- conta oficial ---------- */

.official-mark {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-left: 5px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  vertical-align: middle;
  flex-shrink: 0;
}

.official-mark .icon {
  stroke-width: 3;
}

h1 .official-mark {
  width: 22px;
  height: 22px;
  margin-left: 8px;
}

.social-profile__official {
  margin-top: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-text);
}

.official-recipe {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 5px 12px;
  border-radius: 99px;
  background: var(--primary-soft);
  color: var(--primary-text);
  font-size: 0.82rem;
  font-weight: 700;
}

.avatar .icon {
  width: 60%;
  height: 60%;
}

/* ---------- rolagem infinita ---------- */

.infinite {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 22px;
  min-height: 1px;
}

.infinite__sentinel {
  width: 100%;
  height: 1px;
}

.infinite__status {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.infinite__status:empty {
  display: none;
}

.infinite__loading,
.infinite__end,
.infinite__error {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.infinite__end::before,
.infinite__end::after {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--border-strong);
}

.infinite__spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: infinite-spin 0.8s linear infinite;
}

@keyframes infinite-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- voltar ao topo ---------- */

.back-to-top {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(20px + var(--tabbar-h));
  z-index: 45;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--primary-text);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.9);
  transition: opacity 0.2s, transform 0.2s var(--ease), visibility 0s linear 0.2s;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.2s, transform 0.2s var(--ease), visibility 0s;
}

.back-to-top:hover {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}

.back-to-top:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top,
  .back-to-top.is-visible {
    transition: none;
  }
  .infinite__spinner {
    animation-duration: 2s;
  }
}

/* ---------- categorias ---------- */

.label-note {
  font-weight: 500;
  color: var(--muted);
}

.category-picker-wrap {
  position: relative;
}

.tag-input.category-picker {
  padding: 6px 12px;
  border-radius: var(--radius);
}

.category-picker__tags {
  display: contents;
}

.category-options {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.category-options__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
}

.category-options__item.is-active,
.category-options__item:hover {
  background: var(--primary-soft);
  color: var(--primary-text);
}

.category-options__item mark {
  background: none;
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.category-options__note {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.category-options__empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* filtro da home: botão "Categorias" que abre o painel (category-filter.js) */
.filter-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.filter-button:hover {
  border-color: var(--primary);
}

.filter-button.is-active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-text);
}

.filter-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.filter-button__count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.filter-button__count[hidden] {
  display: none;
}

.category-sheet {
  display: none;
  width: min(560px, calc(100vw - 32px));
  max-height: min(720px, calc(100dvh - 48px));
  overflow: hidden;
}

.category-sheet[open] {
  display: flex;
  flex-direction: column;
}

.category-sheet__head {
  display: grid;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.category-sheet__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.category-sheet__title-row .dialog__title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.category-sheet__title-row .dialog__title .icon {
  color: var(--primary-text);
}

.category-sheet__search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
}

.category-sheet__search:focus-within {
  border-color: var(--primary);
}

.category-sheet__search input[type='search'],
.category-sheet__search input[type='search']:focus {
  flex: 1;
  width: auto;
  min-width: 0;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font: inherit;
  outline: none;
}

.category-sheet__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 20px 16px;
}

.category-sheet__group {
  margin: 0;
  padding: 18px 0 0;
  border: 0;
  min-width: 0;
}

.category-sheet__group[hidden] {
  display: none;
}

.category-sheet__group legend {
  /* float tira a legenda da borda do fieldset: o espaço até as opções fica só o margin */
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.category-sheet__options {
  clear: both;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.category-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.category-option[hidden] {
  display: none;
}

.category-option:hover {
  border-color: var(--primary);
}

.category-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.category-option__box {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-strong);
  border-radius: 7px;
  color: transparent;
  transition: all 0.15s;
}

.category-option input:checked ~ .category-option__box {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.category-option input:focus-visible ~ .category-option__box {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.category-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.category-option__label {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.25;
}

.category-option__count {
  flex-shrink: 0;
  min-width: 26px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.category-sheet__empty {
  padding: 24px 0 8px;
  text-align: center;
  color: var(--muted);
}

.category-sheet__foot {
  display: grid;
  gap: 10px;
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.category-sheet__hint {
  font-size: 0.85rem;
  color: var(--muted);
}

.category-sheet__actions {
  display: flex;
  gap: 10px;
}

.category-sheet__actions .btn {
  min-height: 48px;
}

.category-sheet__actions [data-act='apply'] {
  flex: 1;
}

/* Celular: o painel sobe de baixo (gaveta), com a lista rolando no meio. */
@media (max-width: 600px) {
  .category-sheet {
    width: 100vw;
    max-width: none;
    max-height: 88dvh;
    margin: auto 0 0;
    border-width: 1px 0 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .category-sheet[open] {
    animation: sheet-up 0.25s var(--ease);
  }

  .category-sheet__options {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) and (min-width: 360px) {
  .category-sheet__options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-option {
    padding: 8px 10px;
    gap: 8px;
  }
}

@keyframes sheet-up {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .category-sheet[open] {
    animation: none;
  }
}

/* página da receita: categorias clicáveis */
.category-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.category-link {
  padding: 4px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.category-link:hover {
  border-color: var(--primary);
  color: var(--primary-text);
}

/* ---------- página da receita: ações do topo ---------- */

.recipe-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.recipe-hero__actions .recipe-hero__cta {
  margin-top: 0;
}

/* Secundário sobre a foto: vidro escuro com texto branco (contrasta com qualquer imagem). */
.recipe-hero__cta--secondary {
  --btn-bg: rgba(20, 15, 10, 0.42);
  --btn-fg: #ffffff;
  --btn-border: rgba(255, 255, 255, 0.55);
  background: rgba(20, 15, 10, 0.42);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.recipe-hero__cta--secondary:hover {
  background: rgba(20, 15, 10, 0.6);
  border-color: #ffffff;
}

.plan-badge--xs {
  margin-left: 4px;
  padding: 2px 7px;
  font-size: 0.68rem;
}

/* ---------- pastas de favoritas ---------- */

.folders {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.folders__bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 28px 8px 2px;
  scrollbar-width: thin;
  /* Esmaece a borda direita: pista de que a faixa rola para o lado. */
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent);
}

@media (min-width: 760px) {
  .folders__bar {
    flex-wrap: wrap;
    overflow: visible;
    padding-right: 2px;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

.folder-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.folder-chip:hover {
  border-color: var(--primary);
  text-decoration: none;
}

.folder-chip.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.folder-chip__count {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
}

.folder-chip.is-active .folder-chip__count {
  background: color-mix(in srgb, var(--on-primary) 22%, transparent);
  color: var(--on-primary);
}

.folder-chip--new {
  border-style: dashed;
  color: var(--primary-text);
}

.folder-chip--new[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
}

.folders__limit {
  font-size: 0.85rem;
  color: var(--muted);
}

.folder-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.folder-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 1.35rem;
}

.folder-head h2 span {
  overflow-wrap: anywhere;
}

.folder-dialog {
  width: min(460px, calc(100vw - 24px));
}

.folder-options {
  display: grid;
  gap: 10px;
}

.folder-options__list {
  display: grid;
  gap: 4px;
  max-height: 300px;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

.folder-options__item {
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.folder-options__item:hover {
  background: var(--surface-2);
}

.folder-options__item span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  overflow-wrap: anywhere;
}

/* Quantas receitas a pasta tem (cada pasta guarda até 10). */
.folder-options__item .folder-options__count {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.folder-options__item.is-full {
  opacity: 0.6;
  cursor: not-allowed;
}

.folder-options__item.is-full:hover {
  background: transparent;
}

.folder-options__empty,
.folder-options__limit {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---------- lista de compras ---------- */

.shopping-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.shopping-summary__text {
  display: grid;
  gap: 8px;
  flex: 1;
  min-width: 200px;
  color: var(--text-2);
}

.shopping-summary progress {
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 99px;
  overflow: hidden;
  appearance: none;
  background: var(--surface-3);
}

.shopping-summary progress::-webkit-progress-bar {
  background: var(--surface-3);
}

.shopping-summary progress::-webkit-progress-value {
  background: var(--accent);
}

.shopping-summary progress::-moz-progress-bar {
  background: var(--accent);
}

.shopping-summary.is-complete strong {
  color: var(--accent);
}

.shopping-groups {
  display: grid;
  gap: 14px;
}

@media (min-width: 900px) {
  .shopping-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

.shopping-group + .shopping-group {
  margin-top: 0;
}

.shopping-group__title {
  margin-bottom: 10px;
  font-size: 1.05rem;
}

.shopping-group__title a {
  color: var(--text);
}

.shopping-items {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.shopping-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 4px;
  border-bottom: 1px solid var(--border);
}

.shopping-item:last-child {
  border-bottom: 0;
}

.shopping-item__check {
  flex: 1;
  min-height: 36px;
  align-items: center;
}

.shopping-item.is-checked .shopping-item__check span {
  color: var(--muted);
  text-decoration: line-through;
}

.shopping-item__remove {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  color: var(--muted);
}

/* ---------- ajuste de porções (página da receita) ---------- */

.portion-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin: 4px 0 12px;
}

.portion-picker__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text-2);
}

.stepper--sm {
  grid-template-columns: 40px 52px 40px;
}

.stepper--sm .stepper__btn {
  min-height: 40px;
}

.stepper--sm .stepper__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.stepper__value {
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.link-btn {
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--primary-text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.portion-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--text-2);
  font-size: 0.88rem;
  line-height: 1.45;
}

.ingredient .is-scaled {
  color: var(--text);
  font-weight: 600;
}

/* ---------- lista compartilhada ---------- */

.sharing-panel {
  margin-bottom: 16px;
}

.sharing-members {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.sharing-member {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.sharing-member__name {
  display: grid;
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.sharing-member__name small {
  font-weight: 400;
  color: var(--muted);
}

.sharing-panel__empty {
  margin: 0 0 12px;
  color: var(--muted);
}

.sharing-panel__invite {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--text-2);
}

.sharing-panel__invite svg {
  flex: none;
  margin-top: 2px;
}

.sharing-panel__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.invite-card {
  max-width: 560px;
  margin: 24px auto;
  text-align: center;
}

.invite-card__icon {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-text);
}

.invite-card h1 {
  margin: 0 0 8px;
  font-size: 1.45rem;
  overflow-wrap: anywhere;
}

.invite-card p {
  color: var(--text-2);
  line-height: 1.5;
}

.invite-card .notice {
  text-align: left;
}

.invite-card__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 16px 0 8px;
}

/* ---------- metas e resumo nutricional (marmitas) ---------- */

@media (min-width: 1000px) {
  .meal-prep:has(.meal-prep__goals) {
    grid-template-rows: auto 1fr;
  }

  /* Com as metas embaixo, o formulário não gruda (passaria por cima delas). */
  .meal-prep:has(.meal-prep__goals) .meal-prep__form {
    position: static;
    grid-column: 1;
    grid-row: 1;
  }

  .meal-prep:has(.meal-prep__goals) .meal-prep__goals {
    grid-column: 1;
    grid-row: 2;
  }

  .meal-prep:has(.meal-prep__goals) .meal-prep__plan {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

.goal-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field--compact label {
  font-size: 0.85rem;
}

.field--compact input {
  min-width: 0;
}

.goal-person {
  margin: 0 0 12px;
  padding: 10px 12px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.goal-person legend {
  padding: 0 6px;
  font-weight: 700;
}

.goal-consent {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.88rem;
  line-height: 1.45;
}

.goal-consent[hidden],
[data-goal-block][hidden] {
  display: none;
}

.nutri-avg {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}

.nutri-avg__item {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
  text-align: center;
}

.nutri-avg__item strong {
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

.nutri-avg__item span {
  font-size: 0.8rem;
  color: var(--muted);
}

.nutri-people {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.nutri-person {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.nutri-person__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.nutri-person__none {
  margin: 0;
  font-size: 0.88rem;
}

.nutri-bar + .nutri-bar {
  margin-top: 8px;
}

.nutri-bar__text {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 10px;
  font-size: 0.85rem;
  color: var(--text-2);
}

.nutri-bar progress {
  width: 100%;
  height: 8px;
  margin-top: 4px;
  accent-color: var(--accent);
}

.nutri-days {
  margin: 0 0 16px;
}

.nutri-days summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--primary-text);
}

.table-scroll {
  margin-top: 8px;
  overflow-x: auto;
}

.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

.table-scroll th,
.table-scroll td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}

.table-scroll th[scope='row'],
.table-scroll thead th:first-child {
  text-align: left;
}

/* ---------- top 10 da semana (home) ---------- */

.weekly-top {
  margin: 8px 0 28px;
}

.weekly-top[hidden] {
  display: none;
}

.weekly-top__head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 1.35rem;
}

.weekly-top__head h2 svg {
  color: var(--primary);
}

.weekly-top__head p {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.top-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 200px;
  gap: 14px;
  margin: 0;
  padding: 4px 2px 12px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.top-strip > li {
  scroll-snap-align: start;
  min-width: 0;
}

.top-card {
  display: grid;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.top-card:hover,
.top-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgb(0 0 0 / 0.08);
}

.top-card__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
}

.top-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.top-card__placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--primary-text);
  background: var(--primary-soft);
}

.top-card__rank {
  position: absolute;
  left: 10px;
  bottom: -14px;
  display: grid;
  place-items: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border: 3px solid var(--surface);
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.top-strip > li:nth-child(-n + 3) .top-card__rank {
  min-width: 42px;
  height: 42px;
  font-size: 1.15rem;
}

.top-card__body {
  display: grid;
  gap: 4px;
  padding: 20px 12px 12px;
}

.top-card__title {
  display: -webkit-box;
  font-weight: 700;
  line-height: 1.3;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.top-card__meta {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 520px) {
  .top-strip {
    grid-auto-columns: 160px;
    gap: 10px;
  }
}

/* ---------- baixar PDF das marmitas ---------- */

.meal-plan__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- comunidade: @username, sininho, vídeo, parceiros e denúncias ---------- */

.account {
  display: flex;
  align-items: center;
  gap: 6px;
}

.handle {
  color: var(--muted);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.social-profile__handle {
  margin: 2px 0 6px;
}

/* Sininho de avisos no topo. */
.bell {
  position: relative;
}

.bell.is-active {
  color: var(--primary);
}

.bell__badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}

.bell__badge[hidden] {
  display: none;
}

/* Campo com "@" fixo na frente. */
.input-prefix {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}

.input-prefix:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
}

.input-prefix__symbol {
  display: grid;
  place-items: center;
  padding: 0 4px 0 12px;
  color: var(--muted);
  font-weight: 700;
}

.input-prefix input {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  outline: none;
  padding-left: 2px;
}

.input-prefix input:focus {
  box-shadow: none;
}

.input-prefix:has(input[aria-invalid='true']) {
  border-color: var(--danger);
}

.input-prefix:has(input:disabled) {
  background: var(--surface-2);
}

.username-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 1.2em;
  font-size: 0.86rem;
  color: var(--muted);
}

.username-status:empty {
  display: none;
}

.username-status--ok {
  color: var(--accent);
}

.username-status--error {
  color: var(--danger);
}

.username-status .icon {
  flex-shrink: 0;
}

.username-status__suggestions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: 100%;
  color: var(--text-2);
}

.username-status__spinner {
  width: 12px;
  height: 12px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--primary);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

.chip--sm {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.chip--sm:hover,
.chip--sm:focus-visible {
  border-color: var(--primary);
  background: var(--primary-soft);
}

/* Vídeo do YouTube na página da receita. */
.recipe-video {
  display: grid;
  gap: 8px;
  max-width: 880px;
  margin: 0 auto 28px;
}

.recipe-video--short {
  /* Shorts é vertical: estreito e centralizado, sem passar da altura da tela. */
  width: min(100%, 360px, calc((100svh - var(--header-h) - var(--tabbar-h) - 120px) * 9 / 16));
  min-width: min(100%, 240px);
}

.recipe-video__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-md);
}

.recipe-video--short .recipe-video__frame {
  aspect-ratio: 9 / 16;
}

.recipe-video__facade {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  padding: 0;
  border: 0;
  background: #000;
  color: #fff;
  cursor: pointer;
}

.recipe-video__facade img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.88;
  transition: opacity 0.2s var(--ease), transform 0.4s var(--ease);
}

.recipe-video__facade:hover img,
.recipe-video__facade:focus-visible img {
  opacity: 1;
  transform: scale(1.02);
}

.recipe-video__facade:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: -3px;
}

.recipe-video__play {
  position: relative;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.recipe-video__play .icon {
  margin-left: 4px;
  fill: currentColor;
}

.recipe-video__label {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  font-size: 0.85rem;
  font-weight: 650;
}

.recipe-video__player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.recipe-video__note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.recipe-video--short .recipe-video__note {
  justify-content: center;
  text-align: center;
}

/* Prévia no formulário. */
.video-field {
  display: flex;
  gap: 8px;
  align-items: center;
}

.video-field input {
  flex: 1;
  min-width: 0;
}

.video-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  font-size: 0.88rem;
  color: var(--accent);
}

.video-preview[hidden] {
  display: none;
}

.video-preview img {
  width: 120px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: #000;
}

.video-preview--short img {
  width: 64px;
  aspect-ratio: 9 / 16;
}

.video-preview span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.video-preview__warn {
  color: var(--gold-text);
}

.recipe-card__video {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
}

.recipe-card__video .icon {
  margin-left: 2px;
  fill: currentColor;
}

/* Parceiros na capa da receita. */
.recipe-collab {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.9rem;
}

.recipe-collab a,
.recipe-collab span[title] {
  color: #fff;
  font-weight: 700;
}

.recipe-collab__leave {
  color: #fff;
  font-size: 0.86rem;
  opacity: 0.9;
}

.detail-actions__report {
  margin-left: auto;
  color: var(--muted);
}

.detail-actions__report[hidden] {
  display: none;
}

.moderation-notice {
  margin: -8px 0 24px;
}

/* Painel de parceiros. */
.collab-dialog__title {
  margin: 14px 0 6px;
  font-size: 0.92rem;
  color: var(--text-2);
}

.collab-dialog__title span {
  font-weight: 500;
  color: var(--muted);
}

.collab-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.collab-person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.collab-person__text {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.collab-person__text strong {
  overflow-wrap: anywhere;
}

.collab-person__meta {
  font-size: 0.82rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.collab-person__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.collab-status {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  white-space: nowrap;
}

.collab-status--accepted {
  background: var(--accent-soft);
  color: var(--accent);
}

.collab-status--pending {
  background: var(--gold-soft);
  color: var(--gold-text);
}

.collab-empty {
  padding: 10px 2px;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 420px) {
  .collab-person {
    flex-wrap: wrap;
  }

  .collab-person__actions {
    width: 100%;
  }
}

/* Denúncia. */
.report-dialog {
  width: min(480px, calc(100vw - 24px));
}

.report-reasons {
  display: grid;
  gap: 6px;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
}

.report-reason {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.report-reason:has(input:checked) {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.report-reason input {
  accent-color: var(--danger);
}

.report-dialog textarea {
  width: 100%;
  resize: vertical;
}

.report-dialog__urgent {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--text);
  font-size: 0.86rem;
}

.report-dialog__urgent[hidden] {
  display: none;
}

.report-dialog__urgent .icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--danger);
}

.moderation-notice {
  flex-wrap: wrap;
}

.moderation-notice .btn {
  flex-shrink: 0;
  align-self: center;
}

.report-dialog__note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.report-dialog__note .icon {
  flex-shrink: 0;
  margin-top: 2px;
}

/* Avisos. */
.notifications {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.notification {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.notification.is-unread {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface));
}

.notification__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-text);
}

.notification--warn .notification__icon {
  background: var(--gold-soft);
  color: var(--gold-text);
}

.notification__body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.notification__text,
.notification__meta,
.notification__hint,
.notification__state {
  margin: 0;
  overflow-wrap: anywhere;
}

.notification__meta,
.notification__hint,
.notification__state {
  font-size: 0.84rem;
  color: var(--muted);
}

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

.notifications__more {
  display: flex;
  justify-content: center;
  margin: 18px 0;
}

/* ---------- eletrodomésticos e utensílios (análises) ---------- */

.product-tabs .tabs__item {
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.product-tabs .tabs__item.is-active {
  background: var(--surface);
}

.product-filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.product-filters .field {
  margin: 0;
}

.product-filters select,
.product-filters input {
  width: 100%;
}

@media (min-width: 761px) {
  .product-filters {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) minmax(0, 1fr) auto;
    align-items: center;
  }
}

.product-results__count {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Nota do autor: verde (boa), dourada (média), vermelha (baixa). */
.score-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 800;
  line-height: 1.1;
  box-shadow: var(--shadow-sm);
  font-variant-numeric: tabular-nums;
}

.score-badge strong {
  font-size: 1.05rem;
}

.score-badge small {
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.8;
}

.score-badge--good {
  background: var(--accent-soft);
  color: var(--accent);
}

.score-badge--mid {
  background: var(--gold-soft);
  color: var(--gold-text);
}

.score-badge--low {
  background: var(--danger-soft);
  color: var(--danger);
}

.score-badge--lg {
  padding: 8px 16px;
}

.score-badge--lg strong {
  font-size: 2rem;
}

.score-badge--lg small {
  font-size: 0.95rem;
}

.recipe-card__media .score-badge {
  position: absolute;
  top: 12px;
  right: 56px;
}

.product-card__flag {
  background: var(--danger);
}

.product-card__excerpt {
  margin: 0;
  color: var(--text-2);
  font-size: 0.88rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 18px;
}

.product-hero__media {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-md);
}

.product-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.product-hero__content h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  line-height: 1.15;
  margin: 0;
  overflow-wrap: anywhere;
}

.product-hero__brand {
  margin: 0;
  color: var(--text-2);
  font-size: 1.05rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.product-hero__date {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (min-width: 880px) {
  .product-hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 32px;
  }
}

.product-score {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 360px;
}

.product-score__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-2);
}

.score-meter {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.score-meter span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition: width 0.6s var(--ease);
}

.score-meter--good span {
  background: var(--accent);
}

.score-meter--mid span {
  background: var(--gold-2);
}

.score-meter--low span {
  background: var(--danger);
}

.product-review p {
  margin: 0 0 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.product-review__empty {
  color: var(--muted);
  font-style: italic;
}

.score-picker {
  display: flex;
  align-items: center;
  gap: 16px;
}

.score-picker input[type='range'] {
  flex: 1;
  accent-color: var(--primary);
  min-height: 32px;
}

.score-picker__value {
  min-width: 96px;
  display: flex;
  justify-content: flex-end;
}

.score-picker__scale {
  display: flex;
  justify-content: space-between;
  margin-right: 112px;
  color: var(--muted);
  font-size: 0.8rem;
}

.form-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 4px 2px 0;
}

.form-note .icon {
  flex: none;
  margin-top: 2px;
}

.shopping-group__title .icon {
  vertical-align: -3px;
  margin-right: 6px;
  color: var(--primary-text);
}

@media (prefers-reduced-motion: reduce) {
  .score-meter span {
    transition: none;
  }
}

/* Autor na página do produto: fundo claro (o .recipe-author foi feito para a foto). */
.product-hero .recipe-author {
  margin-top: 4px;
}

.product-hero .recipe-author__link {
  background: var(--surface-2);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: var(--text);
}

.product-hero .recipe-author__link:hover {
  background: var(--surface-3);
}

.product-hero .recipe-author .follow-btn.btn--soft {
  --btn-bg: var(--surface-2);
  background: var(--surface-2);
  color: var(--text-2);
}

/* ---------- Equipamentos usados na receita ---------- */

.recipe-gear__hint {
  margin: -6px 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.gear-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.gear-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px 12px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.gear-card:hover,
.gear-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.gear-card__media,
.gear-option__media {
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--primary-soft);
  color: var(--primary-text);
}

.gear-card__media {
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
}

.gear-card__media img,
.gear-option__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gear-card__body,
.gear-option__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gear-card__category {
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.gear-card__title,
.gear-option__body strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 0.98rem;
  line-height: 1.25;
}

.gear-card__brand,
.gear-option__body span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.85rem;
}

.gear-card .score-badge,
.gear-option .score-badge {
  flex: none;
}

/* Seletor no formulário da receita */
.gear-picker__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

.gear-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.gear-option:hover {
  border-color: var(--border-strong);
}

.gear-option:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.gear-option.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.gear-option__media {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
}

.gear-option__check {
  position: absolute;
  top: -8px;
  right: -8px;
  display: none;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-sm);
}

.gear-option.is-selected .gear-option__check {
  display: grid;
}

.gear-picker__selected {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--border-strong);
}

.gear-picker__label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.gear-picker__search {
  margin-bottom: 14px;
}

.gear-picker__empty {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted);
}

.gear-picker__empty p {
  margin: 0;
}

@media (max-width: 480px) {
  .gear-list,
  .gear-picker__grid {
    grid-template-columns: 1fr;
  }
}
