:root {
  --bg: #0f172a; --card: #1e293b; --line: #334155; --text: #e2e8f0; --muted: #94a3b8;
  --accent: #f59e0b; --ok: #22c55e; --ng: #ef4444; --blue: #38bdf8;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif; font-size: 15px; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 12px; } .center { text-align: center; } .err { color: var(--ng); }
h2 { font-size: 18px; margin: 8px 0 12px; } h3 { font-size: 15px; margin: 18px 0 6px; }
code { background: #0b1220; padding: 1px 4px; border-radius: 4px; }

header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.logo { font-weight: 700; color: var(--accent); }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: #7c2d12; color: #fed7aa; }
main { padding: 12px 12px 90px; max-width: 760px; margin: 0 auto; }
nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
nav button { flex: 1; background: none; border: 0; color: var(--muted); padding: 8px 0; font-size: 18px; display: flex; flex-direction: column; align-items: center; }
nav button span { font-size: 11px; } nav button.active { color: var(--accent); }

.btn { background: var(--line); color: var(--text); border: 0; border-radius: 10px; padding: 10px 14px; font-size: 14px; cursor: pointer; }
.btn.primary { background: var(--accent); color: #111; font-weight: 700; }
.btn.ghost { background: none; border: 1px solid var(--line); }
.btn.icon { font-size: 18px; padding: 8px 12px; }
.btn.sm { padding: 6px 10px; font-size: 12px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
input { background: #0b1220; color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 16px; width: 100%; }
label { display: block; margin: 8px 0; font-size: 13px; color: var(--muted); }
label input { margin-top: 4px; } label.row { display: flex; gap: 8px; align-items: center; } label.row input { width: auto; margin: 0; }

.login-box { max-width: 320px; margin: 22vh auto; text-align: center; padding: 0 16px; }
.login-box h1 { color: var(--accent); } .login-box form { display: grid; gap: 10px; }

.search { display: flex; gap: 6px; }
.scanner { position: relative; margin: 10px 0; border-radius: 12px; overflow: hidden; background: #000; }
.scanner video { width: 100%; display: block; max-height: 300px; object-fit: cover; }
.scanner .scan-line { position: absolute; left: 10%; right: 10%; top: 50%; height: 2px; background: var(--ng); box-shadow: 0 0 8px var(--ng); }
.scanner .btn { position: absolute; right: 8px; top: 8px; }

.card { background: var(--card); border-radius: 12px; padding: 12px; margin: 10px 0; }
.prod { display: flex; gap: 12px; }
.prod img { width: 84px; height: 84px; object-fit: contain; background: #fff; border-radius: 8px; flex-shrink: 0; }
.prod .t { font-size: 14px; line-height: 1.35; }
.prod .meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.rank { font-size: 20px; font-weight: 700; color: var(--blue); }
.alt { font-size: 12px; margin-top: 6px; } .alt a { color: var(--blue); margin-right: 8px; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.grid div { background: #0b1220; border-radius: 8px; padding: 8px; }
.grid small { display: block; color: var(--muted); font-size: 11px; }
.grid b { font-size: 15px; }
.warn { color: var(--ng); font-weight: 700; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
td, th { padding: 5px 4px; border-bottom: 1px solid var(--line); text-align: right; } td:first-child, th:first-child { text-align: left; }

.periods { display: flex; gap: 6px; margin-bottom: 8px; }
.periods button { flex: 1; } .periods button.on { background: var(--accent); color: #111; font-weight: 700; }
.sales { display: flex; justify-content: space-between; align-items: baseline; background: #0b1220; border-radius: 8px; padding: 10px; margin-bottom: 8px; }
.sales b { font-size: 22px; color: var(--ok); }
.chart { margin: 6px 0 12px; } .chart h4 { margin: 0 0 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.chart svg { width: 100%; height: auto; display: block; background: #0b1220; border-radius: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; margin-top: 4px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 3px; margin-right: 4px; vertical-align: middle; }

.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.calc label { margin: 0; }
.profit { margin-top: 10px; padding: 12px; border-radius: 10px; text-align: center; background: #0b1220; }
.profit .big { font-size: 28px; font-weight: 800; }
.profit.good { border: 2px solid var(--ok); } .profit.good .big { color: var(--ok); }
.profit.bad { border: 2px solid var(--ng); } .profit.bad .big { color: var(--ng); }
.fees { font-size: 12px; color: var(--muted); margin-top: 6px; }

.links { display: flex; flex-wrap: wrap; gap: 6px; }
.links a { text-decoration: none; background: #0b1220; border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 9px 12px; font-size: 13px; }

.item { display: flex; gap: 10px; align-items: center; background: var(--card); border-radius: 10px; padding: 8px; margin: 6px 0; cursor: pointer; }
.item img { width: 48px; height: 48px; object-fit: contain; background: #fff; border-radius: 6px; }
.item .t { font-size: 13px; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item .r { text-align: right; font-size: 12px; white-space: nowrap; }
.sum { background: var(--card); border-radius: 10px; padding: 10px; font-size: 14px; }
.link-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 6px; margin: 6px 0; }
.link-row input { padding: 8px; font-size: 13px; }
#googleBtn { display: flex; justify-content: center; margin: 16px 0 10px; }
.btn.apple { background: #fff; color: #000; font-weight: 600; width: 100%; max-width: 300px; margin: 0 auto 10px; display: block; }
.alert { background: #14532d; border: 2px solid var(--ok); border-radius: 12px; padding: 12px; margin: 10px 0; font-weight: 700; }
.alert.restr { background: #450a0a; border-color: var(--ng); }
.judge { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.judge div { background: #0b1220; border-radius: 10px; padding: 10px 6px; text-align: center; }
.judge .ic { font-size: 22px; } .judge small { display: block; color: var(--muted); font-size: 11px; } .judge b { font-size: 16px; }
.mini { margin-top: 8px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; margin-bottom: 6px; color: var(--muted); }
.filters label { display: flex; gap: 4px; align-items: center; margin: 0; } .filters input { width: auto; margin: 0; }
.hyb a { color: var(--text); text-decoration: none; display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.hyb .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.hyb .ok { color: var(--ok); font-weight: 700; } .hyb .ng { color: var(--ng); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.modal .sheet { background: var(--card); width: 100%; max-width: 760px; border-radius: 16px 16px 0 0; padding: 16px; max-height: 90vh; overflow: auto; }
select { background: #0b1220; color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 16px; width: 100%; margin-top: 4px; }
textarea { background: #0b1220; color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 14px; width: 100%; margin-top: 4px; min-height: 60px; }
.hrow { display: flex; align-items: center; gap: 6px; } .hrow a { flex: 1; min-width: 0; }
.prow { display: flex; align-items: center; gap: 8px; background: #0b1220; border-radius: 8px; padding: 6px 8px; margin: 4px 0; font-size: 14px; }
.prow b { flex: 1; } .pmax { color: var(--muted); font-size: 13px; }
.ptag { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; min-width: 44px; text-align: center; }
.ptag.cart { background: var(--accent); color: #111; } .ptag.new { background: #334155; } .ptag.used { background: #334155; color: #c4b5fd; }
.hitem { display: flex; gap: 10px; background: var(--card); border-radius: 12px; padding: 10px; margin: 8px 0; cursor: pointer; }
.hitem .hl { width: 64px; text-align: center; flex-shrink: 0; } .hitem img { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 6px; }
.hitem .hr { font-size: 12px; font-weight: 700; color: var(--blue); margin-top: 4px; }
.hitem .hc { flex: 1; min-width: 0; } .hitem .t { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 3px 0; }
.cat { font-size: 10px; background: #334155; padding: 2px 6px; border-radius: 4px; margin-right: 4px; } .cat.amz { background: #7c2d12; }
.scanner .torch { right: auto; left: 8px; }
.scanner .scan-tip { position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; font-size: 12px; color: #fff; text-shadow: 0 1px 3px #000; margin: 0; }
.scanner video { max-height: 360px; }
/* Não dar zoom com 2 toques nem ao tocar nos campos (iPhone) */
html, body { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
input, select, textarea { font-size: 16px !important; }
* { -webkit-tap-highlight-color: transparent; }
