/* Fontes hospedadas no próprio app: nenhum servidor de terceiros recebe o IP de quem usa. */
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/bricolage-grotesque-latin-800-normal.woff2") format("woff2"); }

/* Layout: uma coluna estreita como uma lista de papel; etiquetas de preço amarelas de gôndola; barra fixa embaixo para o polegar. */
:root {
  /* Tema claro (1.6.1): fundo branco, cinza claro nos campos e blocos, destaque laranja
     (as variáveis "--green" são o destaque do tema) */
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --soft: #F5F5F5;
  --ink: #2A1D14;
  --muted: #6B5A4E;
  --line: #E8E8E8;
  --green: #C2410C;
  --green-ink: #FFFFFF;
  --green-soft: #FDEADC;
  --bar: #F5C4A1;
  --tag: #FFD644;
  --tag-ink: #1B1A10;
  --warn: #9A5B00;         /* avisos em âmbar, para não confundir com o laranja do destaque */
  --warn-soft: #FDF0D2;
  --danger: #B42318;       /* excluir: vermelho */
  --danger-soft: #FDE8E6;
  --down: #1F7A3D; --down-soft: #E2F3E6;  /* preço caiu */
  --up: #B42318; --up-soft: #FDE8E6;      /* preço subiu */
  --scrim: rgba(40, 22, 10, .45);
  --shadow: 0 10px 30px rgba(60, 30, 10, .14);
  color-scheme: light;
  --font-display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14100D; --surface: #1F1915; --soft: #2A231E; --ink: #F3EAE2; --muted: #B4A396; --line: #3A2F27;
    --green: #F28B4B; --green-ink: #1A0E06; --green-soft: #3A2416; --bar: #6E3E20; --tag: #F3CC3F; --tag-ink: #1B1A10;
    --warn: #E9B44C; --warn-soft: #362A12; --danger: #F0605C; --danger-soft: #3B1C1B; --down: #5BD08A; --down-soft: #16301F; --up: #F0605C; --up-soft: #3B1C1B; --scrim: rgba(0, 0, 0, .6); --shadow: 0 10px 30px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14100D; --surface: #1F1915; --soft: #2A231E; --ink: #F3EAE2; --muted: #B4A396; --line: #3A2F27;
  --green: #F28B4B; --green-ink: #1A0E06; --green-soft: #3A2416; --bar: #6E3E20; --tag: #F3CC3F; --tag-ink: #1B1A10;
  --warn: #E9B44C; --warn-soft: #362A12; --danger: #F0605C; --danger-soft: #3B1C1B; --down: #5BD08A; --down-soft: #16301F; --up: #F0605C; --up-soft: #3B1C1B; --scrim: rgba(0, 0, 0, .6); --shadow: 0 10px 30px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 17px; line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
}
body.with-totals { padding-bottom: calc(190px + env(safe-area-inset-bottom, 0px)); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.wrap { max-width: 560px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.num { font-variant-numeric: tabular-nums; }

/* Cabeçalho */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.top .wrap { padding-block: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-family: var(--font-display); font-weight: 800; font-size: 26px; letter-spacing: -.02em; color: var(--green); margin: 0; }
.where { display: flex; align-items: center; gap: 8px; min-width: 0; background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: 15px; }
.where-txt { display: flex; flex-direction: column; min-width: 0; text-align: left; line-height: 1.2; }
.where-txt > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
#whereAddr, #whereCity { font-size: 12px; color: var(--muted); }
#whereAddr { margin-top: 2px; }
.where:has(#whereAddr:not([hidden])) { border-radius: 16px; padding-block: 6px; }
.radius-field { margin: 8px 0; }
.radius-seg button { min-width: 0; padding-inline: 2px; white-space: nowrap; font-size: 15px; }
.where svg { flex: none; }
.sample { margin: 12px 0 0; font-size: 14px; color: var(--muted); background: var(--green-soft); border-radius: 10px; padding: 8px 12px; }

/* Botões e campos comuns */
.btn { border: 0; border-radius: 14px; font-weight: 700; padding: 0 20px; min-height: 52px; }
.btn-primary { background: var(--green); color: var(--green-ink); }
.btn-ghost { background: transparent; border: 2px solid var(--line); }
.btn-danger { background: transparent; color: var(--danger); border: 2px solid var(--line); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.hint { font-size: 14px; color: var(--muted); margin: 0; }
.linkbtn { background: none; border: 0; color: var(--green); font-weight: 700; text-align: left; padding: 4px 0; }
.h2 { font-family: var(--font-display); font-weight: 800; font-size: 26px; letter-spacing: -.01em; margin: 20px 0 4px; text-wrap: balance; }
.lead { color: var(--muted); margin: 0 0 14px; }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.seg { display: flex; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 10px; min-height: 46px; font-weight: 700; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--green); color: var(--green-ink); }
.switch { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.switch input { width: 24px; height: 24px; accent-color: var(--green); flex: none; }
.pill { display: inline-block; font-size: 13px; font-weight: 700; border-radius: 999px; padding: 3px 10px; background: var(--green-soft); color: var(--green); white-space: nowrap; }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.flat { background: var(--bg); color: var(--muted); }
/* Variação de preço: caiu = verde, subiu = vermelho */
.pill.down { background: var(--down-soft); color: var(--down); }
.pill.up { background: var(--up-soft); color: var(--up); }

/* Índice de listas */
.lists-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.lists-head .h2 { margin-bottom: 12px; }
.lists-head .btn { min-height: 46px; padding: 0 16px; margin-bottom: 12px; }
.when-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 22px 4px 8px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.when-h b { letter-spacing: 0; text-transform: none; font-size: 15px; color: var(--ink); }
.lcards { display: grid; gap: 10px; }
.lcard { width: 100%; text-align: left; background: var(--surface); border: 1.5px solid var(--line); border-radius: 18px; padding: 14px 16px; display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.cal { border-radius: 12px; border: 1.5px solid var(--line); overflow: hidden; text-align: center; background: var(--bg); }
.cal small { display: block; background: var(--green); color: var(--green-ink); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 0; }
.cal b { display: block; font-family: var(--font-display); font-size: 24px; font-weight: 800; line-height: 1.2; padding: 2px 0 4px; }
/* Calendário dos cartões segue a cor de destaque do tema (laranja nos dois temas) */
.lcard .cal { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.lcard.bought .cal small { background: var(--green); color: var(--green-ink); }
.l-name { font-weight: 700; font-size: 18px; overflow-wrap: anywhere; }
.l-sub { font-size: 14px; color: var(--muted); }
.l-right { text-align: right; display: grid; gap: 4px; justify-items: end; }
.l-total { font-weight: 700; font-size: 17px; white-space: nowrap; }
.prog { height: 6px; border-radius: 99px; background: var(--bg); overflow: hidden; margin-top: 6px; }
.prog i { display: block; height: 100%; background: var(--green); border-radius: 99px; }

/* Detalhe da lista */
.back { background: var(--green-soft); border: 1.5px solid var(--green); color: var(--green); font-weight: 700; padding: 8px 16px 8px 10px; margin-top: 12px; min-height: 44px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; }
.back:active { transform: scale(.98); }
.list-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-top: 6px; }
.list-title h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 26px; line-height: 1.15; overflow-wrap: anywhere; text-wrap: balance; }
.list-title p { margin: 2px 0 0; color: var(--muted); }
.opts { flex: none; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; min-height: 44px; padding: 0 12px; font-weight: 700; font-size: 15px; }
.banner { margin-top: 14px; background: var(--soft); border-radius: 14px; padding: 12px 14px; display: grid; gap: 2px; }
.banner b { font-size: 22px; font-family: var(--font-display); font-weight: 800; }
.finish { margin-top: 22px; display: grid; gap: 8px; }

/* Adicionar */
.add { margin-top: 16px; display: grid; gap: 10px; }
.add-row { display: flex; gap: 8px; }
.add input { flex: 1; min-width: 0; height: 56px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); padding: 0 16px; font-size: 18px; }
.add input:focus { border-color: var(--green); outline: none; }
.suggest { display: grid; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; }
.suggest button { text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 14px 16px; display: flex; justify-content: space-between; gap: 12px; }
.suggest button:first-child { border-top: 0; }
.suggest small { color: var(--muted); }
.suggest .dupe { background: var(--green-soft); }
.suggest .dupe span { font-weight: 700; }
.suggest .dupe small { color: var(--green); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: 15px; }
.chip::before { content: "+ "; color: var(--green); font-weight: 700; }

/* Itens */
.group { margin-top: 22px; }
.group-h { width: 100%; display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 6px 4px; background: none; border: 0; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; text-align: left; }
.group-h .lbl { flex: 1; }
.group-h svg { flex: none; transition: transform .15s; }
.group-h[aria-expanded="false"] svg { transform: rotate(-90deg); }
.group-h .count { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; letter-spacing: 0; }
.listbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; }
.listbar label { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.listbar input { width: 22px; height: 22px; accent-color: var(--green); }
.listbar .linkbtn { font-size: 15px; }
.items { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: 18px; border: 1px solid var(--line); overflow: hidden; }
.item { display: grid; grid-template-columns: 52px minmax(0, 1fr); border-top: 1px solid var(--line); padding: 8px 12px 12px 0; transition: background-color .6s; }
.item:first-child { border-top: 0; }
.item.flash { background: color-mix(in srgb, var(--tag) 35%, var(--surface)); transition: none; }
.check { width: 52px; height: 48px; display: grid; place-items: center; background: none; border: 0; align-self: start; }
.check i { width: 32px; height: 32px; border-radius: 50%; border: 2.5px solid var(--green); display: grid; place-items: center; }
.item.done .check i { background: var(--green); }
.check svg { opacity: 0; }
.item.done .check svg { opacity: 1; }
.main { display: grid; gap: 8px; min-width: 0; }
.line1 { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.body { background: none; border: 0; text-align: left; padding: 6px 0 0; min-width: 0; display: grid; gap: 1px; flex: 1; }
.name { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.meta { font-size: 14px; color: var(--muted); }
.askSize { color: var(--green); font-weight: 700; }
.item.done .name { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.del { flex: none; width: 44px; height: 44px; margin: 0 -8px 0 -4px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; border-radius: 10px; }
.del { color: var(--danger); }
.del:hover, .del:focus-visible { background: var(--danger-soft); }
.subtotal { text-align: right; padding-top: 6px; white-space: nowrap; }
.subtotal b { display: block; font-size: 18px; }
.subtotal small { font-size: 12px; color: var(--muted); }
.ctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.step { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg); }
.step button { width: 42px; height: 44px; border: 0; background: none; font-size: 22px; font-weight: 700; line-height: 1; }
.step input { width: 54px; height: 44px; border: 0; background: none; text-align: center; font-weight: 700; font-size: 17px; padding: 0; }
.unit { display: flex; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; height: 47px; }
.unit button { border: 0; background: var(--surface); min-width: 42px; font-weight: 700; font-size: 15px; color: var(--muted); }
.unit button[aria-pressed="true"] { background: var(--green); color: var(--green-ink); }
.pfield { position: relative; flex: 1 1 128px; min-width: 128px; display: flex; align-items: center; gap: 4px; height: 47px; background: var(--tag); color: var(--tag-ink); border-radius: 6px 12px 12px 6px; padding: 0 10px 0 20px; }
.pfield::before { content: ""; position: absolute; left: 7px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--surface); }
.pfield.empty { background: var(--surface); color: var(--ink); border: 1.5px dashed var(--muted); }
.pfield.empty::before { background: var(--line); }
.pfield span { font-size: 14px; font-weight: 700; white-space: nowrap; }
.pfield input { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; font-weight: 700; font-size: 18px; color: inherit; text-align: right; padding: 0; }
.pfield input::placeholder { color: inherit; opacity: .55; font-weight: 400; font-size: 15px; }
.pfield input:focus { outline: none; }
.pfield:focus-within { outline: 3px solid var(--green); outline-offset: 2px; }
.extra { font-size: 13px; color: var(--muted); margin: -2px 0 0; }
.extra .confirm { margin-left: 4px; border: 1.5px solid var(--green); color: var(--green); background: transparent; border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: 13px; min-height: 34px; vertical-align: middle; }
.item.done .pfield { opacity: .8; }
.bought-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.bought-row:first-child { border-top: 0; }
.bought-row .r-name { font-weight: 700; overflow-wrap: anywhere; }
.bought-row .r-price { font-weight: 700; text-align: right; }
.bought-row .r-sub { grid-column: 1 / -1; font-size: 14px; color: var(--muted); }
.bought-row.missed .r-name { color: var(--muted); font-weight: 400; }

/* Barra de baixo */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-block: 10px; }
.total { border-radius: 12px; padding: 8px 12px; background: var(--bg); }
.total b { display: block; font-size: 21px; font-family: var(--font-display); font-weight: 800; }
.total span { font-size: 13px; color: var(--muted); }
.total.cart { background: var(--green-soft); }
.totals-note { grid-column: 1 / -1; font-size: 13px; color: var(--muted); margin: -2px 2px 0; }
.nav { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
.nav button { background: none; border: 0; padding: 9px 2px 11px; display: grid; justify-items: center; gap: 2px; font-size: 12.5px; color: var(--muted); min-height: 60px; }
.nav button[aria-current="page"] { color: var(--green); font-weight: 700; }
.nav svg { width: 24px; height: 24px; }

/* Comparar */
.controls { display: grid; gap: 12px; margin-bottom: 16px; }
.pick-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.pick-list button { flex: none; border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-size: 15px; }
.pick-list button[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); font-weight: 700; }
.markets { display: grid; gap: 12px; }
.market { background: var(--surface); border: 1.5px solid var(--line); border-radius: 18px; padding: 16px; display: grid; gap: 10px; }
.market.best { border-color: var(--green); box-shadow: var(--shadow); }
.m-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.m-name { font-weight: 700; font-size: 18px; }
.m-dist { font-size: 14px; color: var(--muted); }
.m-total { font-family: var(--font-display); font-weight: 800; font-size: 26px; white-space: nowrap; }
.m-badges { display: flex; flex-wrap: wrap; gap: 6px; }
details summary { cursor: pointer; color: var(--green); font-weight: 700; padding: 6px 0; }
.rows { list-style: none; margin: 6px 0 0; padding: 0; display: grid; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.row .r-name { font-weight: 700; overflow-wrap: anywhere; }
.row .r-price { font-weight: 700; text-align: right; }
.row .r-sub { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.row.missing .r-price { color: var(--muted); font-weight: 400; }
.fine { font-size: 13px; color: var(--muted); margin: 16px 4px; }

/* Gastos */
.spend-hero { display: grid; gap: 4px; margin-top: 8px; }
.spend-hero .big { font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 1.05; letter-spacing: -.02em; }
.spend-hero p { margin: 0; color: var(--muted); }
.chart { position: relative; margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 10px 6px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .bar { fill: var(--bar); }
.chart .bar.sel { fill: var(--green); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart text { fill: var(--muted); font-family: var(--font-body); font-size: 12px; }
.chart text.sel { fill: var(--ink); font-weight: 700; }
.chart text.val { fill: var(--ink); font-weight: 700; font-size: 12.5px; }
.chart g[role="button"]:focus-visible .bar { stroke: var(--ink); stroke-width: 2; }
.chart g[role="button"]:focus { outline: none; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); border-radius: 8px; padding: 6px 10px; font-size: 13px; white-space: nowrap; transform: translate(-50%, -100%); }
.section { margin-top: 26px; }
.section h3 { margin: 0 0 4px; font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.section > p { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.catbars { display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.catbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
.catbar .t { height: 10px; grid-column: 1 / -1; background: var(--bg); border-radius: 99px; overflow: hidden; }
.catbar .t i { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.catbar span { font-size: 15px; }
.catbar b { font-size: 15px; white-space: nowrap; }
.vlist { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.vlist li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 16px; border-top: 1px solid var(--line); align-items: center; }
.vlist li:first-child { border-top: 0; }
.vlist .v-name { font-weight: 700; overflow-wrap: anywhere; }
.vlist .v-sub { font-size: 14px; color: var(--muted); }
.vlist .pill { grid-row: span 2; }
.buys { display: grid; gap: 8px; }

/* Mais */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-top: 14px; display: grid; gap: 10px; }
.card h3 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.card p { margin: 0; color: var(--muted); }
.card ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.removed { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.removed:first-of-type { border-top: 0; }
.removed small { display: block; color: var(--muted); font-size: 13px; }

/* Folha (sheet) */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 20px max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 14px; box-shadow: var(--shadow); }
.sheet h3 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 22px; overflow-wrap: anywhere; }
.sheet > h3:nth-child(2) { padding-right: 44px; }
.sheet-x { position: sticky; top: 0; justify-self: end; z-index: 2; width: 40px; height: 40px; margin: -6px -6px -54px 0; border-radius: 999px; border: 0; background: var(--green); color: var(--green-ink); font-size: 28px; font-weight: 700; line-height: 1; display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.sheet-x:hover { filter: brightness(1.08); }
.sheet-x:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
/* Computador e tablet: janela no meio da tela, não presa embaixo */
@media (min-width: 600px) {
  .scrim { align-items: center; padding: 24px; }
  .sheet { border-radius: 22px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); padding-bottom: 20px; }
}
.sheet .sub { margin: -8px 0 0; color: var(--muted); font-size: 15px; }
.field { display: grid; gap: 6px; }
.field label, .field .lab { font-size: 14px; font-weight: 700; color: var(--muted); }
.field input { height: 52px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); padding: 0 14px; font-size: 18px; min-width: 0; width: 100%; }
.field input:focus { border-color: var(--green); outline: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.box { border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 12px; }
.box h4 { margin: 0; font-size: 16px; }
.known { font-size: 14px; color: var(--muted); margin: 0; }
.opt { padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--bg); text-align: left; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.opt[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); }
.opt small { color: var(--muted); font-size: 14px; white-space: nowrap; }
.actions { display: grid; gap: 10px; }
.chips-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-pick button { border: 1.5px solid var(--line); background: var(--bg); border-radius: 999px; padding: 9px 14px; font-size: 15px; min-height: 42px; }
.chips-pick button[aria-pressed="true"] { background: var(--green); color: var(--green-ink); border-color: var(--green); font-weight: 700; }
.checkline { display: flex; gap: 10px; align-items: flex-start; }
.checkline input { width: 24px; height: 24px; accent-color: var(--green); flex: none; margin-top: 1px; }

/* Aviso */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + env(safe-area-inset-bottom, 0px)); z-index: 50; width: min(528px, calc(100% - 32px)); background: var(--ink); color: var(--bg); border-radius: 14px; padding: 12px 12px 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; box-shadow: var(--shadow); }
body.with-totals .toast { bottom: calc(176px + env(safe-area-inset-bottom, 0px)); }
.toast button { background: none; border: 0; color: var(--tag); font-weight: 700; padding: 8px 10px; white-space: nowrap; }
@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: up .22s ease-out; }
  .sheet.nudge { animation: nudge .3s ease-in-out; }
  @keyframes nudge { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
  .toast { animation: fade .2s ease-out; }
  @keyframes up { from { transform: translateY(30px); opacity: .6; } }
  @keyframes fade { from { opacity: 0; } }
}

/* Base da página */
html { -webkit-text-size-adjust: 100%; padding-top: env(safe-area-inset-top, 0px); }
body { margin: 0; min-height: 100vh; }
[hidden] { display: none !important; }
img { max-width: 100%; }

/* Específicos do app */
.notice { margin: 12px 0 0; font-size: 14px; border-radius: 10px; padding: 8px 12px; background: var(--green-soft); color: var(--ink); display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.notice.warn { background: var(--warn-soft); }
.notice .linkbtn { font-size: 14px; padding: 0; }
.welcome { margin-top: 14px; background: var(--surface); border: 2px solid var(--green); border-radius: 18px; padding: 16px; display: grid; gap: 10px; }
.welcome h3 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 22px; }
.welcome ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.welcome .row2 { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search { display: flex; gap: 8px; }
.search input { flex: 1; min-width: 0; height: 52px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); padding: 0 14px; font-size: 17px; }
.search input:focus { border-color: var(--green); outline: none; }
.mlist { display: grid; gap: 8px; }
.opt .addr { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.loading { color: var(--muted); font-size: 15px; padding: 8px 2px; }
.place { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 14px; font-size: 15px; }
.place b { display: block; }
.place .linkbtn { white-space: nowrap; }
.kvs { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 15px; }
.kvs dt { color: var(--muted); }
.kvs dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.version { text-align: center; color: var(--muted); font-size: 13px; margin: 18px 0 0; }
a { color: var(--green); }

/* Microfone */
.add-row .mic { flex: none; width: 56px; height: 56px; border-radius: 14px; border: 2px solid var(--green); background: var(--surface); color: var(--green); display: grid; place-items: center; }
.add-row .mic.listening { background: var(--green); color: var(--green-ink); box-shadow: 0 0 0 6px var(--green-soft); }
@media (prefers-reduced-motion: no-preference) {
  .add-row .mic.listening { animation: ouvindo 1.2s ease-in-out infinite; }
  @keyframes ouvindo { 50% { box-shadow: 0 0 0 10px var(--green-soft); } }
}
#voiceStatus:empty { display: none; }
@media (max-width: 380px) { .add-row .btn { padding: 0 14px; } }
.add { grid-template-columns: minmax(0, 1fr); }
.add-row input { flex: 1 1 0; width: 0; }

/* Aviso de microfone ligado (fixo no topo, impossível de não ver) */
.mic-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 60; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); background: var(--warn); color: #fff; font-weight: 700; font-size: 16px; box-shadow: var(--shadow); }
.mic-banner span:nth-child(2) { flex: 1; }
.mic-banner .dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; flex: none; }
.mic-banner button { background: #fff; color: var(--warn); border: 0; border-radius: 10px; font-weight: 700; padding: 8px 16px; min-height: 40px; }
@media (prefers-reduced-motion: no-preference) { .mic-banner .dot { animation: piscar 1s ease-in-out infinite; } @keyframes piscar { 50% { opacity: .3; } } }

.brand .beta { font-family: var(--font-body); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; vertical-align: middle; background: var(--tag); color: var(--tag-ink); border-radius: 6px; padding: 2px 6px; }
.beta-card { border: 2px solid var(--tag); }

/* Apagar listas: botão no cartão, modo "Apagar várias" e preços estimados */
.lwrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; background: var(--surface); border: 1.5px solid var(--line); border-radius: 18px; }
.lwrap .lcard { border: 0; background: transparent; padding-right: 4px; }
.ldel { width: 44px; height: 44px; margin-right: 8px; border: 0; background: none; color: var(--danger); border-radius: 10px; display: grid; place-items: center; }
.ldel:hover, .ldel:focus-visible { background: var(--danger-soft); }
.lcard.sel[aria-pressed="true"] { border-color: var(--green); box-shadow: inset 0 0 0 1.5px var(--green); }
.selbox { width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 800; color: var(--green-ink); }
.lcard.sel[aria-pressed="true"] .selbox { background: var(--green); border-color: var(--green); }
.selactions { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.selactions .btn { min-height: 50px; }
.subtotal.est b { color: var(--muted); font-weight: 700; }
.price-note { margin-top: 22px; }

/* Comparar: lista escolhida, itens sem preço e resumo dentro da lista */
.listpick { width: 100%; text-align: left; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; color: inherit; }
.listpick:disabled { opacity: 1; }
.listpick small { display: block; font-size: 13px; color: var(--muted); }
.listpick b { display: block; font-size: 18px; overflow-wrap: anywhere; }
.switch span small { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.m-missing { font-size: 14px; color: var(--muted); margin: 8px 0 0; }
.m-missing b { color: var(--ink); }
.missing-card { border-color: var(--warn); }
.cmp-mini { margin-top: 14px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 14px; display: grid; gap: 6px; font-size: 15px; }
.cmp-mini h3 { margin: 0; font-size: 15px; }
.cmp-mini ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.cmp-mini li { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.cmp-mini .nm small { display: block; font-size: 13px; color: var(--muted); }
.cmp-mini .linkbtn { justify-self: start; font-size: 15px; }
.cmp-mini li > b, .m-total { white-space: nowrap; }
.cmp-mini .foot { font-size: 13px; color: var(--muted); margin: 0; }

/* Espaço entre os avisos e cartões do Comparar */
#view-comparar .notice { margin: 0 0 14px; }
#view-comparar .lead { margin-bottom: 10px; }
.missing-card { margin-bottom: 14px; }
.cmp-mini { position: relative; }
.cmp-mini h3 { padding-right: 44px; }
.cmp-mini .mini-del { position: absolute; top: 4px; right: 4px; margin: 0; }
.chart text.val.dim { fill: var(--muted); font-weight: 700; font-size: 11px; }
.m-cheap { font-size: 14px; color: var(--muted); margin: 8px 0 0; }
.m-cheap b { color: var(--green); }
.perunit { font-size: 13px; color: var(--muted); margin: -4px 0 0; }

/* Listas apagadas (Mais) */
.trash-rows { display: grid; margin-top: 4px; }
.trow { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.trow:first-child { border-top: 0; }
.trow input { width: 24px; height: 24px; flex: none; accent-color: var(--green); }
.trow b { display: block; overflow-wrap: anywhere; }
.trow small { display: block; color: var(--muted); font-size: 13px; }
#trashCard .listbar { margin-top: 8px; }

/* Campo de data dia/mês/ano com botão de calendário */
.datefield { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 8px; }
.datefield #f-date.bad { border-color: var(--danger); }
.calbtn { width: 52px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--green); display: grid; place-items: center; }
#f-date-native { position: absolute; right: 0; bottom: 0; width: 52px; height: 100%; opacity: 0; pointer-events: none; }

/* Nota fiscal */
.nota-btn { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; }
.cam { position: relative; border-radius: 16px; overflow: hidden; background: #000; }
.cam video { display: block; width: 100%; aspect-ratio: 4 / 3; max-height: 55vh; object-fit: cover; }
.cam .hint { margin: 0; padding: 10px 12px; background: #000; color: #fff; }
.filebtn { position: relative; display: grid; place-items: center; cursor: pointer; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.nota-link summary { color: var(--green); font-weight: 700; cursor: pointer; }
.nota-link .search { margin-top: 8px; }
.nlist { display: grid; gap: 0; border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; }
.nrow { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 12px; border-top: 1px solid var(--line); }
.nrow:first-child { border-top: 0; }
.nrow > input[type="checkbox"] { width: 24px; height: 24px; margin-top: 10px; accent-color: var(--green); }
.nrow .nname { width: 100%; font-weight: 700; }
.nrow .nbrand { width: 100%; margin-top: 4px; font-size: .9em; padding: 6px 8px; }
.nrow small { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; overflow-wrap: anywhere; }
#notaErr:empty { display: none; }
#notaErr { color: var(--danger); font-weight: 700; }
.nota-card { display: grid; gap: 12px; }
.cam-view { position: relative; }
.cam-guide { position: absolute; left: 50%; top: 50%; height: 72%; aspect-ratio: 1 / 1; transform: translate(-50%, -50%); border: 3px solid rgba(255, 255, 255, .9); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .25); pointer-events: none; }
/* Zoom e lanterna numa faixa embaixo da imagem (em cima dela, cobriam o quadro e se sobrepunham com a fonte grande do celular) */
.cam-tools { display: flex; gap: 8px; padding: 10px 12px 0; background: #000; }
.cam-tools:empty { display: none; }
.cam-tools button { flex: 1 1 0; min-width: 0; border: 1.5px solid rgba(255, 255, 255, .35); border-radius: 999px; padding: 8px 6px; min-height: 44px; font-size: 15px; line-height: 1.2; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: transparent; color: #fff; }
.cam-tools button[data-torch] { flex-grow: 2; }
.cam-tools button[aria-pressed="true"] { background: var(--green); color: var(--green-ink); }
.nhist { display: grid; border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.nh { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.nh:first-child { border-top: 0; }
.nh small { display: block; color: var(--muted); font-size: 13px; }
.nh .btn { min-height: 44px; padding: 0 16px; }

/* Conta e família */
.rcode { font-family: var(--font-mono); font-size: 20px; font-weight: 700; letter-spacing: .04em; text-align: center; background: var(--bg); border: 2px dashed var(--green); border-radius: 14px; padding: 16px; margin: 0; overflow-wrap: anywhere; }
.code-input { letter-spacing: .4em; font-size: 26px !important; text-align: center; }
.hint.err:empty { display: none; }
.hint.err { color: var(--danger); font-weight: 700; }
.notice.fam { background: var(--green-soft); }
a.linkbtn-a { display: grid; place-items: center; text-decoration: none; }
#acctCard .btn { margin-top: 8px; }

/* Conta: opções de entrar, perfil */
.opt-block { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; margin: 12px 0; display: grid; gap: 8px; }
.opt-block > .lab { font-weight: 800; font-size: 14px; }
.oauth-btn { width: 100%; }
.linkrow { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; }
.field.two { display: grid; grid-template-columns: minmax(0, 1fr) 92px; gap: 10px; }
.field.two > div { display: grid; gap: 6px; }
.field select { width: 100%; height: 52px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); padding: 0 10px; font-size: 18px; }
.field select:focus { border-color: var(--green); outline: none; }
.ferr { color: var(--danger); font-weight: 700; display: block; }
.ferr:empty { display: none; }
.danger-zone { margin-top: 12px; }
.danger-zone summary { cursor: pointer; color: var(--danger); font-weight: 700; padding: 6px 0; }
button[aria-busy="true"] { cursor: progress; opacity: .8; }
.days-row { display: flex; align-items: center; gap: 10px; }
.days-row input { max-width: 110px; }
input.bad, input[aria-invalid="true"] { border-color: var(--danger) !important; }
/* Selo de nota fiscal */
.nf-badge { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; padding: 1px 7px 1px 5px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 800; vertical-align: middle; white-space: nowrap; }
.nf-badge .nf-ico { width: 14px; height: 14px; }
.list-title h2 .nf-badge { font-size: 13px; }
.notice.nf { display: flex; gap: 8px; align-items: flex-start; }
.notice.nf .nf-ico { flex: none; margin-top: 2px; color: var(--green); }
.btn .nf-ico { vertical-align: -3px; margin-right: 4px; }
/* Edição do item: lápis logo depois do nome (longe da lixeira e do marcador) */
.item .name .edit-ico { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-left: 6px; border-radius: 999px; background: var(--green-soft); color: var(--green); vertical-align: -5px; }
.item .body:hover .edit-ico, .item .body:focus-visible .edit-ico { background: var(--green); color: var(--green-ink); }
.warn-text { color: var(--danger); }
#nameSuggest:not(:empty) { margin-top: 4px; display: grid; gap: 6px; }
.cep-found { border: 1.5px solid var(--green); border-radius: 12px; padding: 10px 12px; margin-top: 6px; display: grid; gap: 8px; }
.cep-found p { margin: 0; }
.box h4 { margin: 0; }
/* Gastos: período */
.period-seg { margin-top: 12px; }
.period-seg button { min-width: 0; padding-inline: 4px; font-size: 15px; }
.years { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.years .chip[aria-pressed="true"] { background: var(--green); color: var(--green-ink); border-color: var(--green); }
.month-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin-top: 12px; min-height: 44px; }
.month-nav > :last-child { justify-self: end; }
.chart-hint { margin-top: 6px; text-align: center; }
.month-nav .linkbtn { min-height: 44px; }
/* Conta: entrar / criar conta */
.auth-title { text-align: center; font-size: 24px; margin: 4px 0 0; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--bg); border: 1.5px solid var(--line); border-radius: 14px; }
.auth-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-weight: 700; }
.auth-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.auth-pane { display: grid; gap: 14px; }
.ifield { position: relative; display: flex; align-items: center; }
.ifield > svg { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.field .ifield input { padding-left: 46px; }
.ifield .eye { position: absolute; right: 6px; width: 44px; height: 44px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; border-radius: 10px; }
.ifield:has(.eye) input { padding-right: 52px; }
.linkrow.end { justify-content: flex-end; margin-top: -6px; }
.linkbtn.center { justify-self: center; text-align: center; }
.btn-block:has(svg), .oauth-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.oauth-btn { width: 100%; background: var(--surface); border: 2px solid var(--line); color: var(--ink); }
.oauth-btn:hover { border-color: var(--muted); }
.prov-logo { width: 20px; height: 20px; flex: none; }
.captcha { min-height: 65px; display: grid; place-items: center; }
.captcha .captcha-wait { margin: 0; }
.m-addr { font-size: 14px; color: var(--muted); line-height: 1.35; }
.m-addr + .m-dist, .m-name + .m-dist { margin-top: 2px; }

/* ---------- 1.1: quem fez o quê, planos, família, críticas ---------- */
.who { margin: 4px 0 0; font-size: 13px; color: var(--muted); line-height: 1.35; }
.obs-link { display: block; margin: 8px 0 0; font-size: 14px; }
.notice.done { background: var(--green-soft); }
.obs-list { list-style: none; margin: 10px 0; padding: 0; max-height: 52vh; overflow: auto; }
.obs-list li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.obs-list li:first-child { border-top: 0; }
.obs-when { color: var(--muted); font-size: 13px; padding-top: 2px; }
.plan-table { margin: 12px 0; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 13.5px; }
.pt-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1fr); border-top: 1px solid var(--line); }
.pt-row:first-child { border-top: 0; }
.pt-row > span { padding: 8px 5px; overflow-wrap: break-word; hyphens: auto; }
.pt-row > span:not(:first-child) { text-align: center; }
.pt-head { font-weight: 700; background: var(--bg); }
.pt-me { background: var(--green-soft); font-weight: 700; }
.plan-card h3 small { font-size: 12px; vertical-align: middle; }
.lock-card .lock-list { margin: 8px 0 12px; padding-left: 20px; }
.lock-card .lock-list li { margin: 4px 0; }
.members { list-style: none; margin: 8px 0 12px; padding: 0; }
.members li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.members li:first-child { border-top: 0; }
.members li > span:first-child { display: grid; min-width: 0; }
.members small { color: var(--muted); font-size: 13px; }
.row-btns { display: flex; gap: 6px; flex: none; }
.btn.btn-sm { min-height: 40px; padding: 6px 12px; font-size: 14px; width: auto; }
.code { font-size: 20px; letter-spacing: 1px; }
.sheet h4 { margin: 16px 0 4px; font-size: 16px; }
.field textarea { width: 100%; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); padding: 12px 14px; font: inherit; font-size: 17px; color: inherit; resize: vertical; min-height: 120px; }
.field textarea:focus { border-color: var(--green); outline: none; }
.ctl[inert] { opacity: .55; }
.test-card { border-style: dashed; }

/* 1.2.0: filtro das listas, gastos de quem, permissões e críticas recebidas */
.seg-sm { margin-top: 8px; }
.seg-sm button { font-size: 13.5px; padding: 6px 8px; }
.perm-list { display: grid; gap: 2px; margin: 8px 0; }
.perm-list small { font-weight: 400; }
.crit-list { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 10px; }
.crit-list li { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--card, transparent); }
.crit-list li.lida { opacity: .7; }
.crit-meta { margin: 0 0 4px; font-size: 13px; color: var(--muted, inherit); }
.crit-txt { margin: 0 0 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
/* 1.4: etiqueta do tipo do estabelecimento e ações compactas */
.tipo-chip { display: inline-block; margin: 2px 0 2px; padding: 1px 8px; border-radius: 999px; background: var(--chip, var(--line)); color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.6; }
.opt .tipo-chip { display: table; }
.place-acts { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.row-acts { display: grid; gap: 8px; }
.row-acts:empty { display: none; }
#placeCard .field + .switch, #placeCard .switch + .field { margin-top: 12px; }
.diag { margin-top: 8px; }
.diag summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.diag p { word-break: break-word; }
.sond { width: 100%; border-collapse: collapse; font-size: 14px; }
.sond th, .sond td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.sond td small { display: block; color: var(--muted); font-size: 12px; word-break: break-all; }
.sond tr.ruim td:nth-child(2) { color: var(--warn, #b45309); }
/* Confirmação de idade e termos na tela de entrar (18+) */
.check-line { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; font-size: 14px; line-height: 1.4; }
.check-line input { width: 22px; height: 22px; accent-color: var(--green); flex: none; margin: 0; }
.check-line a { color: inherit; text-decoration: underline; }
/* Convite do app Android (só no navegador de um Android, com lojaAndroid ligado) */
.notice.loja-app { background: var(--green-soft); align-items: flex-start; }
.loja-acoes { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; width: 100%; }
.loja-acoes .btn { min-height: 40px; padding: 8px 14px; font-size: 15px; }
.loja-acoes .btn { text-decoration: none; display: inline-flex; align-items: center; }
.pt-todos { margin: 4px 0 12px; font-size: 14.5px; }
.pt-todos p { margin: 0 0 4px; }
.pt-todos ul { margin: 0; padding-left: 20px; display: grid; gap: 3px; }
/* 1º toque fora da janela: aviso de que o 2º fecha */
.scrim-hint { position: absolute; top: max(16px, env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: 15px; white-space: nowrap; z-index: 3; pointer-events: none; }
.scrim-hint[hidden] { display: none; }
/* Sem seleção de texto nem menu de tocar e segurar no app; campos e detalhes técnicos continuam selecionáveis */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, [contenteditable], .diag, .selecionavel { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }

/* ---------- Formatos do item da lista (1.6) ---------- */
.item.fmt-e, .item.fmt-b { padding: 6px 12px 8px 0; }
.item.fmt-e .main, .item.fmt-b .main { gap: 6px; }
.item.fmt-e .check, .item.fmt-b .check { height: 44px; }
.item.fmt-e .line1 { align-items: center; }
.item.fmt-e .body { padding: 0; min-height: 40px; display: flex; align-items: center; }
.c-nome { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.c-nome .meta { font-weight: 400; }
.c-ctl { flex-wrap: nowrap; }
.c-ctl .step button { width: 32px; height: 42px; }
.c-ctl .step input { width: 46px; height: 42px; }
.c-ctl .step .u-troca { width: auto; min-width: 40px; padding: 0 6px; font-size: 15px; color: var(--green); border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; display: inline-flex; align-items: center; gap: 2px; }
.c-ctl .step .u-troca small { font-size: 11px; }
.c-ctl .pfield { min-width: 0; flex: 1 1 0; height: 45px; padding-left: 18px; }
.c-ctl .pfield input { font-size: 17px; }
.c-l3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13.5px; color: var(--muted); min-height: 20px; }
.c-info { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-tot { white-space: nowrap; margin-left: auto; }
.c-tot b { color: var(--ink); }
.c-tot.est b { color: var(--muted); }
.c-l3 .confirm { flex: none; border: 1.5px solid var(--green); color: var(--green); background: transparent; border-radius: 999px; padding: 2px 10px; font-weight: 700; font-size: 13px; min-height: 30px; }
.item.fmt-b .c-linha { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; padding: 4px 0; text-align: left; min-height: 44px; color: inherit; }
.c-txt { flex: 1; min-width: 0; display: grid; }
.c-resumo { font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-preco { font-weight: 700; white-space: nowrap; font-size: 16px; }
.c-preco.vazio { color: var(--muted); font-weight: 400; border: 1.5px dashed var(--line); border-radius: 8px; padding: 2px 10px; }
.c-preco.est { color: var(--muted); }
.c-seta { color: var(--muted); font-size: 20px; width: 14px; text-align: center; }
.item.fmt-b.aberto { background: var(--green-soft); }
.c-acoes { display: flex; justify-content: space-between; align-items: center; }
.c-acoes .del { margin: 0; }
.item.done .c-nome { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.fmt-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fmt-pick button { display: grid; gap: 6px; justify-items: center; padding: 10px 6px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); font-weight: 700; font-size: 14px; color: var(--ink); }
.fmt-pick button[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.fmt-mini { display: grid; gap: 3px; width: 54px; }
.fmt-mini i { display: block; height: 5px; border-radius: 3px; background: var(--muted); opacity: .45; }
.fmt-mini-b i:nth-child(n+2) { display: none; }
.fmt-mini-b i { height: 7px; }
.fmt-mini-atual i { height: 7px; }
.fmt-mini-atual i:nth-child(2) { width: 70%; }
.fmt-mini-e i:nth-child(3) { width: 45%; justify-self: end; }
.item.fmt-e .main > *, .item.fmt-b .main > * { min-width: 0; max-width: 100%; }
.item.fmt-e .line1 .body { flex: 1; min-width: 0; }
.casar { display: grid; gap: 12px; }
.casar small { color: var(--muted); }
.resumo-nota { margin: 0; padding-left: 4px; list-style: none; display: grid; gap: 8px; font-size: 16px; }

/* ---------- Guia da primeira vez e Ajuda (1.6) ---------- */
#guiaHost { position: fixed; left: 0; right: 0; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 35; display: flex; justify-content: center; padding: 0 12px; pointer-events: none; }
.guia { pointer-events: auto; width: 100%; max-width: 520px; background: var(--ink); color: var(--bg); border-radius: 18px; padding: 14px 16px 12px; box-shadow: var(--shadow); }
.guia h3 { margin: 2px 0 4px; font-family: var(--font-display); font-size: 19px; }
.guia p { margin: 0; font-size: 15.5px; }
.guia .guia-passo { font-size: 12.5px; opacity: .75; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.guia-acoes { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.guia-acoes .linkbtn { color: var(--bg); opacity: .85; }
.guia-acoes .btn { background: var(--green); color: var(--green-ink); min-height: 42px; }
.guia-alvo { outline: 3px solid var(--green) !important; outline-offset: 3px; border-radius: 12px; position: relative; z-index: 2; }
@keyframes guia-pulso { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 45%, transparent); } 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--green) 0%, transparent); } }
@media (prefers-reduced-motion: reduce) { .guia-alvo { animation: none; } }
.ajuda { display: grid; gap: 8px; }
.ajuda details { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface); }
.ajuda summary { font-weight: 700; cursor: pointer; }
.ajuda ol { margin: 8px 0; padding-left: 22px; display: grid; gap: 4px; }
.ajuda .btn { min-height: 40px; }
.geo-intro p { margin: 0 0 10px; }

/* ---------- Premium (1.6) ---------- */
.notice.alerta { background: var(--down-soft); color: var(--ink); }
.orc .orc-barra { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 4px 0 6px; }
.orc .orc-barra i { display: block; height: 100%; background: var(--green); border-radius: 999px; }
.orc.perto .orc-barra i { background: var(--warn); }
.orc.passou .orc-barra i { background: var(--danger); }
.orc p { margin: 0 0 4px; }
.exportar { margin: 0 0 14px; }
.dividir .lab { margin: 0 0 4px; font-weight: 700; font-size: 14px; }
.dividir-seg { display: inline-grid; grid-template-columns: repeat(3, 52px); margin-bottom: 10px; }
.div-grupo { border-top: 1px solid var(--line); padding: 8px 0; }
.div-top { display: flex; justify-content: space-between; gap: 10px; }
.div-grupo .hint { margin: 2px 0 0; }
.div-economia { margin: 6px 0; font-size: 16px; color: var(--down); }
.dividir.teaser p { margin: 0 0 8px; }
.sugestoes .sug-top { display: flex; justify-content: space-between; align-items: center; }
.sugestoes h3 { margin: 0; }
.sugestoes .chips-pick { margin: 8px 0 4px; }
.pagou-caro h4 { margin: 4px 0 6px; }
.pagou-caro ul { margin: 0 0 6px; padding-left: 18px; display: grid; gap: 4px; }
.pagou-caro li.acima span { color: var(--up); font-weight: 700; }
.pagou-caro li.abaixo span { color: var(--down); font-weight: 700; }
.premium-box .alerta-linha { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.premium-box .alerta-linha label { font-weight: 700; white-space: nowrap; }
.premium-box .alerta-linha input { flex: 1; min-width: 0; height: 44px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 10px; font-weight: 700; background: var(--surface); }
.premium-box .alerta-linha .btn { min-height: 44px; flex: none; }
.hist { width: 100%; height: auto; background: var(--bg); border-radius: 12px; }
.hist-faixa { margin: 6px 0 10px; }
.hist-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hist-lista li { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; }
.hist-lista small { color: var(--muted); grid-column: 1 / -1; font-size: 12.5px; }
.alertas { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 6px; }
.alertas li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.linkbtn.danger { color: var(--danger); }
.sheet > * { min-width: 0; }
.premium-box .alerta-linha input { width: 0; }

/* ---------- Tela da lista (1.6.1): topo enxuto, total embaixo do nome, adicionar embaixo ---------- */
.lhead { display: flex; align-items: center; gap: 8px; margin: 12px 0 14px; }
.lhead .back { margin: 0; padding: 4px 12px 4px 6px; min-height: 42px; background: var(--soft); border: 0; color: var(--ink); }
.lhead-sp { flex: 1; }
.btn-comp { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 14px; border: 0; border-radius: 999px; background: #1A9150; color: #fff; font-weight: 700; font-size: 15.5px; white-space: nowrap; }
.btn-comp:active, .btn-edit:active { transform: scale(.97); }
.btn-edit { width: 42px; height: 42px; flex: none; border: 0; border-radius: 999px; background: var(--soft); color: var(--ink); display: grid; place-items: center; }
.list-title { margin: 0 0 10px; }
.list-title h2 { margin: 0; font-size: 26px; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.list-title p { margin: 2px 0 0; }
.totais { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 6px; }
.totais .tot { display: flex; flex-direction: column; align-items: center; background: var(--soft); border-radius: 12px; padding: 6px 8px; }
.totais .tot span { font-size: 14.5px; color: var(--muted); }
.totais .tot b { font-size: 21px; line-height: 1.25; }
.totais .tot.cart b { color: var(--green); }
.totais-nota { text-align: center; font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.totais-nota .linkbtn { font-size: 13px; padding: 0; }
body.com-addbar { padding-bottom: calc(180px + env(safe-area-inset-bottom, 0px)); }
.addbar { position: fixed; left: 0; right: 0; bottom: var(--navh, 64px); z-index: 25; background: var(--bg); border-top: 1px solid var(--line); padding: 8px max(12px, env(safe-area-inset-left, 0px)) 8px; margin: 0; }
.addbar > * { width: 100%; max-width: 640px; margin-left: auto; margin-right: auto; }
.addbar.add { margin-top: 0; gap: 0; }
.addbar .add-row { display: flex; gap: 8px; align-items: center; }
.add-campo { flex: 1; min-width: 0; display: flex; align-items: center; background: var(--soft); border: 1.5px solid transparent; border-radius: 999px; height: 50px; padding: 0 4px 0 16px; }
.add-campo:focus-within { border-color: var(--green); background: var(--surface); }
.add-campo input { flex: 1; min-width: 0; border: 0; background: transparent; height: 100%; font-size: 17px; outline: none; padding: 0; }
.add-campo .mic { width: 42px; height: 42px; border: 0; background: transparent; color: var(--green); border-radius: 999px; display: grid; place-items: center; flex: none; }
.add-campo .mic.listening { background: var(--green); color: var(--green-ink); }
.add-mais { width: 50px; height: 50px; flex: none; border: 0; border-radius: 999px; background: var(--green); color: var(--green-ink); display: grid; place-items: center; }
.addbar #voiceStatus:empty { display: none; }
.addbar #voiceStatus { margin: 0 0 6px; text-align: center; }
.addbar #suggestBox:not(:empty) { margin: 0 auto 8px; max-height: 40vh; overflow: auto; }
.sug-linha { display: none; gap: 8px; align-items: center; overflow-x: auto; margin: 0 auto 8px; scrollbar-width: none; }
.sug-linha::-webkit-scrollbar { display: none; }
.addbar:focus-within .sug-linha { display: flex; }
.sug-linha b { font-size: 13px; color: var(--muted); white-space: nowrap; }
.sug-linha button { flex: none; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; font-size: 14.5px; white-space: nowrap; min-height: 36px; }
body.teclado .dock { display: none; }
body.teclado .addbar { bottom: var(--teclado, 0px); }
body.teclado #guiaHost { display: none; }
.scrim { bottom: var(--teclado, 0px); }
/* itens em cartões, campos em cinza claro */
#view-listas .group .items { border: 0; background: transparent; box-shadow: none; display: grid; gap: 8px; }
#view-listas .group .items > .item { background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; }
.item.fmt-e .c-ctl .step, .item.fmt-b .c-ctl .step { background: var(--soft); border-color: transparent; }
.item.fmt-e .c-ctl .pfield, .item.fmt-b .c-ctl .pfield { background: var(--soft); border: 1.5px solid transparent; }
.item.fmt-e .c-ctl .pfield.empty, .item.fmt-b .c-ctl .pfield.empty { border-style: solid; }
.item.fmt-e .c-ctl .pfield::before, .item.fmt-b .c-ctl .pfield::before { display: none; }
.c-ctl .pfield { padding-left: 10px; gap: 2px; }
.c-ctl .pfield span { font-size: 13.5px; }
#view-listas .notice + .list-title, #view-listas .notice + .notice { margin-top: 10px; }

/* 1.6.2 */
.fora-da-busca { display: none !important; }
.busca-aviso { text-align: center; color: var(--muted); margin: 16px 0; }
.item.fmt-b .c-txt { display: grid; gap: 2px; }
.c-l1 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.c-l1 .c-nome { flex: 1; min-width: 0; }
.c-l2 { display: flex; align-items: center; gap: 10px; min-width: 0; }
.c-l2 .c-resumo { flex: 1; min-width: 0; }
.add-campo input::placeholder { font-size: 15.5px; }
.sheet { max-height: calc(100dvh - var(--teclado, 0px) - 24px); }
body.teclado.com-addbar { padding-bottom: calc(150px + var(--teclado, 0px)); }

/* 1.6.3 */
.item.fmt-e .check { margin-top: 22px; }
.item.fmt-e .c-ctl .pfield, .item.fmt-b .c-ctl .pfield { color: var(--ink); }
.c-ctl .step button { width: 30px; }
.c-ctl .step input { width: 46px; font-size: 16px; }
.c-ctl .step input[data-mask="3"] { width: 62px; letter-spacing: -.01em; }
.c-ctl .step .u-troca { min-width: 32px; padding: 0 4px; font-size: 14px; }
.c-ctl .step input::placeholder { color: var(--muted); opacity: .6; font-weight: 400; }
.pergunta-fundo { position: fixed; inset: 0; z-index: 60; background: var(--scrim); display: grid; place-items: center; padding: 20px; }
.pergunta { background: var(--surface); color: var(--ink); border-radius: 18px; padding: 20px; max-width: 420px; width: 100%; box-shadow: var(--shadow); display: grid; gap: 10px; }
.pergunta h3 { margin: 0; font-size: 20px; }
.pergunta p { margin: 0; color: var(--muted); }
.pergunta-acoes { display: grid; gap: 8px; margin-top: 6px; }
.step input[data-mask="3"] { width: 66px; }
.c-ctl .step input:focus { outline: none; }
.c-ctl .step:focus-within { box-shadow: 0 0 0 2px var(--green); }
.sheet .banner { background: var(--soft); }

/* 1.6.4: aviso da busca de estabelecimento (logo abaixo do título), em vermelho nos dois temas */
.m-aviso { margin: 2px 0 10px; padding: 8px 12px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-weight: 600; font-size: 15px; }
.m-aviso[hidden] { display: none; }
.sheet #useGps { margin: 0 0 10px; }

/* 1.7.4: Avalie esta tela */
.avalie-wrap { display: flex; justify-content: center; margin: 24px 0 8px; }
.avalie { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 15px; font-weight: 600; min-height: 44px; }
.avalie svg { width: 18px; height: 18px; color: #D9534F; }
.avalie:disabled { opacity: .75; }
.av-tela { font-size: 13px; color: var(--muted); margin: -4px 0 12px; }
.av-sec { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 6px 0; }
.av-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 14px; }
.av-chips button { display: flex; align-items: center; gap: 8px; text-align: left; border: 1.5px solid var(--line); background: var(--bg); border-radius: 12px; padding: 10px 12px; font-size: 14.5px; min-height: 46px; color: var(--ink); }
.av-chips button[aria-pressed="true"] { border-color: var(--green); background: color-mix(in srgb, var(--green) 12%, var(--bg)); font-weight: 600; }
.av-chips .e { font-size: 18px; }
.av-txt { width: 100%; min-height: 76px; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 15px; background: var(--bg); color: var(--ink); resize: vertical; }
.av-cont { font-size: 12.5px; color: var(--muted); text-align: right; margin-top: 4px; }
/* 1.8.0: mudança de endereço (cestuno.netlify.app → cestuno.com.br) */
.mudando { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 24px; background: var(--bg); color: var(--ink); text-align: center; }
.mudando p { max-width: 320px; line-height: 1.5; }
