/* SARTCG — design mobile-first com cara de app (PWA). Base = celular; telas maiores via min-width. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/inter-latin.woff2) format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 600 800; font-display: swap; src: url(fonts/montserrat-latin.woff2) format("woff2"); }

/* Paleta SAR TCG: azul profundo #0D1B3D, azul elétrico #0B6BFF, ciano #00E5C7, dourado #FFC443, cinza claro #E2E8F0.
   Tema escuro é o padrão; o claro vem de [data-theme="light"]. Pares de cor validados para WCAG AA (ver docs/design-system.md). */
:root {
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Montserrat", "Inter", system-ui, sans-serif;
  --navy: #0d1b3d;
  --blue: #0b6bff;
  --cyan: #00e5c7;
  --gold: #ffc443;
  --grey: #e2e8f0;
  --primary: #0b6bff;      /* fundo de botões e destaques preenchidos */
  --primary-2: #0957d6;
  --primary-ink: #ffffff;
  --radius: 20px;
  --gutter: 16px;
  --appbar-h: 56px;
  --tabbar-h: 64px;
  /* escuro (padrão) */
  --bg: #0d1b3d;
  --surface: #13244c;
  --surface-2: #1b3063;
  --text: #f3f6fc;
  --muted: #a8b5d0;
  --line: rgba(226, 232, 240, .14);
  --accent: #00e5c7;       /* texto e ícones de destaque */
  --gold-ink: #ffc443;
  --success: #2ee6b6;
  --warning: #ffc443;
  --error: #ff8a96;
  --up: #2ee6b6;
  --down: #ff8a96;
  --glass: rgba(13, 27, 61, .88);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(2, 8, 23, .45);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #eef2f8;
  --surface: #ffffff;
  --surface-2: #e2e8f0;
  --text: #0d1b3d;
  --muted: #4a5878;
  --line: rgba(13, 27, 61, .13);
  --accent: #0958d9;
  --gold-ink: #8a5a00;
  --success: #0b7a5c;
  --warning: #8a5a00;
  --error: #c1292e;
  --up: #0b7a5c;
  --down: #c1292e;
  --glass: rgba(238, 242, 248, .88);
  --shadow: 0 1px 2px rgba(13, 27, 61, .06), 0 8px 24px rgba(13, 27, 61, .09);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--appbar-h) + 12px); scroll-padding-bottom: calc(var(--tabbar-h) + 24px); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 var(--font-body);
  overflow-x: hidden; -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px);
}
a { color: inherit; }
h1, h2, p { margin: 0; }
h1, h2, .brand, .total-value, .grade-num, .stat strong, .price-hero strong { font-family: var(--font-head); }
button { font: inherit; color: inherit; }
a, button, input, label { touch-action: manipulation; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.skip { position: fixed; left: 12px; top: -80px; z-index: 100; padding: 10px 16px; border-radius: 12px; font-weight: 700; text-decoration: none; background: var(--primary); color: var(--primary-ink); transition: top .15s; }
.skip:focus { top: calc(8px + env(safe-area-inset-top)); }

/* ---------- Barra superior ---------- */
.appbar {
  position: sticky; top: 0; z-index: 30;
  padding-top: env(safe-area-inset-top);
  background: var(--glass); -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid var(--line);
}
.appbar-inner { height: var(--appbar-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em; }
.brand-mark { width: 34px; height: 34px; flex: none; display: block; }
.brand-name span { color: var(--accent); }
.topnav { display: none; }
.appbar-end { display: flex; align-items: center; }
.login-btn {
  height: 36px; padding: 0 16px; border: 0; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: .9rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--primary-ink);
}
.avatar-btn { width: 38px; height: 38px; padding: 0; border: 2px solid var(--line); border-radius: 50%; overflow: hidden; background: var(--surface-2); cursor: pointer; display: grid; place-items: center; font-weight: 700; }
.avatar-btn img, .profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.theme-btn { width: 40px; height: 40px; margin-left: auto; margin-right: 8px; flex: none; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; cursor: pointer; background: var(--surface); color: var(--text); }
.theme-btn:active { transform: scale(.92); }
.appbar-inner { gap: 8px; }

/* ---------- Navegação inferior (celular) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(6, 1fr); align-items: end;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 0 6px env(safe-area-inset-bottom);
  background: var(--glass); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--tabbar-h); border: 0; background: none; text-decoration: none; cursor: pointer;
  color: var(--muted); font-size: .68rem; font-weight: 600; position: relative; transition: color .15s;
}
.tab:active .tab-icon { transform: scale(.88); }
.tab-icon { display: grid; place-items: center; transition: transform .15s; }
.tab[aria-current="page"] { color: var(--accent); }
.tab[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; width: 22px; height: 3px; border-radius: 0 0 4px 4px; background: var(--accent);
}
.tab-scan { color: var(--primary-ink); overflow: visible; }
.tab-scan .tab-icon {
  width: 56px; height: 56px; margin-top: -26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 8px 22px rgba(11, 107, 255, .5), 0 0 0 5px var(--bg), 0 0 0 7px color-mix(in srgb, var(--cyan) 45%, transparent);
}
.tab-scan .tab-label { color: var(--muted); margin-top: 2px; }

/* ---------- Telas ---------- */
.view { padding-top: 8px; animation: view-in .25s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }
.view-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 2px 4px; }
.view-head h1 { font-size: 1.7rem; letter-spacing: -.03em; line-height: 1.15; }
.updated { font-size: .78rem; color: var(--muted); white-space: nowrap; }

/* ---------- Hero da tela inicial ---------- */
.hero { position: relative; overflow: hidden; margin: 12px 0 4px; padding: 20px 18px 18px; border-radius: var(--radius); color: #fff;
  background: linear-gradient(135deg, #0d1b3d 0%, #0d1b3d 38%, #0a4fd1 130%); border: 1px solid color-mix(in srgb, var(--cyan) 26%, transparent); box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; right: -26px; bottom: -30px; width: 130px; height: 130px; background: url(logo.svg) center / contain no-repeat; opacity: .16; pointer-events: none; }
.hero-kicker { font-family: var(--font-head); font-weight: 800; font-size: .8rem; letter-spacing: .14em; color: var(--cyan); }
.hero h2 { margin-top: 4px; font-size: clamp(1.35rem, 5.4vw, 1.8rem); line-height: 1.15; letter-spacing: -.02em; max-width: 16ch; }
.hero p.hero-sub { margin-top: 6px; max-width: 34ch; font-size: .92rem; color: #d3dcef; }
.hero-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.hero-actions a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 999px; font-size: .88rem; font-weight: 700; text-decoration: none; color: var(--primary-ink); background: var(--primary); }
.hero-actions a + a { background: rgba(255, 255, 255, .14); }
[data-mode="favs"] .hero { display: none; }

/* ---------- Busca e filtros ---------- */
.filter-bar { position: sticky; top: calc(var(--appbar-h) + env(safe-area-inset-top)); z-index: 10; margin: 0 calc(var(--gutter) * -1) 8px; padding: 8px var(--gutter) 6px; background: var(--bg); }
.searchbox { position: relative; }
.searchbox-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); display: grid; pointer-events: none; }
input[type="search"] {
  width: 100%; height: 48px; padding: 0 16px 0 42px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 16px; box-shadow: var(--shadow); -webkit-appearance: none; appearance: none;
}
input[type="search"]::placeholder { color: var(--muted); }
.chips { display: flex; gap: 8px; margin-top: 10px; padding-right: 28px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .88rem; font-weight: 600; cursor: pointer; white-space: nowrap; transition: transform .12s; }
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
[data-mode="favs"] .chips { display: none; }

/* ---------- Torneios (aba própria) ---------- */
.view-link { font-size: .85rem; color: var(--muted); text-decoration: none; }
.tour-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.tour { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; text-decoration: none; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); animation: rise .3s ease both; }
.tour:active { transform: scale(.985); }
.tour-icon { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--gold-ink); background: color-mix(in srgb, var(--gold) 18%, transparent); }
.tour-body { min-width: 0; display: grid; gap: 2px; }
.t-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .95rem; line-height: 1.3; overflow-wrap: anywhere; }
.t-meta { font-size: .8rem; color: var(--muted); }

.status { min-height: 1.2em; margin: 4px 2px 8px; color: var(--muted); font-size: .82rem; }
.status.error { color: var(--error); }

/* ---------- Cards de notícia ---------- */
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.card-wrap { position: relative; min-width: 0; }
.card {
  display: flex; flex-direction: column; overflow: hidden; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  content-visibility: auto; contain-intrinsic-size: auto 340px; animation: rise .35s ease both; transition: transform .15s;
}
.card:active { transform: scale(.985); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.thumb { position: relative; aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.ph { display: grid; place-items: center; background: linear-gradient(135deg, hsl(var(--h) 75% 55%), hsl(calc(var(--h) + 40) 80% 42%)); }
.ph-name { color: #fff; font-weight: 800; font-size: 1.4rem; letter-spacing: -.02em; text-shadow: 0 2px 12px rgba(0, 0, 0, .25); padding: 0 16px; text-align: center; }
.src-chip { position: absolute; left: 12px; bottom: 12px; padding: 4px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; color: #fff; background: rgba(15, 17, 22, .6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: .78rem; color: var(--muted); }
.badge { padding: 2px 9px; border-radius: 999px; background: var(--surface-2); font-size: .7rem; font-weight: 700; color: var(--muted); }
.badge-ai { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.card h2 { font-size: clamp(1.04rem, .96rem + .45vw, 1.2rem); line-height: 1.28; letter-spacing: -.015em; overflow-wrap: anywhere; }
.excerpt { color: var(--muted); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.fav {
  position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: #fff; background: rgba(15, 17, 22, .55);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: transform .15s, background .15s;
}
.fav:active { transform: scale(.86); }
.fav[aria-pressed="true"] { background: var(--gold); color: var(--navy); }
.fav[aria-pressed="true"] svg { fill: currentColor; }

.more { display: flex; margin-top: 16px; }
.more button { width: 100%; height: 48px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; cursor: pointer; }

/* ---------- Esqueleto de carregamento ---------- */
.skel { height: 300px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border: 1px solid var(--line); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Estados vazios ---------- */
.empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 48px 20px; }
.empty-icon { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.empty h2 { font-size: 1.15rem; }
.empty p { color: var(--muted); max-width: 32ch; }
.empty .primary-btn { margin-top: 6px; }

/* ---------- Botões ---------- */
.primary-btn, .ghost-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 14px; font-weight: 700; cursor: pointer; text-align: center; transition: transform .12s; }
.primary-btn:active, .ghost-btn:active { transform: scale(.97); }
.primary-btn { border: 0; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--primary-ink); box-shadow: 0 6px 18px rgba(11, 107, 255, .35); }
.ghost-btn { border: 1px solid var(--line); background: var(--surface); }
.primary-btn:disabled, .ghost-btn:disabled { opacity: .6; }

/* ---------- Coleção ---------- */
.summary { color: var(--muted); font-size: .88rem; margin: 6px 2px 12px; }
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { display: grid; gap: 4px; align-content: start; padding: 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); animation: rise .3s ease both; }
.tile strong { font-size: .92rem; line-height: 1.25; overflow-wrap: anywhere; }
.tile-img { position: relative; }
.tile-img img, .tile-img .noimg { width: 100%; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.qty-badge { position: absolute; top: 8px; right: 8px; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 800; color: #fff; background: rgba(15, 17, 22, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.skel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile-skel { height: 260px; }
.qty { display: flex; gap: 8px; margin-top: 6px; }
.qty-btn { flex: 1; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-size: 1.15rem; font-weight: 700; cursor: pointer; }
.qty-btn:active { transform: scale(.94); }
.fine { margin: 0; font-size: .8rem; color: var(--muted); }

/* ---------- Conta ---------- */
.profile { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); margin: 8px 0 12px; }
.profile-avatar { width: 60px; height: 60px; flex: none; border-radius: 50%; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; font-size: 1.4rem; font-weight: 800; }
.profile-info { display: grid; min-width: 0; }
.profile-info span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.stat { display: grid; gap: 2px; padding: 16px; text-align: left; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); cursor: pointer; }
.stat strong { font-size: 1.7rem; letter-spacing: -.03em; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .8rem; }
.group { padding: 6px 16px; margin-bottom: 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.group h2 { font-size: .95rem; padding: 12px 0 4px; }
.group.note { padding: 14px 16px; display: grid; gap: 4px; }
.group.note p { color: var(--muted); font-size: .9rem; }
.list-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; background: none; border: 0; cursor: pointer; font-weight: 600; text-align: left; }
.src-list { list-style: none; margin: 0; padding: 0 0 8px; }
.src-list li { display: flex; justify-content: space-between; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.src-list li:last-child { border-bottom: 0; }
.src-list a { text-decoration: none; font-weight: 600; }

/* ---------- Rodapé ---------- */
.foot { margin-top: 28px; padding: 18px 2px 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.foot p { max-width: 70ch; }
.foot-sources { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; margin: 0 0 10px; padding: 0; }
.foot-sources a { display: inline-block; padding: 6px 0; text-decoration: none; font-weight: 600; }
[data-route="col"] .foot-sources, [data-route="acc"] .foot-sources { display: none; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 18px); z-index: 60;
  display: flex; align-items: center; gap: 10px; max-width: min(92vw, 420px); padding: 12px 16px; border-radius: 16px;
  background: var(--text); color: var(--bg); font-size: .9rem; font-weight: 600; box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
  opacity: 0; transform: translate(-50%, 16px); pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast svg { color: var(--primary); flex: none; }
.toast button { margin-left: 4px; padding: 6px 10px; border: 0; border-radius: 10px; background: color-mix(in srgb, var(--bg) 18%, transparent); font-weight: 800; cursor: pointer; white-space: nowrap; }

/* ---------- Janela do scanner (bottom sheet) ---------- */
.sheet { border: 0; padding: 0; margin: auto 0 0; width: 100%; max-width: 560px; max-height: 92dvh; border-radius: 26px 26px 0 0; background: var(--surface); color: var(--text); overflow: hidden; }
.sheet[open] { display: flex; flex-direction: column; animation: sheet-up .28s cubic-bezier(.2, .9, .3, 1); }
.sheet::backdrop { background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
@keyframes sheet-up { from { transform: translateY(60px); opacity: 0; } }
.sheet-grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 10px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px 6px 20px; }
.sheet-head h2 { font-size: 1.15rem; }
.sheet-close { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; cursor: pointer; }
.sheet-body { padding: 8px 20px; overflow-y: auto; padding-bottom: calc(20px + env(safe-area-inset-bottom)); display: grid; gap: 14px; align-content: start; }
.sheet-lead { font-size: 1.02rem; }
.sheet-lead.error { color: var(--error); }
.tips { margin: 0; padding-left: 20px; color: var(--muted); font-size: .92rem; }
.actions { display: grid; gap: 10px; }
.scan-hero { display: grid; place-items: center; padding: 6px 0; }
.scan-frame { position: relative; width: 120px; aspect-ratio: 5 / 7; border-radius: 12px; background: var(--surface-2); }
.scan-frame span { position: absolute; width: 22px; height: 22px; border: 3px solid var(--accent); }
.scan-frame span:nth-child(1) { top: -4px; left: -4px; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.scan-frame span:nth-child(2) { top: -4px; right: -4px; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.scan-frame span:nth-child(3) { bottom: -4px; left: -4px; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.scan-frame span:nth-child(4) { bottom: -4px; right: -4px; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.preview { width: 100%; max-height: 240px; object-fit: contain; border-radius: 14px; background: var(--surface-2); }
.preview.small { width: 72px; height: 100px; flex: none; }
.read { display: flex; gap: 12px; align-items: center; }
.loading { display: grid; justify-items: center; gap: 10px; padding: 12px 0; color: var(--muted); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cands { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cand { display: flex; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 16px; }
.cand.best { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.cand > img, .cand .noimg { width: 84px; flex: none; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.cand-body { min-width: 0; display: grid; gap: 6px; align-content: start; flex: 1; }
.cand-body strong { overflow-wrap: anywhere; }
.cand-body .primary-btn, .cand-body .ghost-btn { min-height: 44px; font-size: .9rem; padding: 0 14px; }


/* ---------- Valores da coleção (BRL) ---------- */
.total-card { display: grid; gap: 4px; padding: 20px; margin: 4px 0 14px; border-radius: var(--radius); color: #fff; background: linear-gradient(135deg, #0a4fd1, #0b3a99 55%, #0d1b3d); border: 1px solid color-mix(in srgb, var(--cyan) 28%, transparent); box-shadow: 0 10px 28px rgba(11, 107, 255, .3); }
.total-label { font-size: .82rem; font-weight: 600; opacity: .85; }
.total-value { font-size: clamp(1.9rem, 8vw, 2.6rem); letter-spacing: -.03em; line-height: 1.1; }
.total-sub { display: flex; gap: 16px; margin-top: 6px; font-weight: 700; font-size: .92rem; }
.total-note { margin-top: 8px; font-size: .76rem; opacity: .85; }
.tile-price { display: grid; gap: 0; margin-top: 2px; }
.tile-price strong { font-size: 1rem; color: var(--accent); }
.price { font-size: .9rem; font-weight: 700; color: var(--accent); }
.stat-wide { grid-column: 1 / -1; }
.stat-big { font-size: 1.9rem !important; color: var(--accent); }
.stats { grid-template-columns: 1fr 1fr; }

/* ---------- Guia de preços ---------- */
.price-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 2px 8px; }
.price-tools .status { margin: 0; min-height: 0; }
.sort select { height: 40px; max-width: 200px; padding: 0 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-size: .85rem; font-weight: 600; }
.price-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.price-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 64px; padding: 12px 16px; text-align: left; cursor: pointer; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .12s; }
.price-row:active { transform: scale(.985); }
.price-main { min-width: 0; display: grid; gap: 2px; }
.price-main strong { font-size: .98rem; line-height: 1.25; overflow-wrap: anywhere; }
.price-vals { flex: none; display: grid; justify-items: end; gap: 1px; }
.price-vals > strong { font-size: 1.02rem; color: var(--accent); }
.delta { font-size: .72rem; font-weight: 800; }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }
.delta.flat { color: var(--muted); font-weight: 600; }
.price-skel { height: 64px; }
.price-row { gap: 12px; }
.price-thumb { position: relative; flex: none; width: 44px; aspect-ratio: 5 / 7; border-radius: 6px; background: var(--surface-2); }
.price-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; display: block; }
.price-qty { position: absolute; right: -6px; bottom: -6px; padding: 1px 6px; border-radius: 999px; font-size: .68rem; font-weight: 800; color: var(--primary-ink); background: var(--primary); box-shadow: 0 0 0 2px var(--surface); }
.price-main { flex: 1; }
.hist-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 40px; margin-top: 4px; padding: 0 4px; border: 1px solid var(--line); border-radius: 12px; background: none; font-size: .74rem; font-weight: 700; white-space: nowrap; color: var(--muted); cursor: pointer; }
.hist-btn:active { transform: scale(.97); }
.tile-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tile-actions .hist-btn { margin-top: 4px; }
.grade-badge { position: absolute; top: 8px; left: 8px; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 800; color: #fff; background: #667085; }
.grade-badge.g-NM, .grade-hero.g-NM .grade-num { background: #15803d; }
.grade-badge.g-SP, .grade-hero.g-SP .grade-num { background: #4d8a1f; }
.grade-badge.g-MP, .grade-hero.g-MP .grade-num { background: #b7791f; }
.grade-badge.g-HP, .grade-hero.g-HP .grade-num { background: #c2570c; }
.grade-badge.g-D, .grade-hero.g-D .grade-num { background: #b42318; }

/* ---------- Nota de conservação ---------- */
.photo-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.photo-slot { position: relative; display: grid; place-items: center; align-content: center; gap: 4px; min-height: 170px; padding: 10px; text-align: center; cursor: pointer; border: 2px dashed var(--line); border-radius: 16px; background: var(--surface-2); overflow: hidden; }
.photo-slot.done { border-style: solid; border-color: var(--accent); }
.photo-slot.busy { opacity: .6; }
.photo-slot img { width: 100%; max-height: 150px; object-fit: contain; border-radius: 8px; }
.photo-label { font-weight: 700; }
.grade-hero { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); }
.grade-hero > div { display: grid; }
.grade-num { min-width: 76px; padding: 8px 0; border-radius: 14px; text-align: center; font-size: 2rem; letter-spacing: -.03em; line-height: 1.1; color: #fff; background: #667085; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: 96px 1fr 34px; align-items: center; gap: 10px; font-size: .9rem; }
.bars strong { text-align: right; }
.bar { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 8px; background: var(--accent); }

.pad { padding: 12px 2px; }
.price-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); }
.price-hero > div { display: grid; }
.price-hero strong { font-size: 1.35rem; letter-spacing: -.02em; }
.spark { width: 100%; height: 70px; color: var(--accent); }
.price-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.price-table th, .price-table td { padding: 9px 4px; text-align: right; border-bottom: 1px solid var(--line); }
.price-table th:first-child, .price-table td:first-child { text-align: left; }
.price-table th { color: var(--muted); font-size: .76rem; font-weight: 700; }

/* ---------- ≥ 600px ---------- */
@media (min-width: 600px) {
  :root { --gutter: 24px; }
  .card { flex-direction: row; }
  .card .thumb { flex: 0 0 240px; aspect-ratio: auto; min-height: 168px; }
  .card-body { padding: 16px 56px 16px 18px; }
  .fav { top: 12px; right: 12px; background: var(--surface-2); color: var(--muted); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .fav[aria-pressed="true"] { background: var(--gold); color: #3a2600; }
  .grid, .skel-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .more button { width: auto; padding: 0 28px; margin: 0 auto; }
  .sheet { margin: auto; border-radius: 26px; }
  .skel { height: 168px; }
  .toast { bottom: 28px; }
}

/* ---------- ≥ 900px: desktop, navegação no topo ---------- */
@media (min-width: 900px) {
  body { padding-bottom: 24px; }
  .tabbar { display: none; }
  .topnav { display: flex; align-items: center; gap: 2px; margin-left: 12px; }
  .tab { height: 40px; flex-direction: row; gap: 8px; padding: 0 11px; border-radius: 999px; font-size: .9rem; }
  .tab[aria-current="page"] { background: color-mix(in srgb, var(--accent) 12%, transparent); }
  .tab[aria-current="page"]::before { display: none; }
  .tab-scan { background: linear-gradient(135deg, var(--primary), var(--primary-2)); margin-left: 8px; }
  .tab-scan .tab-icon { width: auto; height: auto; margin: 0; background: none; box-shadow: none; }
  .tab-scan .tab-label { color: var(--primary-ink); margin: 0; }
  .filter-bar { margin: 0 0 8px; padding: 8px 0 6px; }
  .grid, .skel-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wrap { max-width: 980px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Câmera ao vivo ---------- */
.cam { width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: #000; color: #fff; overflow: hidden; }
.cam[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.cam::backdrop { background: #000; }
.cam-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; background: #000; }
.cam-title { flex: 1; min-width: 0; text-align: center; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cam-icon { width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, .14); cursor: pointer; }
.cam-icon[hidden] { display: none; }
.cam-icon[aria-pressed="true"] { background: var(--gold); color: #3a2600; }
.cam-stage { position: relative; overflow: hidden; background: #111; }
.cam-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-frame { position: absolute; left: 50%; top: 50%; height: 86%; max-width: 90%; aspect-ratio: 5 / 7; transform: translate(-50%, -50%); border-radius: 14px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .5); pointer-events: none; }
.cam-frame span { position: absolute; width: 28px; height: 28px; border: 3px solid #fff; }
.cam-frame span:nth-child(1) { top: -3px; left: -3px; border-right: 0; border-bottom: 0; border-radius: 14px 0 0 0; }
.cam-frame span:nth-child(2) { top: -3px; right: -3px; border-left: 0; border-bottom: 0; border-radius: 0 14px 0 0; }
.cam-frame span:nth-child(3) { bottom: -3px; left: -3px; border-right: 0; border-top: 0; border-radius: 0 0 0 14px; }
.cam-frame span:nth-child(4) { bottom: -3px; right: -3px; border-left: 0; border-top: 0; border-radius: 0 0 14px 0; }
.cam-bottom { display: grid; gap: 10px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); background: #000; }
.cam-hint { min-height: 2.6em; text-align: center; font-weight: 700; font-size: .95rem; line-height: 1.3; }
.cam-hint[data-state="warn"] { color: #fbbf24; }
.cam-hint[data-state="ok"] { color: #4ade80; }
.cam-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: 26px; }
.cam-checks li { padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; background: rgba(255, 255, 255, .12); }
.cam-checks li.ok { color: #4ade80; }
.cam-checks li.warn { color: #111; background: #fbbf24; }
.cam-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.cam-side { display: grid; justify-items: center; gap: 2px; min-height: 52px; border: 0; background: none; color: #fff; font-size: .72rem; font-weight: 600; cursor: pointer; opacity: .9; }
.cam-side[aria-pressed="true"] { color: #4ade80; opacity: 1; }
.cam-shutter { width: 74px; height: 74px; border-radius: 50%; border: 4px solid #fff; background: none; padding: 4px; cursor: pointer; }
.cam-shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; transition: transform .1s; }
.cam-shutter:active span { transform: scale(.88); }
.cam-shutter:disabled { opacity: .35; }
.cam-msg { position: absolute; inset: 0; display: grid; place-content: center; gap: 8px; padding: 24px; text-align: center; background: #111; }
.cam-msg[hidden], .cam-review[hidden] { display: none; }
.cam-review { position: absolute; inset: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: 10px; padding: 12px 16px 16px; background: #000; }
.cam-review img { width: 100%; height: 100%; object-fit: contain; border-radius: 12px; min-height: 0; }
.cam-review-tip { text-align: center; font-size: .88rem; opacity: .85; }
.cam-review-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.cam .ghost-btn { background: rgba(255, 255, 255, .14); color: #fff; border-color: transparent; }
