@font-face {
  font-family: "Bricolage";
  src: url(/fonts/bricolage-latin.woff2) format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  --paper: #F1F3EE;
  --sheet: #FAFBF8;
  --ink: #14171C;
  --ink2: #4B525B;
  --line: #D3D8CF;
  --focus: #2457F5;
  --c: var(--paper);
  --on: var(--ink);
  --r: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.45 "Bricolage", system-ui, sans-serif;
  font-stretch: 100%;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1:focus, .scan-tip:focus { outline: none; }

.view, .wrap { max-width: 520px; margin: 0 auto; padding: 20px 20px calc(36px + env(safe-area-inset-bottom)); }

/* Início */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-stretch: 75%; font-size: 21px; letter-spacing: -.01em; margin-bottom: 28px; }
.brand img { border-radius: 8px; }
h1 { font-weight: 800; font-stretch: 75%; font-size: clamp(40px, 12vw, 54px); line-height: .96; letter-spacing: -.02em; margin: 0 0 14px; text-wrap: balance; }
h2 { font-weight: 700; font-stretch: 85%; font-size: 22px; margin: 36px 0 10px; }
.lead { font-size: 18px; color: var(--ink2); margin: 0 0 26px; max-width: 34ch; }
.muted, .bf { font-size: 15px; color: var(--ink2); }
.bf { margin: 22px 0 0; max-width: 40ch; }

.entries { display: grid; gap: 10px; }
.entry {
  display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: center;
  width: 100%; min-height: 78px; padding: 14px 16px; text-align: left;
  border: 1.5px solid var(--ink); border-radius: var(--r); background: var(--sheet);
}
.entry svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.entry strong { display: block; font-weight: 700; font-stretch: 85%; font-size: 21px; line-height: 1.1; }
.entry span { display: block; font-size: 15px; color: var(--ink2); margin-top: 2px; }
.entry.primary { background: var(--ink); color: var(--paper); }
.entry.primary span { color: #C3C9D0; }
.entry:active, .cta:active { transform: translateY(1px); }

.link { background: none; border: 0; padding: 14px 0; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.recent { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.recent button {
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; width: 100%;
  padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left;
}
.recent button > span { min-width: 0; }
.recent b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent small { color: var(--ink2); font-size: 14px; }
.tag { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.tag i { width: 12px; height: 12px; border-radius: 3px; background: var(--c); border: 1.5px solid var(--ink); }

/* Formulário */
.back { background: none; border: 0; padding: 8px 0 18px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; border: 1.5px solid var(--ink); margin-bottom: 16px; }
.note { background: #FBE9A6; border-radius: 12px; padding: 12px 14px; font-size: 15px; margin: 0 0 18px; }
form { display: grid; gap: 16px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; }
label small { font-weight: 400; color: var(--ink2); }
input[type=text], input:not([type]), input[inputmode] {
  width: 100%; min-height: 52px; padding: 0 14px; border: 1.5px solid var(--ink); border-radius: 12px;
  background: var(--sheet); font-weight: 400; font-size: 17px;
}
input::placeholder { color: #8A9099; }
.check { grid-template-columns: 26px 1fr; align-items: start; gap: 12px; font-weight: 400; color: var(--ink2); }
.check input { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--ink); }
.error { margin: 0; padding: 12px 14px; border-radius: 12px; background: #FBD9D5; color: #7A1008; font-weight: 600; font-size: 15px; }
.cta {
  min-height: 58px; border: 0; border-radius: var(--r); background: var(--ink); color: var(--paper);
  font-weight: 700; font-stretch: 85%; font-size: 21px; padding: 0 20px;
}
.cta.line { background: none; color: var(--ink); border: 1.5px solid var(--ink); }
.cta.light { background: var(--paper); color: var(--ink); }

/* Leitor */
.scanner { position: fixed; inset: 0; max-width: none; padding: 0; background: #000; z-index: 10; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner .frame { position: absolute; left: 50%; top: 42%; width: min(80vw, 420px); aspect-ratio: 2 / 1; transform: translate(-50%, -50%);
  border: 3px solid #fff; border-radius: 14px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.55); }
.scan-tip { position: absolute; left: 0; right: 0; top: calc(42% + min(40vw, 210px) / 2 + 32px); margin: 0; text-align: center; color: #fff; font-weight: 600; font-size: 18px; }
.scanner .cta { position: absolute; left: 20px; right: 20px; bottom: calc(24px + env(safe-area-inset-bottom)); }

/* Resultado */
.res { background: var(--paper); }
.res .flood { background: var(--c); color: var(--on); }
.res .flood .wrap { padding-bottom: 60px; }
.res[data-state=fake] { --c: #E0261B; --on: #fff; }
.res[data-state=verdadeira] { --c: #0B8A4D; --on: #fff; }
.res[data-state=maquiada] { --c: #F5B800; --on: var(--ink); }
.res[data-state=sem-desconto] { --c: #2F3640; --on: #fff; }
.res[data-state=sem-dados] { --c: #DCE0D8; --on: var(--ink); }
.res .back { color: var(--on); display: block; }
.stamp {
  display: inline-block; margin: 22px 0 28px 6px; padding: .02em .2em .1em;
  border: 6px solid currentColor; border-radius: 10px; outline: 2px solid currentColor; outline-offset: 4px;
  font-weight: 800; font-stretch: 75%; font-size: clamp(56px, 19vw, 92px); line-height: .96; letter-spacing: .01em;
  text-transform: uppercase; transform: rotate(-4deg);
  animation: stamp .45s cubic-bezier(.2, .9, .3, 1.15) both;
}
.stamp.long { font-size: clamp(40px, 13vw, 64px); }
@keyframes stamp { from { transform: rotate(-10deg) scale(1.8); opacity: 0; } 55% { opacity: 1; } to { transform: rotate(-4deg) scale(1); } }
.res h1 { font-size: clamp(30px, 9vw, 40px); line-height: 1; margin-bottom: 12px; }
.summary { font-size: 18px; margin: 0 0 24px; max-width: 36ch; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 0; }
.duo dt { font-weight: 600; font-size: 15px; }
.duo dd { margin: 0; font-weight: 800; font-stretch: 75%; font-size: clamp(48px, 15vw, 64px); line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.sheet { position: relative; background: var(--sheet); }
.sheet::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 14px;
  background: radial-gradient(circle at 10px 0, var(--c) 8px, transparent 8.5px) repeat-x; background-size: 20px 14px;
}
.sheet .wrap { padding-top: 32px; }
.chart { width: 100%; height: auto; display: block; margin: 0 0 8px; overflow: visible; }
.chart text { font-family: inherit; font-size: 11px; fill: var(--ink2); }
.chart .strong { fill: var(--ink); font-weight: 700; font-size: 12px; }
.flags { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.flags li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; }
.flags .ic { width: 22px; height: 22px; display: grid; place-items: center; font-weight: 800; font-size: 13px; line-height: 1; border: 1.5px solid var(--ink); }
.flags .bad .ic { background: #E0261B; color: #fff; border-color: #E0261B; border-radius: 5px; }
.flags .warn .ic { background: #F5B800; border-color: #F5B800; border-radius: 50%; }
.flags .ok .ic { background: #0B8A4D; color: #fff; border-color: #0B8A4D; border-radius: 50%; }
.flags .info .ic { border-radius: 50%; color: var(--ink2); border-color: var(--ink2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.source { margin: 22px 0 0; padding: 12px 14px; border: 1.5px dashed var(--ink2); border-radius: 12px; font-size: 14px; color: var(--ink2); }
.source.demo { border-color: #B5651D; color: #6B3A0C; background: #FFF4E5; font-weight: 600; }
.actions { display: grid; gap: 10px; margin-top: 26px; }

/* Estados gerais */
.busy { position: fixed; inset: 0; z-index: 30; display: grid; place-content: center; justify-items: center; gap: 16px; background: rgba(241,243,238,.94); font-weight: 600; font-size: 19px; }
.busy p { margin: 0; }
.bar { width: 190px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar::after { content: ""; display: block; width: 42%; height: 100%; background: var(--ink); animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(240%); } }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 40; max-width: 488px; margin: 0 auto; padding: 14px 16px; border-radius: 12px; background: var(--ink); color: var(--paper); font-weight: 600; font-size: 16px; }

@media (prefers-reduced-motion: reduce) {
  .stamp { animation: none; }
  .bar::after { animation: none; width: 100%; }
}

/* Result layout: 1.618 proportion on wide screens, stacked on phones. */
.res { --result-gap: clamp(20px, 3vw, 32px); --result-width: 960px; }
.res .wrap { max-width: var(--result-width); padding-inline: clamp(18px, 4vw, 40px); }
.res .flood .wrap { padding-bottom: 36px; }
.res .stamp { border-width: 2px; outline: none; transform: none; animation: none; border-radius: 4px; font-size: clamp(32px, 7vw, 56px); margin: 12px 0 20px; }
.res .summary { max-width: 62ch; }
.price-hero { display:grid; grid-template-columns:minmax(0,1.618fr) minmax(0,1fr); gap:var(--result-gap); border-top:1px solid currentColor; padding-top:20px; }
.price-hero small { display:block; font-size:14px; }
.price-hero strong { display:block; font-size:clamp(24px,5vw,48px); line-height:1.12; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.result-grid { display:grid; grid-template-columns:minmax(0,1.618fr) minmax(0,1fr); gap:var(--result-gap); }
.result-main, .result-evidence { min-width:0; }
.result-main h2 { margin:0 0 10px; font-size:clamp(19px,2.4vw,24px); }
.result-main section { padding:18px 0; border-bottom:1px solid var(--line); }
.result-main section:first-child { padding-top:0; }
.result-main p { margin:8px 0; }
.result-main .duo { gap:12px; grid-template-columns:minmax(0,1.618fr) minmax(0,1fr); }
.result-main .duo dd { font-size:clamp(24px,4vw,38px); overflow-wrap:anywhere; }
.result-evidence .flags { margin-top:0; }
.res .sheet::before { display:none; }
.res .sheet .wrap { padding-top:32px; }
.res .chart { margin-top:20px; }
@media(max-width:700px){.result-grid{grid-template-columns:1fr}.res .flood .wrap{padding-bottom:24px}.result-main .duo dd{font-size:clamp(24px,6vw,34px)}}

/* Affiliate offers: subordinate to the verdict, no commission-based ranking. */
.affiliate-offers { margin-top:24px; }
.affiliate-offers h2 { margin:0 0 10px; }
.affiliate-offers>p { font-size:14px; color:var(--ink2); }
.affiliate-offer { display:grid; grid-template-columns:minmax(0,1.618fr) minmax(0,1fr); align-items:center; gap:12px; padding:16px 0; border-top:1px solid var(--line); }
.affiliate-offer h3 { font-size:15px; line-height:1.35; margin:4px 0; overflow-wrap:anywhere; }
.affiliate-offer small { color:var(--ink2); font-size:12px; }
.affiliate-offer strong { font-size:20px; font-variant-numeric:tabular-nums; }
.affiliate-cta { display:block; padding:12px 8px; color:var(--paper); background:var(--ink); border-radius:4px; text-decoration:none; text-align:center; font-size:14px; font-weight:700; }

/* Catalogue highlights use the existing cards and controls; the header is unchanged. */
.market-catalog #catalogSearch .catalog-controls {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px;
}
.market-catalog #catalogSearch .catalog-controls label { min-width: 0; font-size: 12px; gap: 5px; }
.market-catalog #catalogSearch .catalog-controls select { min-width: 0; min-height: 44px; font-size: 13px; }
.market-catalog .catalog-heading > div { min-width: 0; }
.market-catalog .catalog-feature-badge {
  position: absolute; bottom: 5px; left: 5px; max-width: calc(100% - 10px);
  padding: 4px 6px; border-radius: 5px; background: #e4f54d; color: #111318;
  font-size: 10px; font-weight: 700; line-height: 1.3; text-align: left; overflow-wrap: anywhere;
}
.market-catalog .catalog-trend { color: #343a24; font-size: 11px; font-weight: 600; overflow-wrap: anywhere; }
.market-catalog .catalog-history { padding: 8px; border-radius: 7px; background: #f5f6f8; color: #565b65; }
.market-catalog .catalog-history.is-ready { background: #f0f5d5; color: #303a18; }
.market-catalog .catalog-history > span { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; }
.market-catalog .catalog-history .ui-icon { width: 14px; height: 14px; }
.market-catalog .catalog-history small { display: block; margin-top: 4px; font-size: 10px; line-height: 1.4; }
.market-catalog #catalogRetry { min-height: 44px; font-size: 14px; margin-bottom: 12px; }
@media (max-width: 360px) {
  .market-catalog #catalogSearch .catalog-controls { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 1200px) {
  .market-catalog:has(#catalogFilterPanel:not([hidden])) #catalogSearch .catalog-controls { grid-template-columns: minmax(0, 1fr); }
}
