/* Conversor de Unidades: paleta jade e âmbar, Manrope, números tabulares. */
:root {
  --p-l: #0B7A62; --onp-l: #FFFFFF; --pc-l: #D3EEE4; --onpc-l: #053D30;
  --p-d: #45D6B1; --onp-d: #03261D; --pc-d: #123A30; --onpc-d: #BDF3E2;
  --bg: #F5F3EC; --surface: #FFFFFF; --surface2: #ECE9DF; --ink: #17211D; --ink2: rgba(23, 33, 29, .70); --ink3: rgba(23, 33, 29, .48);
  --line: rgba(23, 33, 29, .10); --accent: #F3A42A; --on-accent: #2B1A00; --danger: #C62828; --sombra: 0 10px 30px rgba(23, 40, 33, .10), 0 2px 6px rgba(23, 40, 33, .06);
  --primary: var(--p-l); --on-primary: var(--onp-l); --pc: var(--pc-l); --on-pc: var(--onpc-l);
  --fonte: 'Manrope', system-ui, -apple-system, 'Segoe UI', 'Noto Sans Devanagari', 'Nirmala UI', Roboto, sans-serif;
  color-scheme: light;
}
:root[data-cor="cobalto"] { --p-l: #2D55D2; --pc-l: #DDE5FF; --onpc-l: #0E2268; --p-d: #93ACFF; --onp-d: #0A1640; --pc-d: #1C2B5E; --onpc-d: #DDE5FF; }
:root[data-cor="ameixa"] { --p-l: #8C3A88; --pc-l: #F5DDF2; --onpc-l: #42103E; --p-d: #E8A0E2; --onp-d: #370C34; --pc-d: #3D1B3B; --onpc-d: #F6DFF3; }
:root[data-cor="coral"] { --p-l: #CC4429; --pc-l: #FFE1D9; --onpc-l: #5B1507; --p-d: #FF9E86; --onp-d: #3D0B02; --pc-d: #4B2018; --onpc-d: #FFE1D9; }
:root[data-cor="grafite"] { --p-l: #2C3038; --pc-l: #E1E3E8; --onpc-l: #15171B; --p-d: #D7DBE2; --onp-d: #15171B; --pc-d: #2B2F37; --onpc-d: #E7E9EE; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1412; --surface: #161E1B; --surface2: #1F2925; --ink: #E7EEEA; --ink2: rgba(231, 238, 234, .72); --ink3: rgba(231, 238, 234, .48);
    --line: rgba(255, 255, 255, .09); --accent: #FFB547; --on-accent: #2B1A00; --danger: #FF7B72; --sombra: 0 10px 30px rgba(0, 0, 0, .35);
    --primary: var(--p-d); --on-primary: var(--onp-d); --pc: var(--pc-d); --on-pc: var(--onpc-d); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1412; --surface: #161E1B; --surface2: #1F2925; --ink: #E7EEEA; --ink2: rgba(231, 238, 234, .72); --ink3: rgba(231, 238, 234, .48);
  --line: rgba(255, 255, 255, .09); --accent: #FFB547; --on-accent: #2B1A00; --danger: #FF7B72; --sombra: 0 10px 30px rgba(0, 0, 0, .35);
  --primary: var(--p-d); --on-primary: var(--onp-d); --pc: var(--pc-d); --on-pc: var(--onpc-d); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--fonte); font-size: 16px; line-height: 1.45; -webkit-tap-highlight-color: transparent; transition: background .25s; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
.simbolos { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 60%, transparent); outline-offset: 2px; }

#app { max-width: 1180px; margin: 0 auto; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); }
.tela { display: none; }
.tela.on { display: block; }

/* ---------- topo ---------- */
.topo { display: flex; align-items: center; gap: 4px; height: 64px; padding-top: env(safe-area-inset-top); }
.marca { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.logo { width: 34px; height: 34px; stroke: none; }
.marca h1 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icone { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; color: var(--ink2); transition: background .15s, transform .08s, color .15s; }
.icone:hover { background: var(--surface2); color: var(--ink); }
.icone:active { transform: scale(.94); }
.icone.peq { width: 44px; height: 44px; border-radius: 12px; }
.icone.peq svg { width: 22px; height: 22px; }

/* ---------- categorias ---------- */
.cats { position: relative; display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; margin: 0 -16px; padding: 4px 16px 12px; scrollbar-width: none; scroll-padding: 16px; }
.cats::-webkit-scrollbar { display: none; }
.cat { display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 16px 0 12px; border-radius: 999px; background: var(--surface); color: var(--ink2); font-weight: 700; font-size: 14.5px; white-space: nowrap; scroll-snap-align: start; box-shadow: inset 0 0 0 1px var(--line); transition: background .18s, color .18s, box-shadow .18s, transform .08s; }
.cat svg { width: 20px; height: 20px; stroke-width: 2.1; }
.cat:active { transform: scale(.96); }
.cat[aria-selected="true"] { background: var(--primary); color: var(--on-primary); box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 32%, transparent); }

/* ---------- cartão ---------- */
.principal { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.col-a { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; min-width: 0; }
.col-b { min-width: 0; }
.cartao { background: var(--surface); border-radius: 26px; box-shadow: var(--sombra); overflow: hidden; position: relative; }
.lado { padding: 14px 16px 12px; }
.lado.para { background: var(--pc); color: var(--on-pc); padding-top: 18px; }
.rot { display: flex; align-items: center; gap: 10px; }
.tag { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); }
.lado.para .tag { color: color-mix(in srgb, var(--on-pc) 62%, transparent); }
.un-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; max-width: calc(100% - 40px); padding: 6px 10px 6px 12px; border-radius: 12px; background: var(--surface2); transition: background .15s, transform .08s; text-align: left; }
.lado.para .un-btn { background: color-mix(in srgb, var(--surface) 55%, transparent); }
.un-btn:active { transform: scale(.97); }
.un-btn .sim { font-size: 17px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
.un-btn .nome { font-size: 13.5px; font-weight: 600; opacity: .72; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.un-btn .seta { width: 18px; height: 18px; opacity: .6; stroke-width: 2.6; }
.valor { display: flex; justify-content: flex-end; align-items: center; min-height: 64px; font-size: 44px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; text-align: right; word-break: break-all; outline: none; }
.valor .num { transition: opacity .12s; }
.valor.t2 { font-size: 36px; } .valor.t3 { font-size: 29px; } .valor.t4 { font-size: 23px; }
.valor.vago .num { color: var(--ink3); }
.valor.res { font-weight: 800; }
.valor.res.pulso .num { animation: pulso .22s ease-out; }
@keyframes pulso { from { opacity: .35; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.valor .num { display: inline-block; }
.cursor { width: 3px; height: .95em; margin-left: 4px; border-radius: 2px; background: var(--primary); animation: pisca 1.05s steps(1) infinite; }
@keyframes pisca { 50% { opacity: 0; } }
.meio { position: relative; height: 0; }
.regua { position: absolute; left: 0; right: 0; top: -1px; height: 10px; background: repeating-linear-gradient(90deg, var(--line) 0 2px, transparent 2px 12px) top left / 100% 6px no-repeat, repeating-linear-gradient(90deg, color-mix(in srgb, var(--ink) 18%, transparent) 0 2px, transparent 2px 60px) top left / 100% 10px no-repeat; pointer-events: none; }
.trocar { position: absolute; right: 18px; top: -26px; width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 45%, transparent), 0 0 0 5px var(--surface); z-index: 2; transition: transform .32s cubic-bezier(.3, 1.4, .5, 1); }
.trocar svg { stroke-width: 2.4; }
.trocar.gira { transform: rotate(180deg); }
.trocar:active { scale: .94; }
.acoes { display: flex; align-items: center; gap: 2px; margin: 2px -8px -4px 0; }
.fator { flex: 1; font-size: 13.5px; font-weight: 600; opacity: .72; font-variant-numeric: tabular-nums; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acoes .icone { color: inherit; }
.acoes .icone:hover { background: color-mix(in srgb, var(--surface) 50%, transparent); }
#btn-fav[aria-pressed="true"] svg { fill: var(--accent); stroke: var(--accent); }
#btn-fav.pop svg { animation: pop .38s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { 40% { transform: scale(1.35) rotate(-10deg); } }

/* ---------- ingrediente ---------- */
.ingred { background: var(--surface); border-radius: 20px; padding: 12px 0 10px; box-shadow: inset 0 0 0 1px var(--line); }
.ingred .tag { padding: 0 16px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 8px 16px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 40px; padding: 0 14px; border-radius: 10px; background: var(--surface2); font-size: 14px; font-weight: 700; white-space: nowrap; transition: background .15s, color .15s; display: inline-flex; align-items: center; gap: 6px; }
.chip[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }
.chip:active { transform: scale(.96); }
.nota { margin: 6px 16px 0; font-size: 13px; color: var(--ink2); }

/* ---------- teclado ---------- */
.teclado { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.teclado button { height: 58px; border-radius: 16px; background: var(--surface); font-size: 25px; font-weight: 700; font-variant-numeric: tabular-nums; box-shadow: inset 0 0 0 1px var(--line), 0 1px 0 var(--line); display: grid; place-items: center; transition: background .12s, transform .07s; user-select: none; -webkit-user-select: none; }
.teclado button:hover { background: color-mix(in srgb, var(--surface) 80%, var(--primary)); }
.teclado button:active, .teclado button.apertou { transform: scale(.94); background: var(--pc); }
.teclado .fn { background: var(--surface2); color: var(--ink2); font-size: 22px; }
.teclado .ac { background: var(--primary); color: var(--on-primary); box-shadow: none; }
.teclado .ac:hover, .teclado .ac:active { background: color-mix(in srgb, var(--primary) 85%, var(--ink)); }
.teclado svg { width: 26px; height: 26px; }

/* ---------- lista de todas ---------- */
.col-b h2, .corpo2 h3 { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); margin: 6px 4px 8px; }
.atalhos .chips { padding: 0 0 4px; margin-bottom: 8px; }
.lista { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: 20px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.lista li + li { border-top: 1px solid var(--line); }
.lista button.item { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 16px; text-align: left; transition: background .12s; }
.lista button.item:hover { background: color-mix(in srgb, var(--surface2) 60%, transparent); }
.lista button.item:active { background: var(--surface2); }
.badge { flex: none; min-width: 52px; height: 32px; padding: 0 8px; border-radius: 9px; background: var(--surface2); display: grid; place-items: center; font-size: 13px; font-weight: 800; white-space: nowrap; }
.item .txt { flex: 1; min-width: 0; display: grid; }
.item .txt b { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .txt small { font-size: 12.5px; color: var(--ink3); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .v { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; font-size: 15px; max-width: 55%; overflow-wrap: anywhere; }
.item.atual { background: var(--pc); color: var(--on-pc); }
.item.atual .badge { background: var(--primary); color: var(--on-primary); }
.item.atual .txt small { color: inherit; opacity: .7; }
.item .ok { color: var(--primary); width: 22px; height: 22px; stroke-width: 2.8; }
.privado { font-size: 13px; color: var(--ink3); text-align: center; margin: 14px 8px 0; }

/* ---------- telas sobrepostas ---------- */
.tela.sobre { position: fixed; inset: 0; z-index: 20; background: var(--bg); overflow-y: auto; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); }
.tela.sobre.on { animation: entra .22s cubic-bezier(.2, .8, .3, 1); }
@keyframes entra { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
.tela.sobre > * { max-width: 640px; margin-left: auto; margin-right: auto; }
.topo2 { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 6px; height: 64px; padding-top: env(safe-area-inset-top); background: var(--bg); }
.topo2 h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.topo2 .icone { margin-left: -10px; color: var(--ink); }
.busca { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 12px; color: var(--ink3); }
.busca:focus-within { box-shadow: inset 0 0 0 2px var(--primary); }
.busca input { flex: 1; border: 0; outline: 0; background: none; font-size: 16px; font-weight: 600; color: var(--ink); min-width: 0; }
.escolha .grupo-cat { padding: 12px 16px 6px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); background: var(--bg); }
.vazio { text-align: center; color: var(--ink2); padding: 24px; }
.corpo2 { display: grid; gap: 10px; padding-bottom: 24px; }
.h3linha { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.link { color: var(--primary); font-weight: 800; font-size: 14px; padding: 10px 6px; min-height: 44px; }
.vazio-box { display: grid; justify-items: center; gap: 4px; padding: 18px 16px; background: var(--surface); border-radius: 20px; box-shadow: inset 0 0 0 1px var(--line); text-align: center; color: var(--ink2); font-size: 14.5px; }
.vazio-box p { margin: 0; max-width: 300px; }
.ilus { width: 120px; height: 80px; stroke: none; }
.salvos .item .v { font-size: 14px; color: var(--ink2); font-weight: 600; }
.salvos .apaga { width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink3); border-radius: 10px; flex: none; }
.salvos li { display: flex; align-items: center; padding-right: 6px; }
.salvos li .item { flex: 1; min-width: 0; }

.grupo { background: var(--surface); border-radius: 20px; padding: 14px 16px; box-shadow: inset 0 0 0 1px var(--line); }
.grupo h3 { margin: 0 0 10px; color: var(--ink); text-transform: none; letter-spacing: 0; font-size: 15.5px; font-weight: 700; }
.grupo.linha { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grupo.linha h3 { margin: 0; }
.seg { display: flex; background: var(--surface2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; min-height: 44px; border-radius: 9px; font-weight: 700; font-size: 14.5px; color: var(--ink2); transition: background .18s, color .18s; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.cores { display: flex; gap: 12px; flex-wrap: wrap; }
.cores button { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; position: relative; transition: transform .1s; }
.cores button:active { transform: scale(.92); }
.cores button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); }
.cores button svg { width: 20px; height: 20px; stroke-width: 2.6; }
.cores button .cad { position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; }
.cores button .cad svg { width: 13px; height: 13px; }
.chave { width: 56px; height: 34px; border-radius: 999px; background: var(--surface2); position: relative; transition: background .2s; flex: none; box-shadow: inset 0 0 0 1px var(--line); }
.chave i { position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s cubic-bezier(.3, 1.4, .5, 1); }
.chave[aria-checked="true"] { background: var(--primary); }
.chave[aria-checked="true"] i { transform: translateX(22px); }
select { height: 44px; border-radius: 12px; border: 0; background: var(--surface2); padding: 0 12px; font-weight: 700; max-width: 60%; }
.botao { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; border-radius: 14px; background: var(--primary); color: var(--on-primary); font-weight: 800; font-size: 15.5px; padding: 0 18px; transition: transform .08s, opacity .2s; }
.botao:active { transform: scale(.97); }
.botao.fraco { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.botao.perigo { background: var(--danger); color: #fff; }
.botao.desligado { opacity: .55; pointer-events: none; }

/* ---------- avisos ---------- */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 30px); opacity: 0; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 700; font-size: 14.5px; pointer-events: none; z-index: 50; transition: transform .22s cubic-bezier(.2, .9, .3, 1.2), opacity .2s; max-width: calc(100% - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.anuncio { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .78); color: #fff; display: none; place-items: center; font-weight: 800; font-size: 20px; }
.anuncio.on { display: grid; }
.confirma { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .45); display: grid; place-items: center; padding: 16px; }
.confirma .caixa { background: var(--surface); border-radius: 24px; padding: 22px 20px 18px; max-width: 360px; width: 100%; box-shadow: var(--sombra); animation: entra .2s; }
.confirma p { margin: 0 0 18px; font-weight: 700; font-size: 17px; }
.confirma .botoes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- bloco do site (SEO) ---------- */
.info { margin: 36px auto 0; max-width: 760px; color: var(--ink2); font-size: 15.5px; }
.info h2 { color: var(--ink); font-size: 24px; letter-spacing: -.02em; margin: 0 0 10px; }
.info h3 { color: var(--ink); font-size: 17px; margin: 22px 0 6px; }
.info ol { padding-left: 22px; }
.info li { margin: 4px 0; }
.tabela { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 16px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); font-variant-numeric: tabular-nums; }
.tabela td { padding: 10px 14px; border-top: 1px solid var(--line); font-weight: 700; color: var(--ink); vertical-align: top; }
.tabela tr:first-child td { border-top: 0; }
.tabela small { display: block; font-weight: 600; color: var(--ink3); font-size: 12.5px; }
.info details { background: var(--surface); border-radius: 14px; margin: 8px 0; box-shadow: inset 0 0 0 1px var(--line); }
.info summary { cursor: pointer; padding: 14px 16px; font-weight: 700; color: var(--ink); min-height: 48px; }
.info details p { margin: 0; padding: 0 16px 14px; }
.mais { display: flex; justify-content: center; gap: 16px; margin: 28px 0 0; }
.mais a, .rodape a { color: var(--primary); font-weight: 700; }
.rodape { text-align: center; color: var(--ink3); font-size: 13px; margin: 14px 0 0; }

/* ---------- telas largas ---------- */
@media (min-width: 900px) {
  #app { padding: 0 32px 40px; }
  .topo { height: 76px; }
  .cats { flex-wrap: wrap; overflow: visible; margin: 0; padding: 4px 0 18px; }
  .principal { grid-template-columns: minmax(380px, 440px) minmax(0, 1fr); gap: 28px; align-items: start; }
  .col-b { position: sticky; top: 16px; }
  .col-b .lista#lista { max-height: calc(100vh - 140px); overflow-y: auto; scrollbar-width: thin; }
  .teclado button { height: 56px; }
}
@media (max-width: 370px) {
  .valor { font-size: 38px; } .valor.t2 { font-size: 31px; } .valor.t3 { font-size: 25px; } .valor.t4 { font-size: 20px; }
  .teclado button { height: 54px; }
  .marca h1 { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
