/* ============================================================
   Minha Listinha — sistema visual "papel e rosa terroso"
   ------------------------------------------------------------
   Redesign completo (set/2026). A gramatica e sempre a mesma, em
   toda tela:

     saudacao -> cartao-herói (o numero que importa) -> filtros em
     pilula -> cartoes de secao -> nav flutuante com o "+"

   Cor: papel quente em degrade, tinta marrom-escura e UM acento
   rosa profundo. Nada de lilas - o feminino vem do rosa terroso
   sobre papel, de tipografia e de ritmo, nao de saturacao.

   Tipo: Instrument Serif SO em numero-heroi e titulo de tela;
   Karla em todo o resto, com caixa-alta espacada nos rotulos.

   Forma: cartoes translucidos brancos (raio 24) sobre o papel,
   heroi raio 28, pilulas 999.

   Emoji sobrevive em dois lugares: rotulo de categoria e nav.
   ============================================================ */

/* ============ Design tokens (base = claro) ============ */
:root {
  /* papel */
  --paper-1: #F7EDE4;
  --paper-2: #FBF6F2;
  --paper-3: #FEFAF7;
  --bg: #FBF6F2;

  /* tinta */
  --ink: #3B2E2C;
  --ink-2: #5E4A46;
  --ink-soft: #7A6560;
  --ink-done: #8C7A75;
  --strike: #D8C7BE;

  /* acento (um so) */
  --accent: #B4566B;
  --accent-deep: #8E3A4E;
  --accent-strong: #A8455C;
  --accent-light: #C0748C;
  --accent-wash: #F7E7E9;
  --accent-wash-line: #EFD5D8;
  --accent-wash-ink: #8A5560;
  --hero-grad: linear-gradient(140deg, #B4566B 0%, #8E3A4E 82%);
  --hero-border: transparent;
  --on-accent: #FBF6F2;

  /* superficies */
  --card: rgba(255, 255, 255, 0.82);
  --card-solid: #ffffff;
  --card-border: rgba(255, 255, 255, 0.9);
  --line: #EFE2DA;
  --line-soft: #F0E5DE;
  --line-strong: #E7D8D0;
  --fill-soft: #F5EBE5;
  --tile: #F5E9E3;
  --check-empty: #E0CFC6;
  --neutral-bar: #EBD9D2;
  --neutral-bar-2: #DCC6BE;
  --row-flag: #FDF6F7;

  /* semantico - continua existindo, mas dessaturado pro papel */
  --success: #4E8A6B;
  --success-wash: #E4F0E8;
  --warn: #A9782F;
  --warn-wash: #F7EEDD;
  --danger: #B4483F;
  --danger-wash: #F8E4E1;

  /* forma */
  --radius-hero: 28px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --radius-xs: 12px;

  /* sombra - no claro os cartoes flutuam por sombra */
  --shadow-hero: 0 18px 34px -22px rgba(120, 50, 65, 0.75);
  --shadow-soft: 0 14px 28px -22px rgba(120, 60, 50, 0.5);
  --shadow-card: 0 8px 20px -16px rgba(120, 60, 50, 0.55);
  --shadow-nav: 0 12px 28px -18px rgba(120, 60, 50, 0.5);
  --shadow-sheet: 0 -20px 40px -24px rgba(80, 40, 35, 0.4);

  /* tipo */
  --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-body: 'Karla', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: var(--font-body); /* compat: classes antigas ainda pedem */

  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --keyboard-offset: 0px;
  --app-viewport-height: 100dvh;
  --nav-height: 74px;
}

/* ============ Modo escuro ============
 * O escuro nao e o claro invertido: mesmo layout, mesmas proporcoes,
 * so a base troca. Duas regras que valem pra tudo aqui:
 *   1) o acento CLAREIA (#B4566B -> #DE8A9F) - rosa escuro morre
 *      sobre fundo escuro;
 *   2) BORDA no lugar de sombra - sombra em fundo escuro nao separa
 *      nada.
 * Emoji nao perde opacidade aqui (no escuro, opacidade apaga o glifo). */
:root[data-theme="dark"] {
  --paper-1: #2A2123;
  --paper-2: #221B1C;
  --paper-3: #1E1819;
  --bg: #221B1C;

  --ink: #F2E9E4;
  --ink-2: #B5A29C;
  --ink-soft: #B5A29C;
  --ink-done: #9C8B86;
  --strike: #5A4B48;

  --accent: #DE8A9F;
  --accent-deep: #7C2E42;
  --accent-strong: #F0AEBD;
  --accent-light: #C4707F;
  --accent-wash: #4A2B33;
  --accent-wash-line: #5C3740;
  --accent-wash-ink: #E6BCC5;
  --hero-grad: linear-gradient(140deg, #B4566B 0%, #7C2E42 82%);
  --hero-border: #C4707F;
  --on-accent: #FBF6F2;

  --card: #322829;
  --card-solid: #322829;
  --card-border: #3E3234;
  --line: #3E3234;
  --line-soft: #3E3234;
  --line-strong: #4A3C3E;
  --fill-soft: #3A2F30;
  --tile: #3A2F30;
  --check-empty: #5A4B48;
  --neutral-bar: #4A3C3E;
  --neutral-bar-2: #5A4B48;
  --row-flag: #3A2A2E;

  --success: #7FBF9C;
  --success-wash: #26362E;
  --warn: #D8B472;
  --warn-wash: #3A3226;
  --danger: #E89189;
  --danger-wash: #422A28;

  --shadow-hero: none;
  --shadow-soft: none;
  --shadow-card: none;
  --shadow-nav: none;
  --shadow-sheet: 0 -20px 40px -24px rgba(0, 0, 0, 0.6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper-1: #2A2123;
    --paper-2: #221B1C;
    --paper-3: #1E1819;
    --bg: #221B1C;

    --ink: #F2E9E4;
    --ink-2: #B5A29C;
    --ink-soft: #B5A29C;
    --ink-done: #9C8B86;
    --strike: #5A4B48;

    --accent: #DE8A9F;
    --accent-deep: #7C2E42;
    --accent-strong: #F0AEBD;
    --accent-light: #C4707F;
    --accent-wash: #4A2B33;
    --accent-wash-line: #5C3740;
    --accent-wash-ink: #E6BCC5;
    --hero-grad: linear-gradient(140deg, #B4566B 0%, #7C2E42 82%);
    --hero-border: #C4707F;
    --on-accent: #FBF6F2;

    --card: #322829;
    --card-solid: #322829;
    --card-border: #3E3234;
    --line: #3E3234;
    --line-soft: #3E3234;
    --line-strong: #4A3C3E;
    --fill-soft: #3A2F30;
    --tile: #3A2F30;
    --check-empty: #5A4B48;
    --neutral-bar: #4A3C3E;
    --neutral-bar-2: #5A4B48;
    --row-flag: #3A2A2E;

    --success: #7FBF9C;
    --success-wash: #26362E;
    --warn: #D8B472;
    --warn-wash: #3A3226;
    --danger: #E89189;
    --danger-wash: #422A28;

    --shadow-hero: none;
    --shadow-soft: none;
    --shadow-card: none;
    --shadow-nav: none;
    --shadow-sheet: 0 -20px 40px -24px rgba(0, 0, 0, 0.6);
  }
}

/* ============ Base ============ */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

::selection { background: var(--accent); color: var(--on-accent); }

html, body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  overscroll-behavior-y: contain;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper-2);
  background-image: linear-gradient(178deg, var(--paper-1) 0%, var(--paper-2) 46%, var(--paper-3) 100%);
  background-attachment: fixed;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}
button { cursor: pointer; }

/* numeros que ficam em coluna nunca podem "dancar" */
.item__price, .categoryGroup__total, .totalCard__value, .heroCard__value,
.marketRow__subtotal, .compareRow__subtotal, .summaryRow__value,
.historyMonthCard__total, .historyTimelineRow__value, .invRow__qty,
.recipeCard__price, .heroCard__metaRight {
  font-variant-numeric: tabular-nums;
}

.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-height) + 34px + var(--safe-bottom));
  position: relative;
  z-index: 1;
}

.view--hidden { display: none; }


/* ============ Rotulo de secao (caixa-alta espacada) ============ */
.sectionLabel,
.field__label,
.catalogGroup__title,
.invSection,
.nailBrandGroup__title,
.summarySection__title,
.totalCard__label,
.heroCard__label {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ============ Cabecalho de tela (saudacao) ============
 * Era um bloco em degrade rosa/lilas ocupando o topo inteiro. Agora e
 * so papel: uma linha de apoio pequena e o titulo em serifa. O peso
 * visual do topo passou pro cartao-heroi logo abaixo. */
.header {
  position: relative;
  padding: calc(14px + var(--safe-top)) 20px 0;
  background: none;
  border-radius: 0;
  overflow: visible;
}
/* blobs decorativos do cabecalho antigo nao existem mais */
.header__blob { display: none; }
.header::after { content: none; }

.header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
  padding-left: 0;
}

.header__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.1;
  color: var(--ink);
  margin: 0;
  letter-spacing: 0;
  text-shadow: none;
}
.header__emoji { margin-right: 2px; }

/* linha de apoio acima do titulo ("sabado, 7 de setembro", "34 na
 * colecao - 6 desejados", ...) */
.header__eyebrow {
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.header__iconBtn {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: none;
  transition: transform 0.15s ease, background 0.15s ease;
}
.header__iconBtn:active { transform: scale(0.92); background: var(--fill-soft); }
.header__actions { display: flex; align-items: center; gap: 8px; }

/* ============ Recado da Dudda ============
 * Abre a tela principal: a saudacao do relogio ("Bom dia, Dudda") e uma
 * frase do Israel, sorteada a cada abertura do app. O cartao inteiro e um
 * botao - tocar troca a frase. Fica em papel rosado (accent-wash) pra nao
 * disputar atencao com o cartao-heroi em degrade logo abaixo. */
.loveNote {
  display: block;
  width: calc(100% - 40px);
  margin: 16px auto 0;
  padding: 16px 18px 14px;
  text-align: left;
  background: var(--accent-wash);
  border: 1px solid var(--accent-wash-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease;
}
.loveNote:active { transform: scale(0.99); }

/* so nos pedidos de desculpa - o recado de amor nao leva rotulo */
.loveNote__tag {
  display: block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--accent-wash-ink);
  margin-bottom: 9px;
}

.loveNote__hi {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 21px;
  line-height: 1.1;
  color: var(--accent-strong);
  margin-bottom: 7px;
}

.loveNote__msg {
  display: block;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--accent-wash-ink);
}

.loveNote__sign {
  display: block;
  margin-top: 8px;
  text-align: right;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent-strong);
}

/* ============ Album "Nos" ============
 * Linha do tempo das fotos do casal: uma lembranca sorteada no topo, o
 * contador de dias, e um bloco por ano do mais antigo pro mais novo (descer
 * a tela = andar no tempo). Fotos sao arquivos estaticos em album/, nao
 * passam pelo IndexedDB. */
.albumCorpo { padding: 0 20px; }

/* ---- a lembranca do topo ---- */
.lembranca {
  display: block;
  position: relative;
  width: 100%;
  margin-top: 16px;
  padding: 0;
  border: 1px solid var(--hero-border);
  border-radius: var(--radius-hero);
  overflow: hidden;
  background: var(--tile);
  box-shadow: var(--shadow-hero);
  transition: transform 0.18s ease;
}
.lembranca:active { transform: scale(0.99); }
.lembranca__foto {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
/* o degrade e o que garante que o texto se leia em foto clara ou escura -
 * sem ele a legenda some em foto de dia */
.lembranca__veu {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 54px 18px 16px;
  text-align: left;
  background: linear-gradient(to top, rgba(20, 10, 12, 0.82) 0%, rgba(20, 10, 12, 0.5) 45%, rgba(20, 10, 12, 0) 100%);
}
.lembranca__tag {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 4px;
}
.lembranca__data {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 23px;
  line-height: 1.1;
  color: #fff;
}
.lembranca__quando {
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}

/* ---- contador de dias ---- */
.contadorDias {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin: 18px 0 4px;
}
.contadorDias__num {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 40px;
  line-height: 1;
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}
.contadorDias__label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

/* ---- um bloco por ano ---- */
.albumAno { margin-top: 26px; }
.albumAno__topo {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}
.albumAno__num {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 26px;
  line-height: 1;
  color: var(--ink);
  margin: 0;
}
/* a linha entre o ano e a nota costura os blocos numa fita so, em vez de
 * cada ano virar uma ilha */
.albumAno__topo::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.albumAno__nota {
  order: 3;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
}

.albumGrade {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.albumGrade__item {
  display: block;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--tile);
  transition: transform 0.16s ease;
}
.albumGrade__item:active { transform: scale(0.97); }
.albumGrade__foto {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.albumFim {
  margin: 30px 0 10px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink-soft);
}

/* ---- foto em tela cheia ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  /* preto solido nos dois temas: aqui quem manda e a foto, nao o papel */
  background: #0E090A;
  padding: calc(10px + var(--safe-top)) 10px calc(10px + var(--safe-bottom));
}
.lightbox__fechar {
  position: absolute;
  top: calc(10px + var(--safe-top));
  right: 12px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 16px;
}
.lightbox__palco {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox__foto {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}
.lightbox__pe {
  flex: none;
  text-align: center;
  padding-top: 14px;
  color: #fff;
}
.lightbox__data {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.15;
}
.lightbox__quando {
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.62);
  margin-top: 2px;
}
.lightbox__passos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 10px;
}
.lightbox__seta {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 20px;
  line-height: 1;
}
.lightbox__seta:disabled { opacity: 0.28; }
.lightbox__conta {
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.62);
  font-variant-numeric: tabular-nums;
  min-width: 66px;
}

/* ============ Cartao-heroi ============
 * Um por tela, sempre com O numero que importa: total do carrinho,
 * gasto do mes, quanto esta reservado em presentes. Degrade rosa
 * profundo, numero em Instrument Serif, barra de progresso opcional. */
.totalCard,
.heroCard {
  position: relative;
  overflow: hidden;
  background: var(--hero-grad);
  border: 1px solid var(--hero-border);
  border-radius: var(--radius-hero);
  padding: 22px;
  margin-top: 18px;
  color: var(--on-accent);
  box-shadow: var(--shadow-hero);
  text-align: left;
  transition: transform 0.18s ease;
}
/* circulo de luz no canto - o unico ornamento que sobreviveu */
.totalCard::before,
.heroCard::before {
  content: '';
  position: absolute;
  top: -42px;
  right: -30px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.11);
  pointer-events: none;
}
.totalCard > *, .heroCard > * { position: relative; }

.totalCard.pulse { animation: totalPulse 0.4s ease; }
@keyframes totalPulse {
  0% { transform: scale(1); }
  35% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.totalCard__label,
.heroCard__label {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--on-accent);
  margin-bottom: 12px;
}

.totalCard__value,
.heroCard__value {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 48px;
  line-height: 0.86;
  letter-spacing: -0.01em;
  color: var(--on-accent);
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.totalCard__value span:first-child,
.heroCard__value span:first-child {
  font-size: 17px;
  line-height: 1;
  vertical-align: baseline;
  margin-right: 0;
  color: var(--on-accent);
}

.totalCard__sub,
.heroCard__sub {
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--on-accent);
  opacity: 0.95;
  margin-top: 10px;
}

/* barra de progresso do heroi (quanto do orcamento ja foi) */
.heroCard__bar {
  margin-top: 16px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.26);
  overflow: hidden;
}
.heroCard__barFill {
  height: 100%;
  border-radius: 3px;
  background: var(--on-accent);
  transition: width 0.4s ease;
}
.heroCard__meta {
  margin-top: 8px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--on-accent);
}
.heroCard__action {
  margin-top: 16px;
  width: 100%;
  padding: 12px 0;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--on-accent);
  color: var(--accent-deep);
  font-weight: 700;
  font-size: 12.5px;
}

/* ============ Coluna de contexto ============
 * Mesmo DOM nas duas larguras. No celular .withRail e um bloco comum e a
 * coluna de contexto entrega so o cartao-heroi (o resto - o que acabou em
 * casa, a curva de gasto - fica escondido, porque no celular esse conteudo
 * mora nas telas de Estoque e Historico). A partir de 1180px ela vira a
 * coluna fixa da direita e o conteudo extra aparece. */
.withRail { display: block; }
/* no celular a coluna nao esta dentro de nenhum container com margem
 * lateral (o heroi saiu de dentro do .header no redesign), entao a margem
 * do papel vem daqui - no desktop ela e uma celula da grade e zera */
.contextRail { padding: 0 20px; }
.contextRail > .contextCard { display: none; }
/* no celular a acao de finalizar ja esta na linha de botoes abaixo do
 * heroi - dentro do cartao ela so aparece no painel do desktop */
.contextRail .heroCard__action { display: none; }

/* ============ Linha de acoes (era .monthBar) ============
 * Dois botoes largos logo abaixo do heroi: a acao principal e a
 * secundaria da tela. */
.monthBar {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 14px 20px 0;
  flex-wrap: wrap;
}
.monthBar__label {
  width: 100%;
  order: -1;
  border: none;
  background: none;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 11.5px;
  padding: 0 0 2px;
}
.monthBar__actions { display: flex; gap: 10px; width: 100%; }
.monthBar__btn {
  flex: 1;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 12.5px;
  padding: 13px 8px;
  border-radius: var(--radius-md);
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.monthBar__btn--primary {
  background: var(--card-solid);
  border-color: var(--line);
  color: var(--ink);
}
:root[data-theme="dark"] .monthBar__btn { border-color: var(--line); background: transparent; }
:root[data-theme="dark"] .monthBar__btn--primary { background: var(--card-solid); color: var(--ink); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .monthBar__btn { border-color: var(--line); background: transparent; }
  :root:not([data-theme="light"]) .monthBar__btn--primary { background: var(--card-solid); color: var(--ink); }
}

/* ============ Filtros em pilula ============ */
.filters {
  display: flex;
  gap: 7px;
  padding: 16px 20px 10px;
  margin-top: 0;
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
}

.chip {
  border: none;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 11.5px;
  line-height: 1;
  padding: 9px 15px;
  border-radius: 999px;
  box-shadow: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.chip--active {
  background: var(--ink);
  color: var(--paper-2);
  font-weight: 600;
}
:root[data-theme="dark"] .chip { background: transparent; border: 1px solid var(--line); }
:root[data-theme="dark"] .chip--active { background: var(--ink); color: var(--bg); border-color: transparent; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chip { background: transparent; border: 1px solid var(--line); }
  :root:not([data-theme="light"]) .chip--active { background: var(--ink); color: var(--bg); border-color: transparent; }
}

/* contador dentro da pilula ("A comprar · 1") */
.chip__count { opacity: 0.75; }

/* faixa da busca (Mercado): as outras telas poem a busca dentro do
 * .listWrap, que ja tem margem lateral - aqui ela e irma dos filtros */
.searchRow { padding: 0 20px 12px; }
.searchRow .catalogSearch { margin: 0; }

/* ============ Lista ============ */
.listWrap { padding: 0 20px; }

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* ============ Cartao de secao (categoria) ============
 * Cada categoria virou um cartao translucido com o total do grupo no
 * canto. Os itens sao linhas separadas por filete, dentro do cartao -
 * nao mais cartoes soltos empilhados. */
.categoryGroups { display: flex; flex-direction: column; gap: 14px; }

.categoryGroup {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
}

.categoryGroup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: none;
  background: none;
  border-radius: 0;
  padding: 0 0 10px;
  text-align: left;
  transition: opacity 0.15s ease;
}
.categoryGroup__header:active { opacity: 0.65; }
.categoryGroup__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
}
.categoryGroup__chevron {
  font-size: 11px;
  color: var(--ink-soft);
  transition: transform 0.18s ease;
}
.categoryGroup__chevron--collapsed { transform: rotate(-90deg); }
.categoryGroup__total {
  font-weight: 500;
  font-size: 11.5px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.categoryGroup__items { margin: 0; }

/* ============ Linha de item ============
 * O toque principal (marcar comprado) e um circulo grande a ESQUERDA,
 * no alcance do polegar. Preco a direita; quando nao tem preco, no
 * lugar dele vem um botao "+ valor" - que e a acao que falta. */
.item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  border-top: 1px solid var(--line-soft);
  border-radius: 0;
  padding: 10px 0;
  box-shadow: none;
  animation: itemIn 0.24s ease;
}

@keyframes itemIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.item--done { background: none; }
.item--done .item__name {
  color: var(--ink-done);
  text-decoration: line-through;
  text-decoration-color: var(--strike);
}
.item--done .item__meta { color: var(--ink-done); }
.item--done .item__price { color: var(--ink-done); font-weight: 500; }

.item__checkbox {
  flex: none;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 1.5px solid var(--check-empty);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.item__checkbox svg { opacity: 0; transform: scale(0.5); transition: all 0.15s ease; color: var(--on-accent); }
.item--done .item__checkbox {
  background: var(--accent);
  border-color: transparent;
}
:root[data-theme="dark"] .item--done .item__checkbox svg { color: var(--bg); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .item--done .item__checkbox svg { color: var(--bg); }
}
.item--done .item__checkbox svg { opacity: 1; transform: scale(1); }

.item__avatar {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--tile);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  overflow: hidden;
}
.item__avatar img { width: 100%; height: 100%; object-fit: cover; }

.item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
}

.item__name {
  font-weight: 500;
  font-size: 14.5px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item__meta {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--ink-soft);
  display: flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item__meta .tagCompare {
  background: var(--accent-wash);
  color: var(--accent-deep);
  border-radius: 999px;
  padding: 1px 8px;
  font-weight: 600;
  font-size: 10px;
}
:root[data-theme="dark"] .item__meta .tagCompare { color: var(--accent-strong); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .item__meta .tagCompare { color: var(--accent-strong); }
}

.item__price {
  flex: none;
  font-weight: 500;
  font-size: 14px;
  color: var(--ink);
  min-width: 56px;
  text-align: right;
}
/* sem preco = uma acao, nao um texto apagado */
.item__price--empty {
  padding: 7px 11px;
  border: none;
  border-radius: var(--radius-xs);
  background: var(--accent-wash);
  color: var(--accent-deep);
  font-weight: 600;
  font-size: 10.5px;
  min-width: 0;
}
:root[data-theme="dark"] .item__price--empty { color: var(--accent-strong); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .item__price--empty { color: var(--accent-strong); }
}

.item__delete {
  flex: none;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  opacity: 0.5;
  font-size: 14px;
  padding: 6px;
  border-radius: 50%;
  transition: all 0.15s ease;
}
.item__delete:active { opacity: 1; background: var(--danger-wash); }

/* ============ Telas vazias ============
 * Nenhum vazio decorativo: cada area diz o que vai guardar ali e
 * oferece a acao que tira a tela do zero. */
.emptyState {
  display: none;
  text-align: center;
  padding: 44px 24px;
  color: var(--ink-soft);
}
.emptyState.visible { display: block; }
.emptyState__icon {
  font-size: 30px;
  margin: 0 auto 14px;
  width: 66px;
  height: 66px;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.emptyState p {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.2;
  color: var(--ink);
}
/* .emptyState p acima poe a serifa grande na frase-titulo do vazio; a
 * dica embaixo volta pro corpo. Seletor com a mesma forca (classe + tag)
 * pra ganhar por ordem, sem !important. */
.emptyState p.emptyState__hint {
  font-family: var(--font-body);
  font-size: 12.5px;
  line-height: 1.55;
  font-weight: 400;
  color: var(--ink-soft);
  max-width: 280px;
  margin: 0 auto;
}
.emptyState__action {
  margin-top: 16px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--ink);
  color: var(--paper-2);
  font-weight: 600;
  font-size: 12.5px;
  padding: 13px 20px;
}

/* ============ Nav flutuante + "＋" ============
 * No celular a nav e uma barra branca flutuante: 3 areas, "Mais" (abre
 * a gaveta com as 7) e o "+" da tela atual. No desktop essa barra some
 * e a gaveta vira sidebar fixa. */
.quickNav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(8px + var(--keyboard-offset));
  z-index: 60;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 20px calc(24px + var(--safe-bottom));
  pointer-events: none;
}
.quickNav__bar {
  pointer-events: auto;
  background: var(--card-solid);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  box-shadow: var(--shadow-nav);
}
:root[data-theme="dark"] .quickNav__bar { border-color: var(--line); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .quickNav__bar { border-color: var(--line); }
}

.quickNav__btn {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  padding: 2px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--ink-2);
}
.quickNav__icon { font-size: 18px; line-height: 1; opacity: 0.5; }
.quickNav__label {
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}
.quickNav__btn--active { color: var(--accent); }
.quickNav__btn--active .quickNav__icon { opacity: 1; }
.quickNav__btn--active .quickNav__label { font-weight: 600; }
/* no escuro o emoji nao perde opacidade - opacidade apaga o glifo */
:root[data-theme="dark"] .quickNav__icon { opacity: 1; }
:root[data-theme="dark"] .quickNav__btn { color: var(--ink-soft); }
:root[data-theme="dark"] .quickNav__btn--active { color: var(--accent); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .quickNav__icon { opacity: 1; }
  :root:not([data-theme="light"]) .quickNav__btn { color: var(--ink-soft); }
  :root:not([data-theme="light"]) .quickNav__btn--active { color: var(--accent); }
}

.quickNav__fab {
  flex: none;
  width: 42px;
  height: 42px;
  margin-left: 4px;
  border: none;
  border-radius: 16px;
  background: var(--hero-grad);
  color: var(--on-accent);
  font-size: 23px;
  font-weight: 300;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}
.quickNav__fab:active { transform: scale(0.92); }
.quickNav__fab[hidden] { display: none; }

/* ============ Gaveta / sidebar com as 7 areas ============ */
.mobileNavBackdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(34, 27, 28, 0.42);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.mobileNavBackdrop--visible { opacity: 1; pointer-events: auto; }

.bottomNav {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 80;
  display: flex;
  width: min(78vw, 300px);
  max-width: none;
  margin: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  padding: calc(24px + var(--safe-top)) 16px 22px;
  background: var(--paper-2);
  background-image: linear-gradient(178deg, var(--paper-1) 0%, var(--paper-2) 60%);
  border-right: 1px solid var(--line);
  box-shadow: 8px 0 32px -20px rgba(80, 40, 35, 0.5);
  border-radius: 0 var(--radius-hero) var(--radius-hero) 0;
  transform: translateX(-105%);
  visibility: hidden;
  transition: transform 0.24s ease, visibility 0s linear 0.24s;
}
.bottomNav--open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.24s ease;
}

.bottomNav__brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  color: var(--ink);
  padding: 0 6px 22px;
  margin-bottom: 0;
  border-bottom: none;
}
.bottomNav__brandEmoji {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--accent-wash);
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bottomNav__footer { display: none; }

.bottomNav__btn {
  flex: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-radius: 13px;
  color: var(--ink-2);
  transition: background 0.15s ease, color 0.15s ease;
}
.bottomNav__icon {
  flex: none;
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  opacity: 0.55;
  box-shadow: none;
}
.bottomNav__label { font-size: 13px; font-weight: 500; }
.bottomNav__btn--active {
  color: var(--accent);
  background: var(--card-solid);
  box-shadow: 0 6px 14px -12px rgba(120, 60, 50, 0.6);
}
.bottomNav__btn--active .bottomNav__icon { opacity: 1; color: inherit; background: none; }
.bottomNav__btn--active .bottomNav__label { font-weight: 600; }
:root[data-theme="dark"] .bottomNav__icon { opacity: 1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bottomNav__icon { opacity: 1; }
}

/* contador ao lado do nome da area, na sidebar */
.bottomNav__count {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-wash);
  color: var(--accent-deep);
}
:root[data-theme="dark"] .bottomNav__count { color: var(--accent-strong); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bottomNav__count { color: var(--accent-strong); }
}

/* ============ FAB legado ============
 * Cada area vanilla ainda tem seu proprio .fab. No celular ele some (o
 * "+" mora na barra flutuante e dispara o clique nele); no desktop
 * volta como pilula ancorada no canto. */
.fab {
  position: fixed;
  right: 20px;
  bottom: calc(16px + var(--safe-bottom) + var(--keyboard-offset));
  width: 58px;
  height: 58px;
  border-radius: 20px;
  border: none;
  background: var(--hero-grad);
  color: var(--on-accent);
  box-shadow: var(--shadow-hero);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
  transition: transform 0.15s ease;
  max-width: none;
  margin: 0;
}
.fab:active { transform: scale(0.92); }
.fab--nails, .fab--recipes { background: var(--hero-grad); }

/* ============ Folhas inferiores (sheets) ============ */
.sheetOverlay {
  position: fixed;
  inset: 0;
  background: rgba(34, 27, 28, 0.42);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 100;
}
.sheetOverlay.open { opacity: 1; pointer-events: auto; }

/* Essas abrem POR CIMA de outra folha que ja pode estar aberta (ex:
 * editar mercado/data de dentro do Historico). Como todo .sheetOverlay
 * usa o mesmo z-index, quem ficava por cima dependia so da ordem no
 * HTML - e nesses casos a folha "de dentro" vem ANTES. */
#compareOverlay, #finishPurchaseOverlay, #recipeCategoryOverlay, #giftCategoryOverlay { z-index: 150; }
#teachOverlay { z-index: 200; }

.sheet {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: min(88vh, calc(var(--app-viewport-height) - 24px - var(--safe-top) - var(--safe-bottom)));
  overflow-y: auto;
  background: var(--paper-2);
  background-image: linear-gradient(178deg, var(--paper-3), var(--paper-2));
  border-radius: 30px 30px 0 0;
  padding: 10px 20px calc(28px + var(--safe-bottom));
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(.32,.72,.35,1);
  box-shadow: var(--shadow-sheet);
  border-top: 1px solid var(--line);
}
.sheetOverlay.open .sheet { transform: translateY(0); }

.sheet__handle {
  width: 42px;
  height: 4px;
  border-radius: 2px;
  background: var(--line-strong);
  margin: 6px auto 16px;
}

.sheet__close {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card-solid);
  color: var(--ink-soft);
  font-size: 14px;
}

/* titulo da folha, em serifa, com o contexto a direita */
.sheet__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.sheet__titleText {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 21px;
  line-height: 1;
  margin: 0;
}
.sheet__titleMeta { font-size: 11.5px; font-weight: 500; color: var(--ink-soft); }

.sheet__tabs {
  display: flex;
  gap: 4px;
  background: var(--fill-soft);
  padding: 4px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 0;
  border-radius: 999px;
  font-weight: 500;
  font-size: 12.5px;
  color: var(--ink-soft);
  transition: all 0.18s ease;
}
.tab--active {
  background: var(--card-solid);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-card);
}

/* No Historico sao 5 abas - vira uma faixa que rola na horizontal, com
 * os rotulos inteiros, em vez de espremer tudo. */
#historySheet .sheet__tabs { overflow-x: auto; scrollbar-width: none; }
#historySheet .sheet__tabs::-webkit-scrollbar { display: none; }
#historySheet .tab { flex: 0 0 auto; padding: 10px 16px; font-size: 12.5px; }

.sheet__form { display: flex; flex-direction: column; gap: 16px; }
.sheet__form--hidden { display: none; }

/* sugestoes de recorrentes no topo da folha de adicionar - o caminho de
 * 1 toque pra quem repete a mesma compra toda semana */
.addedSoFar {
  margin: 10px 0 0;
  padding: 10px 13px;
  border-radius: var(--radius-xs);
  background: var(--accent-wash);
  border: 1px solid var(--accent-wash-line);
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-2);
}
.addedSoFar strong { color: var(--ink); font-weight: 600; }

.quickPicks { margin: 12px 0 2px; }
.quickPicks__label { display: block; margin-bottom: 9px; }
.quickPicks__row { display: flex; flex-wrap: wrap; gap: 7px; }
.quickPicks__pill {
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card-solid);
  color: var(--ink);
  font-weight: 500;
  font-size: 12px;
}
.quickPicks__pill:active { background: var(--accent-wash); border-color: var(--accent-wash-line); }

/* ============ Campos ============ */
.field { display: flex; flex-direction: column; gap: 8px; }
.field__label { padding-left: 0; }
.field__label--group { margin-top: 4px; }

.field input, .field select, .field textarea {
  border: 1px solid var(--line);
  background: var(--card-solid);
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s ease;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }

.field__prefix {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card-solid);
  padding: 0 6px 0 14px;
  transition: border-color 0.15s ease;
}
.field__prefix:focus-within { border-color: var(--accent); }
.field__prefix span {
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 13px;
}
.field__prefix input {
  border: none;
  background: none;
  padding: 13px 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}
.field__prefix input:focus { border: none; }

.field2 { display: flex; gap: 10px; }
.field2 .field { flex: 1; }
.field--unit { max-width: 96px; }

.sheet__hint {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--accent-wash-ink);
  background: var(--accent-wash);
  border: 1px solid var(--accent-wash-line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin: 0;
}
.sheet__hint strong { color: var(--accent-deep); font-weight: 700; }
:root[data-theme="dark"] .sheet__hint strong { color: var(--accent-strong); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sheet__hint strong { color: var(--accent-strong); }
}

/* ============ Botoes ============ */
.btnPrimary {
  border: none;
  background: var(--ink);
  color: var(--paper-2);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.02em;
  padding: 16px;
  border-radius: var(--radius-md);
  box-shadow: none;
  margin-top: 4px;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.btnPrimary:active { transform: scale(0.98); }

.btnGhost {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 12.5px;
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-top: -2px;
}
.btnGhost:active { background: var(--fill-soft); }

.btnDanger {
  border: none;
  background: var(--danger-wash);
  color: var(--danger);
  font-weight: 600;
  font-size: 13px;
  padding: 13px;
  border-radius: var(--radius-md);
  margin-top: 6px;
}

.checkRow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  padding: 4px 2px;
}
.checkRow input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

/* ============ Comparar precos por mercado ============ */
.marketRows { display: flex; flex-direction: column; gap: 10px; }

.marketRow {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px 10px;
}
.marketRow input {
  border: none;
  background: none;
  padding: 6px 4px;
  font-size: 14px;
  outline: none;
  min-width: 0;
  border-radius: 8px;
}
.marketRow input:focus { box-shadow: 0 0 0 2px var(--accent-wash); }
.marketRow__market { flex: 1.3; }
.marketRow__price { flex: 1; font-weight: 600; color: var(--ink); }
.marketRow__subtotal {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--success);
  white-space: nowrap;
}
.marketRow__remove {
  flex: none;
  border: none;
  background: var(--fill-soft);
  color: var(--ink-soft);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheet--compare { padding-top: 10px; }
.compareTitle {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 400;
  margin: 4px 0 2px;
  padding-right: 30px;
}
.compareTitleInput {
  display: block;
  width: 100%;
  border: none;
  border-bottom: 1px dashed var(--line-strong);
  background: transparent;
  color: var(--ink);
  outline: none;
  border-radius: 0;
  padding: 0 0 4px;
}
.compareTitleInput:focus { border-bottom-color: var(--accent); }
.compareSubtitle { font-size: 11.5px; color: var(--ink-soft); margin: 0 0 14px; }

.comparePhotoRow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.comparePhotoPreview {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: var(--tile);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  overflow: hidden;
}
.comparePhotoPreview img { width: 100%; height: 100%; object-fit: cover; }

.compareWeightRow {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 14px;
  margin-bottom: 12px;
}
.compareWeightRow--visible { display: flex; }
.compareWeightRow input {
  width: 110px;
  border: none;
  background: none;
  outline: none;
  text-align: right;
  font-weight: 600;
  color: var(--ink);
  font-size: 15px;
}

.qtyStepper { display: flex; align-items: center; gap: 8px; }
.compareWeightRow .qtyStepper input { width: 64px; text-align: center; }
.qtyStepper--field {
  gap: 4px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px 10px;
  justify-content: space-between;
}
.qtyStepper--field input {
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  text-align: center;
  font-weight: 500;
  font-size: 15px;
  padding: 6px 0;
}
.qtyStepper--field input:focus { outline: none; }
.qtyStepper__btn {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: none;
  background: var(--fill-soft);
  color: var(--ink-soft);
  font-size: 17px;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.qtyStepper__btn:active { transform: scale(0.92); background: var(--accent); color: var(--on-accent); }

.compareRows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }

.compareRow {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 12px;
  transition: all 0.15s ease;
}
.compareRow--active {
  border-color: var(--accent);
  background: var(--accent-wash);
}
.compareRow__radio {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--check-empty);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}
.compareRow--active .compareRow__radio { border-color: var(--accent); background: var(--accent); }
.compareRow--active .compareRow__radio::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--on-accent);
}
.compareRow__market {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  padding: 4px;
  border-radius: 8px;
  outline: none;
}
.compareRow__price {
  flex: none;
  width: 78px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-align: right;
  padding: 4px;
  border-radius: 8px;
  outline: none;
}
.compareRow__market:focus, .compareRow__price:focus { box-shadow: 0 0 0 2px var(--accent-wash); }
.compareRow__subtotal {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--success);
  white-space: nowrap;
}
.compareRow__remove {
  flex: none;
  border: none;
  background: var(--fill-soft);
  color: var(--ink-soft);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 11px;
}

/* ============ Catalogo / picker ============ */
.field__labelRow { display: flex; align-items: center; justify-content: space-between; }

.catalogBtn {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 11px;
  padding: 7px 12px;
  border-radius: 999px;
  transition: transform 0.12s ease, background 0.12s ease;
}
.catalogBtn:active { transform: scale(0.95); background: var(--fill-soft); }

.sheet--catalog { padding-top: 10px; max-height: 82vh; }

.catalogSearch {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card-solid);
  border-radius: 16px;
  padding: 13px 16px;
  font-size: 14px;
  outline: none;
  margin: 0 0 12px;
}
.catalogSearch::placeholder { color: var(--ink-soft); }
.catalogSearch:focus { border-color: var(--accent); }

.catalogChips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.catalogChips .chip { flex: none; white-space: nowrap; }

.catalogList { display: flex; flex-direction: column; gap: 4px; padding-bottom: 6px; }

.catalogGroup { margin-bottom: 10px; }
.catalogGroup__title { padding: 12px 2px 8px; }

.catalogItemRow { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; }

.catalogItem {
  display: block;
  flex: 1;
  min-width: 0;
  width: 100%;
  text-align: left;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.12s ease;
}
.catalogItem:active { background: var(--accent-wash); border-color: var(--accent-wash-line); }
.catalogItem--custom { border-style: dashed; }
.catalogItem__tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-deep);
  background: var(--accent-wash);
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}
:root[data-theme="dark"] .catalogItem__tag { color: var(--accent-strong); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .catalogItem__tag { color: var(--accent-strong); }
}
.catalogItem__remove {
  flex: none;
  border: none;
  background: var(--fill-soft);
  color: var(--ink-soft);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 12px;
}

.catalogEmpty { text-align: center; margin-top: 24px; }

.catalogManage {
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.catalogManage--top {
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 16px;
  border-top: none;
  border-bottom: 1px solid var(--line);
}
.catalogManage__row { display: flex; gap: 8px; margin: 8px 0 10px; }
.catalogManage__row input {
  flex: 1.4;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--card-solid);
  border-radius: 14px;
  padding: 11px 12px;
  font-size: 13.5px;
  outline: none;
}
.catalogManage__row input:focus { border-color: var(--accent); }
.catalogManage__row select {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 6px;
  font-size: 12px;
  outline: none;
  background: var(--card-solid);
}

/* ============ Vitrine dentro do Mercado (faixa de fotos) ============ */
.bankStrip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 2px 4px;
  scrollbar-width: none;
}
.bankStrip::-webkit-scrollbar { display: none; }
.bankStrip__item {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 68px;
  border: none;
  background: none;
}
.bankStrip__photo {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--tile);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  overflow: hidden;
}
.bankStrip__photo img { width: 100%; height: 100%; object-fit: cover; }
.bankStrip__label {
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-soft);
  text-align: center;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bankAddForm { margin-top: 10px; }

/* ============ Sinal de sincronizacao + toast ============ */
.syncIndicator {
  position: fixed;
  top: calc(14px + var(--safe-top));
  right: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
  box-shadow: 0 0 0 3px var(--paper-2);
  z-index: 210;
  transition: background 0.3s ease;
}
.syncIndicator--idle { background: var(--success); }
.syncIndicator--syncing { background: var(--warn); animation: syncPulse 1s ease-in-out infinite; }
.syncIndicator--offline { background: var(--line-strong); }

@keyframes syncPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-height) + 42px + var(--safe-bottom) + var(--keyboard-offset));
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--paper-2);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 200;
  box-shadow: 0 12px 28px -14px rgba(34, 27, 28, 0.6);
  max-width: 90%;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast__undo {
  flex: none;
  border: none;
  background: none;
  color: var(--accent-strong);
  font-weight: 700;
  font-size: 12.5px;
  padding: 2px;
  text-decoration: underline;
}

/* ============ Atualizacao da PWA ============ */
.updateNotice {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--nav-height) + 30px + var(--safe-bottom) + var(--keyboard-offset));
  z-index: 220;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  border-radius: var(--radius-md);
  background: var(--card-solid);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.updateNotice--visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.updateNotice strong, .updateNotice span { display: block; }
.updateNotice strong { font-size: 13px; font-weight: 600; }
.updateNotice span { margin-top: 3px; color: var(--ink-soft); font-size: 11px; }
.updateNotice__btn {
  flex: none;
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper-2);
  font-weight: 600;
  font-size: 11.5px;
}

/* ============ Historico e gastos ============ */
.sheet--history { padding-top: 10px; max-height: 84vh; }

.historyPane { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.historyPane--hidden { display: none; }

/* cada compra e um cartao com a "etiqueta de data" a esquerda */
.historyMonthCard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--card-border);
  background: var(--card);
  border-radius: 22px;
  padding: 15px 16px;
}
.historyMonthCard__body { flex: 1; min-width: 0; }
.historyMonthCard__label { font-weight: 600; font-size: 14px; flex: 1; }

/* etiqueta de data a esquerda do cartao de compra */
.dateTile {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: var(--tile);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.dateTile__day { font-size: 14px; font-weight: 600; line-height: 1; color: var(--accent-deep); }
.dateTile__month {
  margin-top: 2px;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
:root[data-theme="dark"] .dateTile__day { color: var(--accent); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .dateTile__day { color: var(--accent); }
}
.historyMonthCard__label--detail {
  padding: 4px 2px 10px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 21px;
}
.historyDetailDate { margin: -8px 0 12px; font-size: 11.5px; color: var(--ink-soft); }
.historyEditPurchase { margin-bottom: 0; }
.historyDetailHint { margin: 0 0 6px; font-size: 11.5px; color: var(--ink-soft); }
.historyMonthCard__meta { font-size: 11px; color: var(--ink-soft); }
.historyMonthCard__total {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--ink);
  font-size: 17px;
}

.historyBack {
  border: 1px solid var(--line);
  background: var(--card-solid);
  color: var(--ink-2);
  font-weight: 500;
  font-size: 12px;
  padding: 9px 14px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.historyItemRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: none;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  padding: 11px 4px;
  font-size: 13.5px;
  color: inherit;
}
.historyItemRow strong { color: var(--ink); font-weight: 600; flex: none; }
.historyItemRow__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.historyItemRow__name { color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.historyItemRow__meta { font-size: 11.5px; color: var(--ink-soft); }
.historyItemRow__right { display: flex; align-items: center; gap: 6px; flex: none; }
.historyItemRow__act {
  border: 1px solid var(--line);
  background: var(--card-solid);
  border-radius: 10px;
  width: 30px;
  height: 30px;
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.historyItemRow__act:active { background: var(--accent-wash); }

/* detalhe da compra: editar / repetir lado a lado */
.historyDetailActions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.historyDetailActions .btnGhost { flex: 1 1 auto; margin: 0; }

.historyFooter {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.historyDanger {
  border: none;
  background: transparent;
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
  padding: 6px;
  text-decoration: underline;
}

.historyProduct {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.historyProduct__name { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.historyProduct__summary {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.historyTimelineRow { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.historyTimelineRow:last-child { border-bottom: none; }
.historyTimelineRow__top,
.historyTimelineRow__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.historyTimelineRow__bottom { margin-top: 2px; }
.historyTimelineRow__month { font-size: 12.5px; font-weight: 500; color: var(--ink); }
.historyTimelineRow__market { font-size: 11px; color: var(--ink-soft); }
.historyTimelineRow__value { font-weight: 600; color: var(--ink); font-size: 13px; }

/* variacao de preco: subiu / caiu - o unico lugar onde a cor grita */
.priceDelta {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.priceDelta--up { background: var(--danger-wash); color: var(--danger); }
.priceDelta--down { background: var(--success-wash); color: var(--success); }
.priceDelta--alert { background: var(--danger-wash); color: var(--danger); font-weight: 800; }

.historyAlertBanner {
  background: var(--accent-wash);
  border: 1px solid var(--accent-wash-line);
  color: var(--accent-wash-ink);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 12px;
}

/* grade de meses (calendario de gastos) */
.historyCalendarGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.historyCalendarCell {
  border: 1px solid var(--line);
  background: var(--card-solid);
  border-radius: var(--radius-sm);
  padding: 12px 6px;
  text-align: center;
}
.historyCalendarCell--filled { background: var(--accent-wash); border-color: var(--accent-wash-line); }
.historyCalendarCell__month {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.historyCalendarCell__value {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
  margin-top: 5px;
}

/* barras dos ultimos meses: um so acento - o mes atual e rosa, o resto
 * e papel escurecido */
.monthBars {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  height: 92px;
  margin-top: 16px;
}
.monthBars__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.monthBars__bar {
  width: 100%;
  border-radius: 8px 8px 3px 3px;
  background: var(--neutral-bar);
  transition: height 0.3s ease;
}
.monthBars__col--prev .monthBars__bar { background: var(--neutral-bar-2); }
.monthBars__col--now .monthBars__bar { background: var(--accent); }
.monthBars__label { font-size: 10px; font-weight: 500; color: var(--ink-2); }
.monthBars__col--now .monthBars__label { font-weight: 600; color: var(--accent); }

/* ============ Dialogo (confirmar / perguntar) ============ */
.dialogOverlay { align-items: center; z-index: 300; }

.dialogBox {
  width: calc(100% - 48px);
  max-width: 330px;
  background: var(--paper-2);
  background-image: linear-gradient(178deg, var(--paper-3), var(--paper-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-hero);
  padding: 28px 24px 22px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.22s cubic-bezier(.34,1.4,.64,1), opacity 0.18s ease;
}
.dialogOverlay.open .dialogBox { transform: scale(1); opacity: 1; }

.dialogBox__icon { font-size: 30px; margin-bottom: 8px; line-height: 1; }
.dialogBox__title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 400;
  margin: 4px 0 10px;
}
.dialogBox__message {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 20px;
  line-height: 1.5;
  white-space: pre-line;
}
.dialogBox__input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  font-size: 15px;
  margin-bottom: 20px;
  outline: none;
  text-align: center;
  background: var(--card-solid);
}
.dialogBox__input:focus { border-color: var(--accent); }

.dialogBox__actions { display: flex; gap: 10px; }
.dialogBox__btn {
  flex: 1;
  border: none;
  padding: 14px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13.5px;
  transition: transform 0.12s ease;
}
.dialogBox__btn:active { transform: scale(0.97); }
.dialogBox__btn--ghost { background: var(--fill-soft); color: var(--ink-2); }
.dialogBox__btn--primary { background: var(--ink); color: var(--paper-2); }
.dialogBox__btn--danger { background: var(--accent-deep); color: var(--on-accent); }

/* ============ Esmaltes ============
 * Aqui a cor E o conteudo - entao a interface fica neutra de proposito
 * e as cores dos esmaltes sao o unico colorido da tela. */
.nailsStats {
  display: flex;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 16px 6px;
  margin-top: 16px;
  box-shadow: none;
}
.nailsStats__item {
  flex: 1;
  text-align: center;
  padding: 0 2px;
  border-right: 1px solid var(--line-soft);
}
.nailsStats__item:last-child { border-right: none; }
.nailsStats__value {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  line-height: 1;
  color: var(--ink);
}
.nailsStats__label {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 6px;
  line-height: 1.2;
}
.nailsStats::after { content: none; }

.nailsSearch { margin-bottom: 12px; }

.nailFilterRow { display: flex; gap: 8px; margin-bottom: 12px; }
.nailFilterRow select {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--card-solid);
  border-radius: 14px;
  padding: 12px 8px;
  font-size: 12px;
  color: var(--ink);
  outline: none;
}
.nailFilterRow select:focus { border-color: var(--accent); }

.nailBulkActions { margin: -2px 0 12px; }
.nailSelectionBar,
.invSelectionBar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
}
.nailSelectionBar[hidden], .invSelectionBar[hidden] { display: none; }
.nailSelectionBar__count,
.invSelectionBar__count {
  width: 100%;
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.nailSelectionBar .catalogBtn, .invSelectionBar .catalogBtn { padding: 8px 11px; font-size: 11px; }
.nailSelectionBar__delete, .invSelectionBar__delete { color: var(--danger); border-color: var(--danger-wash); }
.nailSelectionBar__delete:disabled, .invSelectionBar .catalogBtn:disabled { opacity: 0.45; cursor: not-allowed; }

.nailsPane--hidden { display: none; }

.nailsGrid > .nailBrandGroup { grid-column: 1 / -1; }
.nailBrandGroup { margin-bottom: 16px; }
.nailBrandGroup__title { margin: 0 0 10px; padding-left: 2px; }

.nailsGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.nailCard {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 10px;
  box-shadow: none;
  text-align: left;
  animation: itemIn 0.24s ease;
  position: relative;
}
.nailCard--selectable { cursor: pointer; }
.nailCard--selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-wash); }
.nailCard__selection {
  position: absolute;
  top: 9px;
  left: 9px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  border: 1.5px solid var(--check-empty);
  background: var(--card-solid);
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.nailCard--selected .nailCard__selection { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }

/* a gota de sombra interna da volume de frasco sem desenhar frasco */
.nailCard__swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: var(--fill-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  overflow: hidden;
  margin-bottom: 10px;
  box-shadow: inset 0 -14px 22px -14px rgba(0, 0, 0, 0.35), inset 0 8px 14px -10px rgba(255, 255, 255, 0.55);
}
.nailCard__swatch img { width: 100%; height: 100%; object-fit: cover; }

.nailCard__favorite {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 15px;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.35));
}

.nailCard__name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nailCard__brand {
  font-size: 10.5px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 2px 0 7px;
}

.nailCard__tags { display: flex; flex-wrap: wrap; gap: 4px; }
.nailCard__tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
}
.nailCard__tag--tenho { background: var(--success-wash); color: var(--success); }
.nailCard__tag--quero { background: var(--accent-wash); color: var(--accent-deep); }
.nailCard__tag--expired { background: var(--danger-wash); color: var(--danger); }
.nailCard__tag--soon { background: var(--warn-wash); color: var(--warn); }
:root[data-theme="dark"] .nailCard__tag--quero { color: var(--accent-strong); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nailCard__tag--quero { color: var(--accent-strong); }
}

.nailCard__rating { font-size: 10.5px; color: var(--warn); margin-top: 5px; }

.starRating { display: flex; gap: 6px; }
.starRating__star {
  border: none;
  background: transparent;
  font-size: 26px;
  color: var(--line-strong);
  padding: 0;
  line-height: 1;
  transition: transform 0.1s ease;
}
.starRating__star--filled { color: var(--warn); }
.starRating__star:active { transform: scale(1.15); }

.nailToggleRow { display: flex; gap: 8px; flex-wrap: wrap; }
.nailFavoriteBtn { margin-left: auto; }
.nailFavoriteBtn.chip--active { background: var(--accent); color: var(--on-accent); }

/* ============ Receitas ============ */
#recipeCategoryChips,
#giftCategoryChips,
#giftPurchaseFilters {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
#recipeCategoryChips::-webkit-scrollbar,
#giftCategoryChips::-webkit-scrollbar,
#giftPurchaseFilters::-webkit-scrollbar { display: none; }
#recipeCategoryChips .chip,
#giftCategoryChips .chip,
#giftPurchaseFilters .chip { flex: none; white-space: nowrap; }

.recipeCard {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 10px;
  box-shadow: none;
  text-align: left;
  animation: itemIn 0.24s ease;
  position: relative;
}
.recipeCard__photo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, #E8D3C8, #DCC0B4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  overflow: hidden;
  margin-bottom: 10px;
}
:root[data-theme="dark"] .recipeCard__photo { background: linear-gradient(150deg, #4A3C3E, #3A2F30); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .recipeCard__photo { background: linear-gradient(150deg, #4A3C3E, #3A2F30); }
}
.recipeCard__photo img { width: 100%; height: 100%; object-fit: cover; }
.recipeCard__name {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recipeCard__price {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
  margin-top: 4px;
}
.recipeCard__category {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--fill-soft);
  color: var(--ink-soft);
  display: inline-block;
  margin-top: 7px;
}
.recipeCard__rating { font-size: 10.5px; color: var(--warn); margin-top: 5px; }

/* receita em destaque: uma so, com foto grande, e o elo com as outras
 * areas explicito no rodape - o que falta vai pra lista num toque */
.recipeFeature {
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  margin-bottom: 18px;
}
.recipeFeature[hidden] { display: none; }
.recipeFeature__open {
  display: block;
  width: 100%;
  border: none;
  background: none;
  padding: 0;
  text-align: left;
  color: inherit;
}
.recipeFeature__photo {
  height: 152px;
  background: linear-gradient(150deg, #E8D3C8, #DCC0B4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  overflow: hidden;
}
:root[data-theme="dark"] .recipeFeature__photo { background: linear-gradient(150deg, #4A3C3E, #3A2F30); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .recipeFeature__photo { background: linear-gradient(150deg, #4A3C3E, #3A2F30); }
}
.recipeFeature__photo img { width: 100%; height: 100%; object-fit: cover; }
.recipeFeature__body { padding: 16px 17px 0; }
.recipeFeature__name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.15;
}
.recipeFeature__meta { margin-top: 7px; font-size: 11.5px; color: var(--ink-soft); }
.recipeFeature__footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 17px 0;
  padding: 13px 0 16px;
  border-top: 1px solid var(--line-soft);
}
.recipeFeature__status {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink-soft);
}
.recipeFeature__status strong { color: var(--accent-strong); font-weight: 600; }
.recipeFeature__status--ok { color: var(--success); }
.recipeFeature__add {
  flex: none;
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--paper-2);
  font-weight: 600;
  font-size: 11.5px;
}
.recipeGridLabel { padding: 0 0 10px; }
.recipeGridLabel[hidden] { display: none; }

.recipeDetailRating { font-size: 15px; color: var(--warn); letter-spacing: 2px; margin: -4px 0 8px; min-height: 1px; }

.recipeDetailPhoto {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, #E8D3C8, #DCC0B4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  overflow: hidden;
  margin-bottom: 16px;
}
:root[data-theme="dark"] .recipeDetailPhoto { background: linear-gradient(150deg, #4A3C3E, #3A2F30); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .recipeDetailPhoto { background: linear-gradient(150deg, #4A3C3E, #3A2F30); }
}
.recipeDetailPhoto img { width: 100%; height: 100%; object-fit: cover; }
.recipeDetailCategoryTag { display: inline-block; margin: 0 0 16px; }

.recipeSection { margin-bottom: 22px; }
.recipeSection__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  margin-bottom: 10px;
}

.recipeList { list-style: none; margin: 0; padding: 0; counter-reset: recipeCounter; }
.recipeList li {
  counter-increment: recipeCounter;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
  line-height: 1.45;
}
.recipeList li:last-child { border-bottom: none; }
.recipeList li::before {
  content: counter(recipeCounter);
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--fill-soft);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.recipeList--steps li::before { background: var(--accent-wash); color: var(--accent-deep); }
:root[data-theme="dark"] .recipeList--steps li::before { color: var(--accent-strong); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .recipeList--steps li::before { color: var(--accent-strong); }
}

/* "Posso fazer?" - ingredientes como pilulas: neutro = tem em casa,
 * rosa = falta */
.recipeCanCook {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}
.recipeCanCook__hint { font-size: 9.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); }
.canCook__summary { font-size: 13px; font-weight: 600; color: var(--accent-deep); margin: 8px 0 10px; }
.canCook__summary--ok { color: var(--success); }
:root[data-theme="dark"] .canCook__summary { color: var(--accent-strong); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .canCook__summary { color: var(--accent-strong); }
}
.canCook__missing { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.canCook__missing li {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--accent-deep);
  background: var(--accent-wash);
  border-radius: 999px;
  padding: 6px 12px;
}
:root[data-theme="dark"] .canCook__missing li { color: var(--accent-strong); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .canCook__missing li { color: var(--accent-strong); }
}

/* ============ Presentes ============ */
.giftCard__open {
  display: block;
  width: 100%;
  border: none;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}
.giftCard__purchase {
  position: absolute;
  z-index: 1;
  top: 16px;
  left: 16px;
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--check-empty);
  border-radius: 50%;
  background: var(--card-solid);
  color: transparent;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
}
.giftCard--bought { opacity: 0.7; }
.giftCard--bought .recipeCard__name { text-decoration: line-through; text-decoration-color: var(--strike); }
.giftCard--bought .giftCard__purchase { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.giftCard__boughtLabel {
  display: inline-block;
  margin-top: 7px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--fill-soft);
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* ============ Resumo / orcamento ============ */
.summaryCard {
  position: relative;
  overflow: hidden;
  background: var(--hero-grad);
  border: 1px solid var(--hero-border);
  color: var(--on-accent);
  border-radius: var(--radius-hero);
  padding: 22px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-hero);
}
.summaryCard__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 1;
}
.summaryCard__value {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 400;
  line-height: 0.9;
  margin: 12px 0 0;
}
.summaryCard__sub { font-size: 11.5px; font-weight: 500; margin-top: 10px; opacity: 0.95; }
.budgetBar {
  margin-top: 16px;
  height: 6px;
  background: rgba(255, 255, 255, 0.26);
  border-radius: 3px;
  overflow: hidden;
}
.budgetBar__fill { height: 100%; background: var(--on-accent); border-radius: 3px; transition: width 0.4s ease; }
.budgetBar__fill--over { background: #F5D6A8; }
.budgetBar__meta { font-size: 11px; font-weight: 500; margin-top: 8px; }
.budgetBar__meta--over { color: #F5D6A8; }
.summaryBudgetBtn {
  margin-top: 16px;
  width: 100%;
  background: var(--on-accent);
  color: var(--accent-deep);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 12.5px;
  padding: 12px 0;
}

.summarySection {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.summarySection__title { margin-bottom: 12px; }
.summaryRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  font-size: 13px;
}
.summaryRow + .summaryRow { border-top: 1px solid var(--line-soft); }
.summaryRow__label { color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.summaryRow__sub { display: block; font-size: 11px; color: var(--ink-soft); white-space: nowrap; }
.summaryRow__value { font-weight: 500; color: var(--ink); flex: none; }

/* ============ "o que a IA entendeu" ============ */
.aiKnows {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  margin-bottom: 12px;
}
.aiKnows--taught { background: var(--success-wash); border-color: transparent; }
.aiKnows__text { font-size: 12px; color: var(--ink-2); min-width: 0; }
.aiKnows--taught .aiKnows__text { color: var(--success); }
.aiKnows__btn {
  flex: none;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 11px;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.aiKnows--taught .aiKnows__btn { color: var(--success); border-color: transparent; }

/* ============ Estoque ============
 * Duas medidas por local: despensa mede NIVEL (barra), geladeira mede
 * VALIDADE (etiqueta). O rosa aqui e sinal de escassez. */
.stockHint {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 999px;
  display: inline-block;
  background: var(--fill-soft);
  color: var(--ink-soft);
}
.stockHint--ok { background: var(--success-wash); color: var(--success); }
.stockHint--low { background: var(--warn-wash); color: var(--warn); }
.stockHint--out { background: var(--accent-wash); color: var(--accent-deep); }
:root[data-theme="dark"] .stockHint--out { color: var(--accent-strong); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .stockHint--out { color: var(--accent-strong); }
}

/* alerta do topo do Estoque: resolve a acao principal (repor) num toque */
.invAlert {
  background: var(--accent-wash);
  border: 1px solid var(--accent-wash-line);
  border-radius: 22px;
  padding: 16px 17px;
  margin-top: 16px;
}
.invAlert__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.invAlert__title { font-size: 12.5px; font-weight: 600; color: var(--accent-strong); }
:root:not([data-theme="dark"]) .invAlert__title { color: var(--accent-strong); }
.invAlert__btn {
  flex: none;
  padding: 9px 14px;
  border: none;
  border-radius: 999px;
  background: var(--accent-strong);
  color: var(--on-accent);
  font-weight: 600;
  font-size: 10.5px;
}
:root[data-theme="dark"] .invAlert__btn { background: var(--accent); color: var(--bg); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .invAlert__btn { background: var(--accent); color: var(--bg); }
}
.invAlert__desc { margin: 10px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--accent-wash-ink); }

/* nivel do que resta (barra fininha) */
.levelBar {
  margin-top: 8px;
  height: 5px;
  border-radius: 3px;
  background: var(--line-soft);
  overflow: hidden;
}
.levelBar__fill { height: 100%; background: var(--accent-light); border-radius: 3px; transition: width 0.3s ease; }
.levelBar__fill--low { background: var(--accent-strong); }

.invList { display: flex; flex-direction: column; gap: 14px; }

/* cada local (despensa, geladeira...) vira um cartao de secao */
.invSection { padding: 0 0 12px; }
.invSection--out { color: var(--accent-strong); }
.invSection__count { font-weight: 500; letter-spacing: 0; text-transform: none; opacity: 0.75; }

.invRow {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: none;
  overflow: hidden;
  animation: itemIn 0.24s ease;
}
.invRow--out { border-color: var(--accent-wash-line); }
.invRow--selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-wash); }

.invRow__head {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 12px 14px;
  cursor: pointer;
}
.invRow__selection {
  flex: none;
  width: 23px;
  height: 23px;
  border: 1.5px solid var(--check-empty);
  border-radius: 50%;
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.invRow--selected .invRow__selection { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.invRow--open .invRow__head { border-bottom: 1px solid var(--line-soft); }

.invRow__photo {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--tile);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  overflow: hidden;
}
.invRow__photo img { width: 100%; height: 100%; object-fit: cover; }

.invRow__main { flex: 1; min-width: 0; }
.invRow__name {
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.invRow__meta {
  font-size: 10.5px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 3px;
}

.invRow__badge {
  flex: none;
  font-size: 10px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--fill-soft);
  color: var(--ink-soft);
}
.invRow__badge--out { background: var(--accent-wash); color: var(--accent-deep); }
:root[data-theme="dark"] .invRow__badge--out { color: var(--accent-strong); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .invRow__badge--out { color: var(--accent-strong); }
}

.invRow__chevron { flex: none; font-size: 11px; color: var(--ink-soft); }

.invRow__body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: itemIn 0.2s ease;
}
.invRow__qtyRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.invRow__qtyLabel { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.invRow__qty {
  font-weight: 500;
  font-size: 15px;
  color: var(--ink);
  min-width: 64px;
  text-align: center;
}
.invRow__body .qtyStepper {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 4px;
}
.invRow__body .qtyStepper__btn { width: 30px; height: 30px; flex: none; }

.invRow__info { margin: 0; font-size: 11.5px; line-height: 1.5; color: var(--ink-soft); }

.invRow__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.invRow__toList {
  flex: 1;
  border: none;
  background: var(--ink);
  color: var(--paper-2);
  font-weight: 600;
  font-size: 12px;
  padding: 11px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
}
.invRow__toList:active { filter: brightness(1.1); }
.invRow__edit {
  flex: 1;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 12px;
  padding: 11px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
}

.invBulkActions { margin: -2px 0 12px; }

/* ============ Gerenciar categorias ============ */
.categoryRow {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 11px 13px;
  margin-bottom: 8px;
}
.categoryRow__emoji { font-size: 17px; flex: none; }
.categoryRow__name { flex: 1; min-width: 0; font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.categoryRow__count { font-size: 10.5px; color: var(--ink-soft); flex: none; }
.categoryRow__edit, .categoryRow__delete {
  flex: none;
  border: none;
  background: var(--fill-soft);
  color: var(--ink-soft);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 12px;
}

/* ============ Editor de ingredientes / passos ============ */
.dynList { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.dynRow {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px 10px;
}
.dynRow__num {
  flex: none;
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 12px;
  padding-top: 9px;
  min-width: 16px;
}
.dynRow__input, .dynRow__textarea {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font-size: 13.5px;
  padding: 7px 4px;
  font-family: inherit;
  resize: none;
  background: transparent;
}
.dynRow__textarea { min-height: 40px; }
.dynRow__remove {
  flex: none;
  border: none;
  background: var(--fill-soft);
  color: var(--ink-soft);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 12px;
  margin-top: 3px;
}

/* ============ Assistente (chat) ============
 * Toda resposta vem com o botao da acao - nunca so texto. Sugestoes em
 * pilula evitam a folha em branco. */
.assistantIntro {
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.5;
  margin: 12px 0 0;
}

.chatWrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chatMessages { display: flex; flex-direction: column; gap: 10px; }

.chatBubble {
  max-width: 86%;
  padding: 12px 15px;
  border-radius: 20px;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: itemIn 0.2s ease;
}
.chatBubble--user {
  align-self: flex-end;
  background: var(--hero-grad);
  color: var(--on-accent);
  border-bottom-right-radius: 6px;
}
.chatBubble--ai {
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--ink);
  border-bottom-left-radius: 6px;
}
.chatBubble--typing { color: var(--ink-soft); font-style: italic; }

.chatRecipeSaveRow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.chatRecipeSaveBtn {
  border: none;
  background: var(--ink);
  color: var(--paper-2);
  font-weight: 600;
  font-size: 11.5px;
  padding: 9px 13px;
  border-radius: var(--radius-xs);
}
.chatRecipeSaveBtn:disabled { opacity: 0.6; }
.chatRecipeSaveBtn--open { background: var(--accent-deep); }

.chatSuggestions { display: flex; flex-wrap: wrap; gap: 7px; padding: 4px 0 2px; }
.chatSuggestion {
  border: 1px solid var(--line-strong);
  background: var(--card-solid);
  color: var(--ink);
  font-weight: 500;
  font-size: 12px;
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.chatSuggestion:active { background: var(--fill-soft); }

.chatOffline {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-2);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 12.5px;
  line-height: 1.5;
  font-weight: 500;
}

.chatComposer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--nav-height) + 24px + var(--safe-bottom) + var(--keyboard-offset));
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  padding: 8px 20px;
  z-index: 50;
}
.chatInput {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--card-solid);
  border-radius: 999px;
  padding: 13px 18px;
  font-size: 13.5px;
  color: var(--ink);
}
.chatInput:focus { outline: none; border-color: var(--accent); }
.chatSend {
  flex: none;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 14px;
  background: var(--hero-grad);
  color: var(--on-accent);
  font-size: 16px;
}
.chatSend:disabled { opacity: 0.5; }

/* o chat rola atras do composer fixo (que por sua vez fica acima da nav) */
#viewAssistente { padding-bottom: calc(var(--nav-height) + 92px + var(--safe-bottom)); }

/* Markdown dentro das bolhas da IA */
.chatBubble.chatMd { white-space: normal; }
.chatMd__h {
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 12px 0 6px;
  color: var(--ink-soft);
}
.chatMd__h:first-child { margin-top: 0; }
.chatMd__p { margin: 0 0 7px; }
.chatMd__p:last-child { margin-bottom: 0; }
.chatMd__ul, .chatMd__ol { margin: 2px 0 8px; padding-left: 20px; }
.chatMd__ul:last-child, .chatMd__ol:last-child { margin-bottom: 0; }
.chatMd__ul li, .chatMd__ol li { margin: 3px 0; }
.chatMd strong { font-weight: 700; }

/* Relatorio/resumo: tabela, citacao de fechamento, regua e codigo.
 * A bolha da IA pode passar de 86% quando tem tabela - numero em coluna
 * espremida nao se le. */
.chatBubble--ai:has(.chatMd__table) { max-width: 100%; }
.chatMd__tableWrap {
  margin: 4px 0 10px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card-solid);
}
.chatMd__tableWrap:last-child { margin-bottom: 0; }
.chatMd__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  white-space: nowrap;
}
.chatMd__table th {
  text-align: left;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
  padding: 9px 12px;
  background: var(--fill-soft);
  border-bottom: 1px solid var(--line);
}
.chatMd__table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2);
}
.chatMd__table tr:last-child td { border-bottom: none; }
/* numeros (R$, %, 12x) alinhados a direita: e' o que deixa a coluna legivel */
.chatMd__table td:not(:first-child), .chatMd__table th:not(:first-child) { text-align: right; }
.chatMd__table td strong { color: var(--ink); }

.chatMd__quote {
  margin: 10px 0 0;
  padding: 10px 14px;
  border-left: 3px solid var(--accent);
  background: var(--accent-wash);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.5;
}
.chatMd__hr { border: none; border-top: 1px solid var(--line); margin: 12px 0; }
.chatMd__code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  background: var(--fill-soft);
  border-radius: 5px;
  padding: 1px 5px;
}
.chatBubble__parada {
  margin-top: 8px;
  font-size: 11px;
  color: var(--ink-soft);
  font-style: italic;
}

/* ============ Assistente: barra de conversas ============
 * Historico do lado, tipo caderno: da pra voltar numa conversa antiga e
 * continuar dali (o contexto vai junto). No pe, o que a IA ja aprendeu sobre
 * voces - visivel e apagavel, nada guardado escondido. */
.chatCurrent {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--ink-soft);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chatSidebarBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(34, 27, 28, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 190;
}
.chatSidebarBackdrop.open { opacity: 1; pointer-events: auto; }

.chatSidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(300px, 86vw);
  z-index: 200;
  background: var(--paper-2);
  border-right: 1px solid var(--line);
  box-shadow: 18px 0 40px rgba(34, 27, 28, 0.12);
  transform: translateX(-102%);
  transition: transform 0.24s ease;
  display: flex;
  flex-direction: column;
  /* o pe da barra passa por baixo da nav flutuante do celular - sem essa
     folga, as ultimas memorias ficam escondidas atras dela */
  padding: calc(18px + var(--safe-top, 0px)) 14px calc(var(--nav-height) + 46px + var(--safe-bottom));
  gap: 10px;
}
.chatSidebar.open { transform: translateX(0); }

.chatSidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.chatSidebar__titulo2 {
  font-family: var(--font-display, inherit);
  font-size: 17px;
  color: var(--ink);
}
.chatSidebar__nova {
  border: 1px solid var(--line-strong);
  background: var(--card-solid);
  color: var(--ink);
  font-weight: 600;
  font-size: 12.5px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  text-align: left;
}
.chatSidebar__nova:active { background: var(--fill-soft); }

.chatSidebar__lista {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 -4px;
  padding: 0 4px;
}
.chatSidebar__grupo {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
  margin: 12px 0 4px;
}
.chatSidebar__item {
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: var(--radius-sm);
}
.chatSidebar__item--ativo { background: var(--accent-wash); }
.chatSidebar__abrir {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: none;
  background: none;
  text-align: left;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink);
}
.chatSidebar__abrir:active { background: var(--fill-soft); }
.chatSidebar__titulo {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chatSidebar__previa {
  font-size: 11px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chatSidebar__apagar {
  flex: none;
  border: none;
  background: none;
  font-size: 12px;
  padding: 8px 6px;
  opacity: 0.55;
}
.chatSidebar__apagar:active { opacity: 1; }
.chatSidebar__vazio {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 6px 2px;
}

.chatSidebar__memoriasHead {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.chatSidebar__memorias {
  max-height: 27vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chatMemoria {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-2);
  background: var(--card-solid);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xs);
  padding: 7px 8px 7px 10px;
}
.chatMemoria__esquecer {
  flex: none;
  border: none;
  background: none;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
}

/* Parar: o mesmo botao de enviar vira quadrado enquanto a IA responde */
.chatSend--stop {
  background: var(--ink);
  color: var(--paper-2);
  font-size: 13px;
}

/* ============ Editor de foto ============ */
.photoCropOverlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(34, 27, 28, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.photoCropSheet {
  width: 100%;
  max-width: 420px;
  background: var(--paper-2);
  background-image: linear-gradient(178deg, var(--paper-3), var(--paper-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-hero);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.photoCropSheet__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 21px;
  margin: 0 0 14px;
  text-align: center;
}

.photoCropStage {
  position: relative;
  width: 100%;
  height: min(58vh, 420px);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #1A1415;
  touch-action: none;
}

.photoCropCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* selecao arrastavel/redimensionavel (estilo captura de tela): o
 * box-shadow gigante escurece tudo FORA da selecao, sem precisar de
 * outro elemento pra isso */
.photoCropBox {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  touch-action: none;
  cursor: move;
}
.photoCropHandle {
  position: absolute;
  width: 22px;
  height: 22px;
  margin: -11px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  touch-action: none;
}
.photoCropHandle--tl { top: 0; left: 0; cursor: nwse-resize; }
.photoCropHandle--tr { top: 0; right: 0; margin-right: -11px; cursor: nesw-resize; }
.photoCropHandle--bl { bottom: 0; left: 0; margin-bottom: -11px; cursor: nesw-resize; }
.photoCropHandle--br { bottom: 0; right: 0; margin-right: -11px; margin-bottom: -11px; cursor: nwse-resize; }

.photoCropToolbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.photoCropRotateBtn {
  border: 1px solid var(--line-strong);
  background: var(--card-solid);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 12.5px;
  padding: 10px 16px;
  border-radius: 999px;
}
.photoCropRotateBtn:active { transform: scale(0.97); }

.photoCropHint { text-align: center; font-size: 11.5px; color: var(--ink-soft); margin: 0; }

.photoCropActions { display: flex; gap: 10px; margin-top: 12px; }
.photoCropActions .btnGhost, .photoCropActions .btnPrimary { flex: 1; padding: 13px; margin-top: 0; }

/* ============ Conferir compra com a nota fiscal ============ */
.receiptCheck {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 4px 0 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.receiptCheck__ok { margin: 0; color: var(--success); font-weight: 500; font-size: 12.5px; }
.receiptSuggestion {
  background: var(--accent-wash);
  border: 1px solid var(--accent-wash-line);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.receiptSuggestion__name { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.receiptSuggestion__desc { font-size: 12px; color: var(--accent-wash-ink); line-height: 1.45; }
.receiptSuggestion .btnGhost { align-self: flex-start; margin-top: 6px; padding: 8px 14px; font-size: 12px; }

/* ============ Vitrine (tela dedicada) ============
 * Grade de dois em dois, foto ocupando o topo do cartao. O rosa marca
 * so o que mudou de preco. */
.bankCard { position: relative; padding: 0; overflow: visible; }
.bankCard__tap { display: block; width: 100%; border: none; background: none; padding: 10px; text-align: left; }
.bankCard--selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-wash); }
/* .recipeCard__name corta com "..." por padrao (nome de receita e
 * curto) - na Vitrine o nome vem composto (produto+marca+peso) e fica
 * mais longo, entao aqui quebra em vez de cortar */
.bankCard .recipeCard__name { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.3; }
.bankCard__check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.bankCard__remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper-2);
  font-size: 10px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bankCard__edit {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--card-solid);
  border: 1px solid var(--accent);
  color: var(--accent-deep);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bankSendStep { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.bankSendRow { display: flex; align-items: center; gap: 12px; }
.bankSendRow__photo {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--tile);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  overflow: hidden;
}
.bankSendRow__photo img { width: 100%; height: 100%; object-fit: cover; }
.bankSendRow__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.bankSendRow__name { font-weight: 600; font-size: 13px; color: var(--ink); }
.bankSendRow__main input {
  border: 1px solid var(--line);
  background: var(--card-solid);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}
.bankSendRow__main input:focus { border-color: var(--accent); }
.bankSendStep__actions { display: flex; gap: 10px; margin-top: 6px; }
.bankSendStep__actions .btnGhost, .bankSendStep__actions .btnPrimary { flex: 1; margin-top: 0; }

/* ============ Telas pequenas ============ */
@media (max-width: 340px) {
  .header__title { font-size: 20px; }
  .totalCard__value, .heroCard__value { font-size: 40px; }
  .quickNav__label { font-size: 9px; }
}

/* ============================================================
   Desktop — 1180px, mesmo sistema
   ------------------------------------------------------------
   Nao e a tela do celular esticada. Tres mudancas estruturais,
   mesma paleta e tipografia:
     1) a nav vira coluna fixa a esquerda (212px) com as 7 areas
        por extenso - no celular so cabiam 3 + "Mais";
     2) coluna direita de contexto (300px): o cartao-heroi sai do
        topo e vira painel lateral persistente;
     3) a lista ganha colunas de verdade (item, quantidade,
        unitario, total) - e o que o desktop faz melhor.
   ============================================================ */
@media (min-width: 860px) {
  body { padding-left: 212px; }

  .app {
    max-width: 760px;
    padding-bottom: 60px;
    padding-left: 8px;
    padding-right: 8px;
  }

  /* no desktop a nav e sidebar: a barra flutuante do celular some */
  .quickNav { display: none; }
  .mobileNavBackdrop { display: none; }
  .header__top { padding-left: 0; }
  .albumGrade { grid-template-columns: repeat(3, 1fr); }
  .updateNotice { left: 244px; right: 24px; bottom: 24px; }
  .toast { bottom: 32px; }
  .chatComposer { left: 212px; bottom: 20px; }
  .chatSidebar { left: 212px; padding-bottom: 24px; }

  /* ---- Sidebar de 212px ---- */
  .bottomNav {
    left: 0;
    right: auto;
    top: 0;
    bottom: 0;
    width: 212px;
    max-width: none;
    margin: 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 2px;
    padding: 22px 16px;
    border-radius: 0;
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.5);
    background-image: none;
    box-shadow: none;
    overflow: visible;
    transform: none;
    visibility: visible;
    transition: none;
  }
  :root[data-theme="dark"] .bottomNav { background: #282021; }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .bottomNav { background: #282021; }
  }
  .bottomNav::before, .bottomNav::after { content: none; }

  .bottomNav__btn:hover { background: rgba(255, 255, 255, 0.55); }
  .bottomNav__btn--active:hover { background: var(--card-solid); }

  /* rodape da sidebar: "compra em dupla" (quem esta vendo agora) */
  .bottomNav__footer {
    display: block;
    margin-top: auto;
    background: var(--card-solid);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 13px 14px;
    text-align: left;
  }
  .bottomNav__footerText {
    margin: 0;
    font-size: 10.5px;
    line-height: 1.45;
    color: var(--ink-2);
  }
  .bottomNav__footerText strong {
    display: block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: 8px;
  }

  /* ---- O "+" volta a ser um botao ancorado no canto ---- */
  .fab {
    display: flex;
    right: 32px;
    bottom: 32px;
    width: auto;
    height: auto;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    background: var(--ink);
    color: var(--paper-2);
    box-shadow: var(--shadow-soft);
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
  }
  .fab--nails, .fab--recipes { background: var(--ink); }
  .fab::after { content: attr(aria-label); white-space: nowrap; }
  .fab svg { width: 18px; height: 18px; }

  /* ---- Folhas viram modais centralizados ---- */
  .sheetOverlay { align-items: center; padding: 24px; }
  .sheet {
    width: 100%;
    max-width: 560px;
    border-radius: var(--radius-hero);
    border-top: 1px solid var(--line);
    transform: scale(0.94);
    opacity: 0;
    transition: transform 0.22s cubic-bezier(.34, 1.4, .64, 1), opacity 0.18s ease;
  }
  .sheetOverlay.open .sheet { transform: scale(1); opacity: 1; }
  .sheet--catalog, .sheet--history, .sheet--compare { max-width: 660px; }
  .sheet__handle { display: none; }

  /* ---- Grades com mais respiro ---- */
  .nailsGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .historyCalendarGrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  /* ---- Hover: desktop tem mouse, celular nao ---- */
  .nailCard:hover, .recipeCard:hover, .historyMonthCard:hover, .invRow:hover {
    border-color: var(--line-strong);
  }
  .item:hover { background: var(--row-flag); }
  .chip:hover:not(.chip--active) { background: var(--fill-soft); }
  .monthBar__btn:hover { background: var(--card-solid); }
  .catalogItem:hover { border-color: var(--accent-wash-line); }

  /* ---- Scrollbar no tema ---- */
  * { scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: 999px;
    border: 3px solid var(--paper-2);
  }
  ::-webkit-scrollbar-thumb:hover { background: var(--ink-soft); }
}

/* ---- 1180px: entra a coluna de contexto ---- */
@media (min-width: 1180px) {
  .app { max-width: 1000px; }

  /* duas colunas: conteudo a esquerda, contexto a direita. A coluna de
   * contexto vem ANTES no DOM (pro celular ver o heroi no topo, que e a
   * ordem natural de leitura la), entao aqui as colunas sao atribuidas
   * explicitamente em vez de seguir a ordem do HTML. */
  .withRail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 22px;
    align-items: start;
  }
  .mainCol { grid-column: 1; grid-row: 1; min-width: 0; }
  .contextRail {
    padding: 0;
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .contextRail > .contextCard { display: block; }
  /* na coluna principal do desktop a linha de acoes permanece visivel (historico, imprimir, finalizar) */
  .mainCol .monthBar { display: flex; margin-bottom: 16px; }
  .contextRail .totalCard, .contextRail .heroCard { margin-top: 0; padding: 20px; }
  .contextRail .totalCard__value, .contextRail .heroCard__value { font-size: 40px; line-height: 0.9; }
  .loveNote { max-width: 620px; margin-left: 20px; margin-right: auto; }
  .albumGrade { grid-template-columns: repeat(4, 1fr); }
  .lembranca { max-width: 620px; }
  .contextCard {
    background: var(--card-solid);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 16px;
  }
  .contextCard__title { margin-bottom: 12px; }
  .contextCard__row { margin-bottom: 11px; }
  .contextCard__row:last-child { margin-bottom: 0; }
  .contextCard__rowTop {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
  }
  .contextCard__name { font-size: 12.5px; font-weight: 500; }
  .contextCard__value { font-size: 10.5px; font-weight: 500; color: var(--accent-deep); }
  .contextCard__btn {
    margin-top: 14px;
    width: 100%;
    padding: 11px 0;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-xs);
    background: transparent;
    color: var(--ink-2);
    font-weight: 600;
    font-size: 11.5px;
  }
  .contextCard__big {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 27px;
    line-height: 1;
    margin-top: 10px;
  }
  .contextCard__note { margin-top: 8px; font-size: 11px; line-height: 1.45; color: var(--ink-2); }

  /* a lista ganha colunas de verdade: item / quantidade / unitario /
   * total, alinhados - e o que o desktop faz melhor (comparar e
   * revisar). So o Mercado usa; as outras areas seguem em cartao. */
  .categoryGroups--table {
    background: var(--card-solid);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    gap: 0;
  }
  .categoryGroups--table .categoryGroup {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
  }
  .categoryGroups--table .categoryGroup__header {
    padding: 10px 18px;
    background: var(--row-flag);
    border-bottom: 1px solid var(--line-soft);
  }
  .categoryGroups--table .categoryGroup__title {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-deep);
  }
  .categoryGroups--table .categoryGroup__total { font-size: 11px; }
  .categoryGroups--table .item {
    padding: 13px 18px;
    border-top: none;
    border-bottom: 1px solid var(--line-soft);
  }
  .categoryGroups--table .item:last-child { border-bottom: none; }
  .categoryGroups--table .item__meta { display: none; }
  .categoryGroups--table .item__qty {
    flex: none;
    width: 76px;
    font-size: 12.5px;
    color: var(--ink-2);
  }
  .categoryGroups--table .item__unit {
    flex: none;
    width: 88px;
    font-size: 12.5px;
    color: var(--ink-2);
    font-variant-numeric: tabular-nums;
  }
  .categoryGroups--table .item--noPrice { background: var(--row-flag); }
  :root[data-theme="dark"] .categoryGroups--table .categoryGroup__title { color: var(--accent); }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .categoryGroups--table .categoryGroup__title { color: var(--accent); }
  }
}

/* item__qty / item__unit so existem na tabela do desktop */
.item__qty, .item__unit { display: none; }
@media (min-width: 1180px) {
  .categoryGroups--table .item__qty,
  .categoryGroups--table .item__unit { display: block; }
}

/* ============ Imprimir a lista do Mercado (tela + papel/PDF) ============
 * A previa na tela e' a propria folha: fundo branco e tinta preta mesmo no
 * tema escuro, porque e' exatamente o que vai sair na impressora ou no PDF.
 * As cores aqui sao fixas de proposito (nao usam os tokens do tema).
 * A regra de @media print, no fim, esconde TODO o resto da pagina e deixa so
 * #printRoot - por isso a folha e' montada num portal la (ver PrintList.tsx).
 */
.printOverlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #58494a;
  padding-bottom: 40px;
}

.printBar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
  background: #2b2223;
  color: #fdf8f4;
}
.printBar__btn {
  border: 1px solid rgba(253, 248, 244, 0.4);
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-weight: 600;
  font-size: 12.5px;
  padding: 10px 15px;
  border-radius: 999px;
  cursor: pointer;
}
.printBar__btn--primary { background: #fdf8f4; color: #2b2223; border-color: #fdf8f4; }
.printBar__hint { flex: 1 1 100%; font-size: 11px; line-height: 1.45; opacity: 0.8; }
.printBar__hint strong { font-weight: 700; }

.printSheet {
  max-width: 760px;
  margin: 18px auto;
  background: #fff;
  color: #2a2223;
  padding: 32px 34px 26px;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  font-size: 13px;
  line-height: 1.45;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.printSheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 2px solid #2a2223;
  margin-bottom: 20px;
}
.printSheet__brand {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8a7a76;
  margin-bottom: 6px;
}
.printSheet__title {
  font-family: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  font-size: 30px;
  font-weight: 400;
  line-height: 1.05;
  margin: 0 0 4px;
  color: #2a2223;
}
.printSheet__date { font-size: 12px; color: #6f605d; }
.printSheet__totalBox {
  flex: none;
  text-align: right;
  border: 1px solid #2a2223;
  border-radius: 4px;
  padding: 10px 14px;
  min-width: 150px;
}
.printSheet__totalLabel {
  display: block;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6f605d;
}
.printSheet__totalValue {
  display: block;
  font-size: 21px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin: 2px 0 2px;
}
.printSheet__totalSub { display: block; font-size: 10.5px; color: #6f605d; }

.printCat { margin-bottom: 18px; }
.printCat__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  background: #f4efec;
  border-radius: 3px;
  padding: 6px 9px;
  margin-bottom: 4px;
}
.printCat__name {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0;
}
.printCat__total { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }

.printTable__head,
.printRow {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 62px 78px 82px;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
}
.printTable__head .printCell--box { border: none; }
.printTable__head {
  padding-top: 2px;
  padding-bottom: 4px;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9b8b87;
}
.printRow { border-bottom: 1px dotted #ded5d1; }
.printRow:last-child { border-bottom: none; }
.printCell--qty, .printCell--unit, .printCell--total { text-align: right; font-variant-numeric: tabular-nums; }
.printCell--total { font-weight: 700; }
.printCell--box {
  width: 15px;
  height: 15px;
  border: 1.4px solid #2a2223;
  border-radius: 3px;
  font-size: 10px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.printCell--name { font-weight: 500; }
.printRow__market { color: #8a7a76; font-weight: 400; font-size: 11.5px; }
.printRow--done .printCell--name,
.printRow--done .printCell--qty,
.printRow--done .printCell--unit { color: #8a7a76; }
.printRow--done .printCell--box { background: #ece5e1; }

.printEmpty { text-align: center; color: #8a7a76; padding: 24px 0; }

.printFoot { margin-top: 22px; padding-top: 14px; border-top: 2px solid #2a2223; }
.printFoot__rows { max-width: 340px; margin-left: auto; }
.printFoot__row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 0;
  font-size: 12.5px;
  color: #6f605d;
  font-variant-numeric: tabular-nums;
}
.printFoot__row--grand {
  margin-top: 4px;
  padding-top: 7px;
  border-top: 1px solid #2a2223;
  font-size: 15px;
  font-weight: 700;
  color: #2a2223;
}
.printFoot__note {
  margin: 16px 0 0;
  font-size: 10.5px;
  line-height: 1.55;
  color: #8a7a76;
}

@media (max-width: 560px) {
  .printSheet { margin: 12px 10px; padding: 22px 18px 20px; font-size: 12px; }
  .printSheet__head { flex-direction: column; }
  .printSheet__totalBox { text-align: left; min-width: 0; align-self: stretch; }
  .printSheet__title { font-size: 25px; }
  .printTable__head,
  .printRow { grid-template-columns: 22px minmax(0, 1fr) 46px 58px 66px; gap: 6px; padding: 6px 4px; font-size: 11.5px; }
  .printCat__head { padding: 6px; }
}

@media print {
  /* a folha e' a pagina: todo o resto do app sai de cena */
  body > *:not(#printRoot) { display: none !important; }
  #printRoot { display: block !important; }
  html, body { background: #fff !important; }
  .printBar { display: none !important; }
  .printOverlay {
    position: static;
    inset: auto;
    overflow: visible;
    background: #fff;
    padding: 0;
  }
  .printSheet {
    max-width: none;
    margin: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    font-size: 10.5pt;
  }
  .printCat, .printRow, .printFoot, .printSheet__head { break-inside: avoid; page-break-inside: avoid; }
  @page { size: A4; margin: 14mm; }
}
