/* Nossa Compra · interface v16
   Camada visual carregada depois do CSS original. Sem dependências externas. */
:root {
  color-scheme: light;
  --bg: #f7f8f3;
  --bg-2: #f0f3ec;
  --surface: #ffffff;
  --surface-2: #f0f3ed;
  --surface-3: #dce4d8;
  --ink: #182c24;
  --ink-2: #40564b;
  --muted: #627366;
  --line: #dfe6db;
  --line-2: #edf0e8;
  --accent: #176b46;
  --accent-2: #278355;
  --accent-ink: #ffffff;
  --accent-soft: #e9f3e6;
  --accent-soft-ink: #225e3f;
  --accent-edge: #c9ddc3;
  --danger: #b03529;
  --danger-soft: #fbeae5;
  --warn: #835d15;
  --warn-soft: #fcf2d9;
  --overlay: rgba(18, 35, 27, .42);
  --e1: none;
  --e2: 0 6px 24px -14px rgba(22, 48, 33, .16);
  --e3: 0 -8px 32px -22px rgba(22, 48, 33, .22);
  --shadow: var(--e2);
  --shadow-up: var(--e3);
  --ring: 0 0 0 4px rgba(23, 107, 70, .12);
  --r-xs: 10px;
  --r-sm: 13px;
  --r-md: 16px;
  --r-lg: 18px;
  --r-xl: 26px;
  --radius: 18px;
  --page-width: 680px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101a15;
    --bg-2: #16231c;
    --surface: #1b2a21;
    --surface-2: #25362b;
    --surface-3: #405544;
    --ink: #f0f5eb;
    --ink-2: #cad7c9;
    --muted: #a4b5a2;
    --line: #344638;
    --line-2: #2a3a2f;
    --accent: #a9dc91;
    --accent-2: #b9e6a2;
    --accent-ink: #163b25;
    --accent-soft: #293f2c;
    --accent-soft-ink: #c4eab5;
    --accent-edge: #4c6548;
    --danger: #ffad9b;
    --danger-soft: #4a2d27;
    --warn: #ebcc83;
    --warn-soft: #3a321e;
    --overlay: rgba(2, 10, 5, .68);
    --e1: none;
    --e2: 0 6px 24px -14px rgba(0, 0, 0, .45);
    --e3: 0 -8px 32px -22px rgba(0, 0, 0, .5);
    --ring: 0 0 0 4px rgba(169, 220, 145, .18);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101a15;
  --bg-2: #16231c;
  --surface: #1b2a21;
  --surface-2: #25362b;
  --surface-3: #405544;
  --ink: #f0f5eb;
  --ink-2: #cad7c9;
  --muted: #a4b5a2;
  --line: #344638;
  --line-2: #2a3a2f;
  --accent: #a9dc91;
  --accent-2: #b9e6a2;
  --accent-ink: #163b25;
  --accent-soft: #293f2c;
  --accent-soft-ink: #c4eab5;
  --accent-edge: #4c6548;
  --danger: #ffad9b;
  --danger-soft: #4a2d27;
  --warn: #ebcc83;
  --warn-soft: #3a321e;
  --overlay: rgba(2, 10, 5, .68);
  --e1: none;
  --e2: 0 6px 24px -14px rgba(0, 0, 0, .45);
  --e3: 0 -8px 32px -22px rgba(0, 0, 0, .5);
  --ring: 0 0 0 4px rgba(169, 220, 145, .18);
}

/* Base legível, foco presente e rolagem com espaço para o dock. */
html { scroll-padding-block: 96px 180px; }
body { line-height: 1.45; }
button, input, textarea, select { font: inherit; }
button, input, textarea, select, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible,
select:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
button:disabled { cursor: default; }
input, textarea, select { accent-color: var(--accent); }
textarea { resize: vertical; }
a { text-underline-offset: 3px; }
::selection { color: var(--accent-soft-ink); background: var(--accent-edge); }
#app { max-width: var(--page-width); padding: 0 20px calc(var(--dockh, 124px) + 40px); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; inset: 10px auto auto 12px; z-index: 100;
  padding: 12px 16px; border-radius: 12px; background: var(--ink);
  color: var(--surface); transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

/* A marca abre espaço para o que a pessoa veio fazer: organizar a compra. */
.top { padding-block: 18px 14px; gap: 10px; }
.brand { gap: 10px; }
.mark {
  width: 40px; height: 40px; border-radius: 14px;
  background: var(--accent); color: var(--accent-ink); box-shadow: none;
}
.mark svg { width: 22px; height: 22px; }
.top h1 { font-size: clamp(18px, 4.9vw, 22px); letter-spacing: -.045em; font-weight: 800; }
.status { min-height: 24px; margin-top: 1px; font-size: 11.5px; gap: 5px; }
.dot { width: 6px; height: 6px; }
.people { gap: 6px; }
.iconbtn {
  width: 44px; height: 44px; border-radius: 14px;
  background: transparent; border-color: transparent; box-shadow: none;
}
.iconbtn svg { width: 21px; height: 21px; }
.iconbtn:active { background: var(--surface-2); transform: scale(.97); }
.espaco {
  padding: 10px 13px; min-height: 58px; margin-bottom: 20px;
  gap: 11px; border-radius: 16px; background: var(--surface); box-shadow: none;
}
.espaco .ic { width: 34px; height: 34px; border-radius: 11px; }
.espaco .ic svg { width: 18px; height: 18px; }
.espaco .nm { font-size: 14px; font-weight: 600; }
.espaco .avs .av { width: 27px; height: 27px; font-size: 11px; }
.espaco .chev { width: 16px; height: 16px; }

/* Título e progresso permanecem claros mesmo sem dados ou conexão. */
.list-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 0 0 16px; }
.list-heading h2, .hhead h2 {
  margin: 0; font-family: var(--font-display); font-size: clamp(25px, 6.5vw, 30px);
  line-height: 1.2; font-weight: 800; letter-spacing: -.045em;
}
.eyebrow, .list-heading .eyebrow {
  display: block; margin: 0 0 6px; font-size: 11px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
}
.list-heading p:not(.eyebrow) { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.list-heading > .btn { min-width: 44px; padding: 10px; flex: none; }
.list-heading-mark { width: 44px; height: 44px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-soft-ink); border: 1px solid var(--accent-edge); border-radius: 15px; font-size: 23px; font-weight: 600; }
#summaryWrap {
  margin: 0 0 10px; padding: 12px 16px; border-radius: 16px;
  background: var(--accent-soft); border: 1px solid var(--accent-edge);
}
.summary { align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.summary .big { color: var(--accent-soft-ink); font-size: 14px; font-weight: 700; }
.summary .small { color: var(--accent-soft-ink); font-size: 12px; }
.progress { height: 5px; margin-top: 11px; background: var(--accent-edge); }
.progress i { background: var(--accent); }
#summaryWrap.vazio { background: var(--surface); border-color: var(--line); }
#summaryWrap.vazio .summary .big { color: var(--ink-2); }
.info { padding: 13px 14px; border: 1px solid var(--line); font-size: 13px; line-height: 1.55; }
.info.aviso { border-color: var(--accent-edge); }
.info .dot { margin-top: 7px; }
.info .fechar { width: 30px; height: 30px; opacity: 1; }
.info button { text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* Adicionar e localizar têm papéis distintos e botões acessíveis ao polegar. */
.addbar { margin: 0 -20px; padding: 6px 20px 10px; }
.addbar::after { height: 9px; bottom: -9px; }
.addform { border-radius: 17px; padding: 5px 5px 5px 15px; box-shadow: none; border-color: var(--accent-edge); }
.addform:focus-within { box-shadow: var(--ring); }
.addform input { padding: 10px 0; font-size: 15px; line-height: 1.5; }
.addbtn { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); box-shadow: none; }
.addbtn svg { width: 21px; height: 21px; }
.suggest { box-shadow: 0 14px 34px -20px var(--ink-2); border-radius: 16px; }
.suggest button { min-height: 52px; font-size: 14px; }
.list-tools { margin: 10px 0 6px; }
#toggleSearch { flex: none; background: var(--surface); border-color: var(--line); }
#toggleSearch[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent-edge); color: var(--accent-soft-ink); }
#listSearchPanel { margin-bottom: 12px; }
.list-search { display: flex; align-items: center; gap: 9px; padding: 0 13px; min-height: 46px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; }
.list-search:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.list-search > svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.list-search input { width: 100%; min-width: 0; min-height: 44px; font-size: 16px; border: 0; background: transparent; outline: none; }
.list-search input::placeholder { color: var(--muted); opacity: 1; }
.list-search button { min-width: 40px; min-height: 44px; color: var(--muted); }
.list-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.list-filter, [data-list-filter] {
  min-height: 40px; padding: 8px 14px; border-radius: 999px; font-size: 12.5px;
  font-weight: 600; color: var(--muted); border: 1px solid var(--line); background: var(--surface);
}
.list-filter.on, [data-list-filter].on, [data-list-filter][aria-pressed="true"] {
  background: var(--ink); color: var(--surface); border-color: var(--ink);
}
.list-quick, .list-shortcuts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
#quickBase, #quickPaste { min-height: 36px; padding: 7px 10px; border-radius: 11px; font-size: 12px; font-weight: 600; color: var(--accent-soft-ink); background: var(--accent-soft); }
#quickBase svg, #quickPaste svg { width: 15px; height: 15px; }
.list-result, #listResult { margin: 9px 2px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.list-result:empty, #listResult:empty { display: none; }

/* Categorias e produtos: menos decoração, mais espaço para nomes e quantidades. */
.group, .group:first-child { margin-top: 22px; }
.ghead { gap: 9px; padding: 0 3px 9px; font-size: 13px; font-weight: 700; letter-spacing: -.015em; }
.cic { width: 28px; height: 28px; border-radius: 9px; }
.cic svg { width: 16px; height: 16px; stroke-width: 1.9; }
.ghead .n { font-size: 11px; min-width: 24px; padding: 2px 7px; background: var(--surface-2); border-radius: 7px; text-align: center; }
.card, .hcard { box-shadow: none; border-radius: 17px; }
.front { min-height: 62px; gap: 5px; padding-right: 14px; }
.check { width: 47px; }
.check i { width: 24px; height: 24px; border-width: 1.5px; border-color: var(--muted); }
.check svg { width: 13px; height: 13px; }
.row::after { left: 55px; }
.body { gap: 9px; padding-block: 14px; }
.name { font-size: 15px; font-weight: 500; line-height: 1.45; letter-spacing: -.02em; }
.qty { font-size: 11.5px; padding: 4px 8px; border-radius: 7px; }
.body .av { width: 21px; height: 21px; font-size: 9px; opacity: 1; }
.row.done .qty { opacity: 1; color: var(--muted); }
.cart { margin-top: 26px; }
.cart .ghead { gap: 6px; flex-wrap: wrap; padding-bottom: 7px; }
.cart .ghead .n { background: var(--accent-edge); opacity: 1; }
.cart .ghead .clear { min-height: 40px; font-size: 11.5px; padding-inline: 3px; opacity: 1; }
.cart .ghead .chev { min-width: 32px; min-height: 40px; margin-left: 0; padding: 0; opacity: 1; border-radius: 10px; }
.cart .front { background: var(--surface); }
.cart .card { background: var(--surface); }
.cart .row.done .name { color: var(--muted); opacity: 1; }
.cart .qty { background: var(--surface-2); }
.cart .check i { border-color: var(--accent); }
:root[data-mercado] .front { min-height: 68px; }
:root[data-mercado] .name { font-size: 17px; }
:root[data-mercado] .qty { font-size: 12px; padding: 5px 9px; }
:root[data-mercado] .ghead { font-size: 13px; }
.empty { margin-top: 22px; padding: 26px 6px 18px; }
.empty .ilus { width: 74px; height: 74px; border-radius: 26px; background: var(--accent-soft); color: var(--accent-soft-ink); border-color: var(--accent-edge); box-shadow: none; }
.empty .ilus svg { width: 30px; height: 30px; stroke-width: 1.6; }
.empty h2 { font-size: 23px; letter-spacing: -.035em; }
.empty p { font-size: 14px; line-height: 1.6; max-width: 34ch; }
.chip { min-height: 42px; padding: 10px 13px; font-size: 13px; box-shadow: none; }
.chip.off { opacity: 1; color: var(--muted); background: var(--surface-2); }
.ajudalink { min-height: 44px; font-size: 12px; }

/* Navegação estável, sem vidro pesado nem omitir o botão de finalizar. */
.dock { background: var(--surface); border-top: 1px solid var(--line); box-shadow: var(--e3); backdrop-filter: none; -webkit-backdrop-filter: none; }
.dock .inner { max-width: var(--page-width); padding-inline: 20px; }
.tabs { gap: 8px; padding: 8px 0 7px; }
.tab { flex-direction: row; justify-content: center; gap: 8px; min-height: 48px; padding: 6px 10px; font-size: 12px; border-radius: 13px; }
.tab .ic { width: 26px; height: 30px; border-radius: 0; }
.tab svg { width: 21px; height: 21px; }
.tab.on { color: var(--accent-soft-ink); background: var(--accent-soft); }
.tab.on .ic { background: transparent; }
.tab .badge { left: 15px; top: -2px; height: 16px; min-width: 16px; font-size: 9px; padding: 0 4px; box-shadow: 0 0 0 2px var(--accent-soft); }
.telaon { padding: 9px 2px 1px; font-size: 11px; gap: 6px; }
.telaon button { min-height: 28px; padding: 3px 4px; font-size: 11px; }
.finish { padding: 12px 0 0; }
.finish .btn { min-height: 50px; padding: 13px 16px; font-size: 14px; border-radius: 14px; }

/* Painéis: formulários previsíveis e áreas de toque confortáveis. */
.btn { min-height: 44px; line-height: 1.4; font-size: 14px; padding: 11px 15px; }
.btn.primary { background: var(--accent); box-shadow: none; }
.btn.ghost { border: 1px solid var(--line); }
.btn[disabled] { opacity: .55; }
.overlay { backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet { border-radius: 26px 26px 0 0; box-shadow: 0 -1px 0 var(--line), 0 -12px 50px -28px rgba(0, 0, 0, .3); padding-bottom: calc(24px + var(--sab)); }
.sheet .inner { max-width: 620px; padding: 12px 22px 0; }
.sx { width: 44px; height: 44px; top: 10px; right: 12px; color: var(--ink-2); background: var(--surface-2); }
.sx svg { width: 16px; height: 16px; }
.grab { width: 32px; height: 4px; margin-bottom: 23px; background: var(--surface-3); }
.sheet h3 { font-size: 24px; line-height: 1.3; letter-spacing: -.035em; padding-right: 45px; margin-bottom: 8px; }
.sheet h3:focus { outline: none; }
.sheet h3:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 3px; }
.sheet .sub { font-size: 13px; line-height: 1.6; margin-bottom: 22px; }
.field { gap: 8px; margin-bottom: 17px; }
.field label { color: var(--ink-2); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.field input, .field textarea, .field select {
  min-height: 49px; width: 100%; padding: 12px 14px; font-size: 16px;
  color: var(--ink); background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
}
.field textarea { min-height: 150px; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); background: var(--surface); box-shadow: var(--ring); outline: none; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 1; }
.sec { font-size: 10.5px; letter-spacing: .075em; margin-block: 24px 10px; }
.note { font-size: 12px; line-height: 1.6; }
.linkbtn { min-height: 44px; padding: 10px 8px; line-height: 1.5; }
.sheet .actions { gap: 10px; margin-top: 16px; }
.catgrid { gap: 7px; }
.catgrid button { min-height: 40px; font-size: 12px; padding: 8px 11px; }
.esplinha, .saldo, .papel, .transf, .kv { padding: 14px; border-radius: 14px; gap: 10px; }
.esplinha .tx b, .papel .tx b, .saldo .nome { font-size: 14px; }
.esplinha .tx span, .papel .tx span { font-size: 12px; }
.papel .btn, .transf .btn { min-height: 40px; }
.kv .k { font-size: 10px; letter-spacing: .06em; }
.stat { gap: 10px; }
.stat div { padding: 16px; }
.stat b { font-size: 28px; margin-bottom: 6px; letter-spacing: -.04em; }
.stat span { font-size: 12px; }
.aj > button { min-height: 56px; padding: 13px; }
.aj .t { font-size: 14px; }
.aj .corpo { font-size: 13px; line-height: 1.65; }
.ordlinha { min-height: 58px; height: auto; }
.ordlinha .pega { min-height: 52px; }
.fotoalvo { min-height: 70px; background: var(--bg-2); }
.pedido.ja { opacity: 1; color: var(--muted); background: var(--surface-2); }
.toast { font-size: 13px; padding: 13px 17px; border-radius: 13px; bottom: calc(var(--dockh, 124px) + 16px); }
.toast b { color: var(--surface); text-decoration: underline; text-underline-offset: 3px; }

/* Histórico e orçamento ajudam a entender o gasto além de arquivar compras. */
.hhead { padding-top: 0; padding-bottom: 8px; }
.hhead p { font-size: 13px; line-height: 1.65; max-width: 50ch; margin-top: 8px; }
.cardlink { padding: 17px; border-radius: 16px; box-shadow: none; margin-top: 12px; }
.cardlink .k { font-size: 10px; letter-spacing: .085em; }
.cardlink .v { font-size: 14px; font-weight: 600; line-height: 1.5; margin-top: 5px; }
.cardlink .chev { width: 20px; height: 20px; }
.mes { padding-block: 15px; }
.mes .m { font-size: 13px; }
.mes .v { font-size: 16px; }
.mes .q { font-size: 12px; }
.mes .barra { height: 4px; margin-top: 9px; }
.mes .barra i { background: var(--accent); }
.freq { margin-top: 24px; }
.freq .chips { gap: 7px; }
.hcard { margin-top: 12px; }
.hcard .hb { min-height: 80px; padding: 17px 16px; }
.hcard .date { font-size: 15px; letter-spacing: -.025em; }
.hcard .meta { font-size: 12px; gap: 7px; }
.hcard .items { padding-inline: 16px; padding-bottom: 12px; }
.hcard .items > span { font-size: 11px; border-radius: 7px; padding: 5px 8px; }
.hcard .actions { padding: 0 16px 16px; flex-wrap: wrap; }
.hcard .actions .btn { font-size: 12px; padding: 10px 12px; }
.budget-card {
  margin: 16px 0 18px; padding: 20px; border: 1px solid var(--accent-edge);
  border-radius: 20px; background: var(--accent-soft); color: var(--accent-soft-ink);
}
.budget-card .eyebrow { color: var(--accent-soft-ink); margin-bottom: 9px; }
.budget-card h3, .budget-card .budget-title { margin: 0; font-size: 14px; line-height: 1.4; font-weight: 600; }
.budget-card p { margin: 6px 0 0; font-size: 12px; line-height: 1.6; }
.budget-card .budget-top, .budget-card .budget-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.budget-card .budget-value, .budget-card .budget-total { display: block; margin-top: 9px; font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -.05em; font-variant-numeric: tabular-nums; line-height: 1.3; overflow-wrap: anywhere; }
.budget-card .budget-value small, .budget-card .budget-total small { font-family: var(--font-body); font-size: 12px; font-weight: 500; letter-spacing: 0; }
.budget-card .budget-value .budget-total { display: block; margin-top: 4px; font-family: var(--font-body); font-size: 12px; font-weight: 500; letter-spacing: 0; line-height: 1.5; }
.budget-card > small { display: block; margin-top: 8px; font-size: 11px; line-height: 1.55; }
.budget-meter { height: 7px; border: 0; border-radius: 99px; background: var(--accent-edge); margin: 14px 0 9px; overflow: hidden; }
.budget-meter > i, .budget-meter > span, .budget-meter > div { display: block; height: 100%; max-width: 100%; border-radius: inherit; background: var(--accent); }
.budget-meter::-webkit-progress-bar { background: var(--accent-edge); border-radius: 99px; }
.budget-meter::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
.budget-meter::-moz-progress-bar { background: var(--accent); border-radius: 99px; }
.budget-card.over, .budget-card[data-over="true"] { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.budget-card.over .budget-meter > i, .budget-card.over .budget-meter > span { background: var(--warn); }
#budgetEdit { min-height: 40px; min-width: 44px; padding: 9px 12px; font-size: 12px; font-weight: 600; background: var(--surface); border: 1px solid var(--accent-edge); border-radius: 11px; color: var(--accent-soft-ink); }

/* Entrada acolhedora, responsiva e com as ações acima da dobra mais comum. */
.onb { max-width: 460px; padding: 38px 24px; }
.onb .mark { width: 64px; height: 64px; border-radius: 21px; margin-bottom: 27px; background: var(--accent); box-shadow: none; }
.onb .mark svg { width: 32px; height: 32px; }
.onb h1 { font-size: clamp(28px, 8vw, 37px); line-height: 1.18; font-weight: 800; letter-spacing: -.055em; white-space: normal; overflow: visible; margin-bottom: 13px; }
.onb p { font-size: 14px; line-height: 1.7; text-wrap: pretty; margin-bottom: 26px; }
.onb .actions { gap: 10px; }
.onb .btn { min-height: 52px; font-size: 14px; border-radius: 14px; }
.onb .field { margin-bottom: 4px; }
.onb .or { margin: 11px 0; }
.onb .linkbtn { font-size: 12px; margin-top: 18px; }
#onboarding .legal { font-size: 11px; line-height: 1.7; margin-top: 20px; }

/* Ajustes por espaço real, mantendo a ordem das categorias no DOM. */
@media (min-width: 760px) {
  #app { padding-inline: 32px; padding-bottom: calc(var(--dockh, 124px) + 68px); }
  .top { padding-top: 30px; padding-bottom: 24px; }
  .espaco { margin-bottom: 30px; }
  .addbar { margin-inline: -32px; padding-inline: 32px; }
  .list-heading { margin-bottom: 20px; }
  .list-heading h2, .hhead h2 { font-size: 34px; }
  .dock { left: 0; right: 0; bottom: 18px; width: min(580px, calc(100% - 48px)); margin-inline: auto; border: 1px solid var(--line); border-radius: 22px; padding-bottom: 0; box-shadow: 0 12px 40px -18px rgba(18, 35, 27, .22); }
  .dock .inner { padding-inline: 12px; }
  .tabs { padding-block: 8px; }
  .finish { padding-top: 10px; }
  .telaon { padding-inline: 8px; }
  .sheet { left: 0; right: 0; width: min(620px, calc(100% - 48px)); margin-inline: auto; bottom: 24px; border-radius: 25px; max-height: calc(100dvh - 64px); transform: translateY(calc(100% + 30px)); border: 1px solid var(--line); }
  .sheet.show { transform: none; }
  .sheet .inner { padding-inline: 28px; }
  .toast { bottom: calc(var(--dockh, 124px) + 40px); max-width: 520px; }
  .onb { min-height: auto; margin-block: min(10vh, 100px); padding: 42px; max-width: 500px; background: var(--surface); border: 1px solid var(--line); border-radius: 28px; }
}

@media (min-width: 1080px) {
  :root { --page-width: 980px; }
  .top { border-bottom: 1px solid var(--line); margin-bottom: 24px; }
  .espaco { max-width: 420px; margin-bottom: 28px; }
  #lista { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 0 22px; }
  #lista > .empty, #lista > .cart { grid-column: 1 / -1; }
  .list-tools { display: block; }
  #listSearchPanel { display: grid; grid-template-columns: minmax(220px, 1fr) auto; align-items: center; gap: 10px 16px; }
  #listSearchPanel .list-filters { margin-top: 0; }
  .list-quick, .list-shortcuts { margin-top: 0; }
  .list-result, #listResult { grid-column: 1 / -1; margin-top: 0; }
  .budget-card { padding: 24px; }
}

@media (max-width: 359px) {
  #app { padding-inline: 14px; }
  .top { gap: 3px; padding-top: 17px; }
  .brand { gap: 7px; }
  .mark { width: 34px; height: 34px; border-radius: 11px; }
  .mark svg { width: 19px; height: 19px; }
  .top h1 { font-size: 17px; }
  .status { font-size: 10px; }
  .people { gap: 0; }
  .iconbtn { width: 40px; height: 44px; }
  .espaco { padding-inline: 10px; gap: 8px; margin-bottom: 20px; }
  .addbar { margin-inline: -14px; padding-inline: 14px; }
  .addform { padding-left: 12px; }
  .addform input { font-size: 14px; }
  .summary .small { white-space: normal; }
  .list-filter, [data-list-filter] { padding-inline: 10px; font-size: 12px; }
  .front { padding-right: 10px; }
  .check { width: 43px; }
  .body { gap: 6px; }
  .name { font-size: 14px; }
  .qty { font-size: 11px; padding-inline: 6px; }
  .cart .ghead { gap: 4px; font-size: 12px; }
  .cart .ghead .clear { font-size: 11px; }
  .sheet .inner { padding-inline: 16px; }
  .sheet h3 { font-size: 22px; }
  .sheet .actions .row2 { flex-wrap: wrap; }
  .sheet .actions .row2 .btn { min-width: 110px; }
  .dock .inner { padding-inline: 14px; }
  .onb { padding-inline: 20px; }
}

@media (hover: hover) {
  .iconbtn:hover, .suggest button:hover, .aj > button:hover { background: var(--surface-2); }
  .espaco:hover, .chip:hover, .cardlink:hover, .esplinha:hover { border-color: var(--accent); }
  .check:hover { background: var(--accent-soft); }
  .btn.primary:hover, .addbtn:hover { background: var(--accent-2); }
  .list-filter:hover, [data-list-filter]:hover { border-color: var(--accent); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media (forced-colors: active) {
  .btn, .tab, .addbtn, .check i, .list-filter, [data-list-filter] { border: 1px solid ButtonText; }
  .tab.on, [data-list-filter][aria-pressed="true"], .row.done .check i { outline: 2px solid Highlight; }
  .progress, .budget-meter { border: 1px solid CanvasText; }
  .progress i, .budget-meter > i, .budget-meter > span { background: Highlight; forced-color-adjust: none; }
}
