:root {
  --bg: #070b16;
  --bg-2: #0b1326;
  --card: #131b2e;
  --card-2: #171f33;
  --line: #2d3449;
  --text: #e8eefc;
  --muted: #9aa3c2;
  --violet: #377be6;
  --violet-2: #0b4aab;
  --green: #4edea3;
  --red: #ffb4ab;
  --cyan: #7bd0ff;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; max-width: 100%; overflow-x: hidden; }
html { touch-action: manipulation; }
body {
  font-family: Geist, ui-sans-serif, system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(55, 123, 230, 0.22), transparent 50%),
    radial-gradient(900px 400px at 100% 0%, rgba(0, 165, 114, 0.12), transparent 45%),
    var(--bg);
  color: var(--text);
  line-height: 1.45;
}

a { color: inherit; }
button, input, select, textarea { font: inherit; }
.wrap { width: min(1120px, calc(100% - 48px)); margin: 0 auto; }

.top {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(16px);
  background: rgba(7, 11, 22, 0.78);
  border-bottom: 1px solid var(--line);
}
.top-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo {
  width: 72px; height: 72px; flex: 0 0 72px;
  object-fit: contain; background: transparent;
}
.side-brand .brand-logo { width: 52px; height: 52px; flex-basis: 52px; }
.auth-card .brand, .public .card .brand { margin-bottom: 18px; }
.mobile-brand { display: none; }
.brand b { display: block; font-size: 15px; letter-spacing: -0.02em; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.app-shell { min-height: 100vh; }
.shell-main { min-height: 100vh; transition: margin-left 0.22s ease; }
.app-shell .shell-main { margin-left: 248px; }
.side {
  position: fixed; z-index: 30; inset: 0 auto 0 0; width: 248px;
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px 12px 14px;
  background: #0c1222;
  border-right: 1px solid rgba(255,255,255,0.06);
  transition: width 0.22s ease;
  overflow: hidden;
}
.side.is-rail { width: 76px; }
.app-shell .side.is-rail ~ .shell-main { margin-left: 76px; }
.side-brand { margin-bottom: 10px; min-height: 40px; }
.side-brand-text, .side-label, .side-user-text {
  white-space: nowrap; overflow: hidden;
  transition: opacity 0.15s ease;
}
.side.is-rail .side-brand-text,
.side.is-rail .side-label,
.side.is-rail .side-user-text { opacity: 0; width: 0; }
.side.is-rail .side-brand,
.side.is-rail .side-link,
.side.is-rail .side-user { justify-content: center; gap: 0; padding-left: 0; padding-right: 0; }
.side-nav { display: grid; gap: 4px; }
.side-link {
  display: flex; align-items: center; gap: 12px;
  min-height: 42px; padding: 8px 12px; border-radius: 12px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px;
}
.side-link:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.side-link.is-on { background: rgba(55,123,230,0.22); color: #fff; }
.side-ico { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; }
.side-ico svg { width: 20px; height: 20px; }
.side-foot { margin-top: auto; display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.06); }
.side-user { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 8px; }
.side-avatar {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 999px;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  background: rgba(55,123,230,0.28); color: #fff;
}
.side-user-text { display: grid; min-width: 0; }
.side-user-text b { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.side-user-text small { color: var(--muted); font-size: 11px; }
.nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nav a, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; text-decoration: none; cursor: pointer;
  border-radius: 10px; padding: 9px 14px;
  white-space: nowrap;
}
.nav a { color: var(--muted); }
.nav a:hover, .nav a.active { color: var(--text); background: rgba(255,255,255,0.05); }
.btn-primary { background: var(--violet); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--violet-2); }
.btn-whatsapp { background: #25d366; color: #062b14; font-weight: 600; }
.btn-whatsapp:hover { background: #1ebe5b; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-danger { background: transparent; color: var(--red); border: 1px solid rgba(255,180,171,0.3); }
.nav-support { color: #86efac !important; }
.support-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  display: inline-flex; align-items: center; gap: 8px;
  background: #25d366; color: #062b14;
  padding: 12px 16px; border-radius: 999px;
  font-weight: 700; text-decoration: none;
  box-shadow: 0 10px 28px rgba(37, 211, 102, 0.35);
}
.support-fab svg { width: 22px; height: 22px; display: block; }
.support-fab:hover { background: #1ebe5b; color: #062b14; }

.hero, .page { padding: 28px 0 64px; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -0.03em; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0 0 24px; max-width: 46ch; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.card {
  background: rgba(19, 27, 46, 0.9);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}
.card h2, .card h3 { margin: 0 0 12px; font-size: 1rem; }
.muted { color: var(--muted); }
.kicker { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.stat { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.03em; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line);
  white-space: nowrap;
}
.badge.ok { color: var(--green); border-color: rgba(78,222,163,0.35); }
.badge.warn { color: #fbbf24; border-color: rgba(251,191,36,0.35); }
.badge.bad { color: var(--red); border-color: rgba(255,180,171,0.35); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-scroll { overflow-x: auto; }
.tag-table { min-width: 920px; }
.tag-table td { vertical-align: middle; }
.tag-table .url { display: block; max-width: 260px; }
.tag-code, .tag-lot { white-space: nowrap; }
.tag-lot { margin-top: 4px; }
.tag-actions {
  display: flex; gap: 8px; align-items: center; justify-content: flex-end;
  white-space: nowrap;
}
.tag-actions form { display: inline-flex; margin: 0; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.url {
  display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: #0b1326; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px;
}

label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
input, select, textarea {
  width: 100%; background: #0b1326; color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
  font-size: 16px;
}
input.mono, textarea.mono, select.mono { font-size: 16px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(55,123,230,0.45); border-color: var(--violet); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.print-size-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}
.print-size-grid label:last-child { grid-column: 1 / -1; }

.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; }
.alert.ok { background: rgba(78,222,163,0.1); color: var(--green); }
.alert.err { background: rgba(147,0,10,0.25); color: var(--red); }

.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 28px 16px;
  background: linear-gradient(180deg, #0b4aab 0%, #1d63c8 48%, #377be6 100%);
  color: #16324f;
}
.auth-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 28px;
  padding: 28px 22px 18px;
  box-shadow: 0 22px 50px rgba(12, 58, 120, 0.22);
}
.auth-title {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 0 0 22px; color: #0b4aab; font-size: 26px; font-weight: 800; letter-spacing: -0.03em;
}
.auth-title svg { width: 26px; height: 26px; }
.auth .alert.err { background: #fee2e2; color: #b91c1c; }
.auth-field { position: relative; display: block; margin: 0 0 14px; }
.auth-field svg {
  position: absolute; left: 14px; top: 50%; width: 18px; height: 18px;
  transform: translateY(-50%); color: #8aa0b8; pointer-events: none;
}
.auth-field input {
  background: #fff; color: #1e293b; border: 1px solid #d7e3ef; border-radius: 12px;
  padding: 14px 14px 14px 44px;
}
.auth-field input::placeholder { color: #94a3b8; }
.auth-field input:focus { outline: 2px solid rgba(55, 123, 230, 0.28); border-color: #377be6; }
.auth-extra { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 16px; }
.auth-check {
  display: flex; align-items: center; gap: 8px; margin: 0;
  color: #334155; font-size: 14px; font-weight: 600;
}
.auth-check input {
  width: 18px; height: 18px; margin: 0; padding: 0; flex: 0 0 18px;
  accent-color: #377be6; background: #fff; border-radius: 4px;
}
.auth-forgot { color: #64748b; font-size: 14px; text-decoration: none; }
.auth-forgot:hover { color: #0b4aab; }
.auth-btn {
  width: 100%; min-height: 52px; border: 0; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(90deg, #0b4aab, #377be6); color: #fff;
  font-size: 17px; font-weight: 800; text-decoration: none;
  box-shadow: 0 10px 20px rgba(26, 111, 224, 0.28);
}
.auth-btn svg { width: 20px; height: 20px; }
.auth-btn:hover { filter: brightness(1.05); }
.auth-or {
  display: flex; align-items: center; gap: 12px; margin: 16px 0;
  color: #94a3b8; font-size: 14px;
}
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: #e2e8f0; }
.auth-promo {
  margin-top: 16px; border-radius: 16px; overflow: hidden;
  display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: center;
  padding: 14px; color: #fff;
  background: linear-gradient(145deg, #062a5c, #0b4aab 70%);
}
.auth-promo img { width: 72px; height: 72px; object-fit: contain; background: transparent; }
.auth-promo strong { display: block; font-size: 16px; line-height: 1.2; }
.auth-promo p { margin: 4px 0 0; font-size: 12px; line-height: 1.35; color: rgba(255,255,255,0.92); }
.auth-back {
  position: fixed; top: 18px; left: 18px; z-index: 2;
  width: 42px; height: 42px; border-radius: 999px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.22); color: #fff; text-decoration: none; font-size: 22px;
}
.auth-key-title {
  margin: 4px 0 22px; text-align: center;
  font-size: 22px; font-weight: 800; line-height: 1.45; color: #fff;
}
.auth-key-title span {
  background: #377be6; padding: 2px 6px;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.auth-key-field {
  display: grid; gap: 6px; margin: 0 0 14px;
  color: #64748b; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.auth-key-field input {
  background: #eef3fb; color: #1e293b; border: 0; border-radius: 8px;
  padding: 14px 12px; font-weight: 600; letter-spacing: 0; text-transform: none;
}
.auth-key-field input[name="chave"] { text-transform: uppercase; letter-spacing: 0.08em; }
.auth-key-field input:focus { outline: 2px solid rgba(55, 123, 230, 0.35); }
.auth-btn-solid { background: #377be6; box-shadow: none; text-transform: uppercase; letter-spacing: 0.06em; }
.auth-btn-solid:hover { background: #0b4aab; filter: none; }
.public {
  min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center;
}
.public .card { width: min(480px, 100%); }
.qr {
  width: 180px;
  height: 180px;
  background: transparent;
  padding: 0;
  image-rendering: pixelated;
}

.footer { color: var(--muted); font-size: 12px; padding: 0 0 32px; }
.dock { display: none; }

.period { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 0 0 16px; }
.period label { margin: 0; min-width: 140px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 8px; }
.bars span { flex: 1; min-width: 6px; background: linear-gradient(180deg, #7eb6ff, #0b4aab); border-radius: 4px 4px 0 0; }
.bar-inline { height: 6px; background: rgba(55,123,230,0.25); border-radius: 99px; overflow: hidden; min-width: 64px; }
.bar-inline i { display: block; height: 100%; background: #377be6; }

.analytics { margin-top: 40px; }
.analytics h2 { margin: 0; font-size: 1.45rem; letter-spacing: -0.03em; }
.analytics-head {
  display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.table-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; margin: 0 0 14px;
}
.table-toolbar h3 { margin: 0; font-size: 1rem; }
.table-search {
  display: flex; gap: 8px; align-items: center;
  flex: 1 1 240px; max-width: 420px; min-width: 0;
}
.table-search input { margin: 0; padding: 9px 12px; }
.table-search .btn { flex: 0 0 auto; white-space: nowrap; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600;
}
.pill:hover, .pill.is-on { color: #fff; background: var(--violet); border-color: var(--violet); }
.sub-toggle { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 16px; }
button.pill {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 6px 12px;
  cursor: pointer;
  background: transparent;
}
.pill-date { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 12px; }
.pill-date input { width: auto; padding: 8px 10px; }

.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi { min-height: 132px; display: flex; flex-direction: column; }
.kpi .stat { font-size: 2rem; }
.kpi .stat-date { font-size: 1.05rem; line-height: 1.35; font-weight: 650; }
.kpi .muted { margin: 6px 0 0; font-size: 13px; }
.kpi-delta { margin: 8px 0 0; font-size: 13px; font-weight: 650; }
.kpi-delta.is-up { color: var(--green); }
.kpi-delta.is-down { color: var(--red); }
.kpi-delta.is-flat { color: var(--muted); font-weight: 500; }
.kpi-meta { margin: -6px 0 16px; font-size: 13px; }

.peak-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.peak-card { text-align: left; position: relative; overflow: hidden; min-height: 148px; display: flex; flex-direction: column; }
.peak-card .stat { font-size: 2.6rem; }
.peak-card.is-top { border-color: rgba(78,222,163,0.45); box-shadow: inset 0 0 0 1px rgba(78,222,163,0.2); }
.peak-card.is-top .kicker { color: var(--green); }
.peak-hours { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.via-card { display: flex; flex-direction: column; }
.rank tbody.is-locked {
  filter: blur(10px);
  user-select: none;
  pointer-events: none;
}
.analytics-lock { margin: 6px 0 0; color: var(--muted); font-size: 13px; max-width: 46ch; }

.split-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; margin-bottom: 16px; }
.split-via { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.via-panel { margin-bottom: 16px; }
.via-card .stat { font-size: 2.2rem; }
.via-track { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: #0b1326; }
.via-track i { display: block; min-width: 0; }
.via-track .nfc { background: #00a572; }
.via-track .qr { background: #377be6; }
.via-track .unk { background: #3d4560; }

.chart { display: flex; align-items: stretch; gap: 10px; min-height: 200px; }
.chart-y {
  display: flex; flex-direction: column; justify-content: space-between;
  color: var(--muted); font-size: 11px; width: 28px; text-align: right; padding: 18px 0 28px;
}
.chart-plot {
  flex: 1; display: flex; align-items: flex-end; gap: 6px; height: 180px;
  border-bottom: 1px solid var(--line); padding: 0 2px; overflow-x: auto; justify-content: flex-start;
}
.chart-col {
  flex: 0 0 28px; display: flex; flex-direction: column; align-items: center;
  gap: 6px; height: 100%; justify-content: flex-end;
}
.chart-col b {
  display: block; width: 16px; border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #7eb6ff, #0b4aab);
}
.chart-col.is-empty b { background: #2a3348; width: 10px; }
.chart-col small { color: var(--muted); font-size: 10px; }
.chart-n { color: var(--muted); font-size: 10px; font-weight: 600; min-height: 14px; }

.week-plot { display: flex; align-items: flex-end; gap: 8px; height: 168px; padding-top: 8px; }
.week-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.week-col b {
  width: 100%; max-width: 28px; border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, #7bd0ff, #006e95);
}
.week-col.is-empty b { background: #2a3348; }
.week-col small { color: var(--muted); font-size: 11px; }

.scan-hero {
  display: grid; grid-template-columns: 1fr 1fr 220px; gap: 16px; align-items: stretch; margin-bottom: 8px;
}
.scan-hero.is-client { grid-template-columns: 1fr 220px; }
.scan-frame {
  background: linear-gradient(180deg, #00a572, #006e95);
  padding: 12px 12px 10px; border-radius: 16px; text-align: center;
  display: flex; flex-direction: column; justify-content: center;
}
.scan-frame strong { display: block; color: #fff; font-size: 11px; letter-spacing: 0.16em; margin-bottom: 10px; }
.scan-frame img { width: 168px; height: 168px; display: block; margin: 0 auto; background: transparent; }
.scan-frame .btn { margin-top: 10px; width: 100%; background: rgba(0,0,0,0.22); color: #fff; border: 0; }
.scan-frame .btn.is-alt {
  margin-top: 6px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
}
.qr-themes { justify-content: center; gap: 6px; margin-bottom: 8px; }
.scan-frame .pill {
  padding: 5px 10px;
  font-size: 11px;
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.32);
}
.scan-frame .pill:hover, .scan-frame .pill.is-on {
  background: #fff;
  color: #006e95;
  border-color: #fff;
}
.scan-frame.is-light {
  background: linear-gradient(180deg, #f7fafc, #e4eef6);
}
.scan-frame.is-light strong { color: #0b1326; }
.scan-frame.is-light .btn { background: #0b1326; color: #fff; }
.scan-frame.is-light .btn.is-alt {
  background: transparent;
  color: #0b1326;
  border-color: #0b1326;
}
.scan-frame.is-light .pill {
  color: #4b5563;
  border-color: #c5d0e0;
  background: #fff;
}
.scan-frame.is-light .pill:hover, .scan-frame.is-light .pill.is-on {
  color: #fff;
  background: var(--violet);
  border-color: var(--violet);
}

.rank th, .rank td { padding: 10px 8px; vertical-align: middle; }
.rank th:first-child, .rank td:first-child { width: 28px; color: var(--muted); }
.rank th:nth-child(3), .rank td:nth-child(3),
.rank th:nth-child(4), .rank td:nth-child(4) { white-space: nowrap; }

.plaque-row { display: flex; align-items: center; gap: 12px; }
.plaque-thumb {
  width: 48px; height: 48px; border-radius: 10px; object-fit: cover;
  background: #0b1326; border: 1px solid var(--line); flex: 0 0 48px;
}
.plaque-thumb.is-empty { display: inline-block; }
.plaque-block {
  display: grid; grid-template-columns: 240px 1fr; gap: 18px; align-items: start;
  min-width: 0;
}
.plaque-frame {
  width: 240px; max-width: 100%; height: 180px;
  overflow: hidden; border-radius: 12px;
  background: #0b1326; border: 1px solid var(--line);
  display: grid; place-items: center;
}
.plaque-shot {
  display: block; width: 100%; height: 100%;
  max-width: 240px; max-height: 180px;
  object-fit: contain; object-position: center;
}
.plaque-head { min-width: 0; }
.plaque-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 12px;
}
.plaque-card { margin: 0; min-width: 0; }
.plaque-card-actions {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px;
}
.plaque-card-actions form { margin: 0; }
.dropzone {
  position: relative; display: grid; place-items: center; gap: 6px; text-align: center;
  padding: 28px 16px; margin: 0 0 12px; cursor: pointer;
  border: 1.5px dashed var(--line); border-radius: 14px; background: #0b1326;
}
.dropzone:hover { border-color: var(--violet); background: rgba(55,123,230,0.1); }
.dropzone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone strong { color: var(--text); font-size: 14px; }
.dropzone span { color: var(--muted); font-size: 12px; }
.plaque-upload { margin: 0; overflow: hidden; }
.plaque-upload img { max-width: 240px; max-height: 180px; object-fit: contain; }

.paywall {
  position: relative;
  isolation: isolate;
  min-height: 52px;
}
.paywall-blur {
  filter: blur(13px);
  user-select: none;
  pointer-events: none;
}
.paywall.is-body { margin-top: 8px; flex: 1; }
.paywall-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(7, 11, 22, 0.22);
  z-index: 2;
}
.paywall-card {
  max-width: 420px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: 0 18px 48px rgba(0,0,0,0.35);
}
.paywall-card h3 { margin: 0 0 8px; }
.paywall.is-compact { min-height: 56px; }
.paywall.is-compact .paywall-cover { background: rgba(7, 11, 22, 0.28); }
.paywall-mini {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--violet);
  border-radius: 999px;
  padding: 8px 12px;
}
.metric-blur {
  filter: blur(8px);
  user-select: none;
  pointer-events: none;
  display: inline-block;
}

.billing {
  background: #eef2f7;
  color: #111827;
  border-radius: 24px;
  padding: 22px;
  margin: 0 0 22px;
}
.billing-head {
  display: flex; justify-content: space-between; gap: 16px; align-items: flex-start;
  margin-bottom: 16px; flex-wrap: wrap;
}
.billing-filters { display: grid; gap: 8px; justify-items: end; }
.period-tools { display: grid; gap: 10px; justify-items: end; }
.period-custom { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.billing .pills { justify-content: flex-end; }
.billing .pill {
  background: #fff; color: #4b5563; border-color: #e5e7eb;
}
.billing .pill:hover, .billing .pill.is-on {
  background: #377be6; color: #fff; border-color: #377be6;
}
.billing .pill-date { color: #4b5563; }
.billing .pill-date input {
  background: #fff; color: #111827; border-color: #e5e7eb;
}
.billing .btn-primary { background: #377be6; }
.billing-kicker {
  margin: 0 0 4px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #6b7280;
}
.billing h2 { margin: 0; font-size: 1.35rem; color: #111827; }
.billing-range { margin: 0; color: #6b7280; font-size: 13px; }
.billing-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.billing-kpi {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.billing-kpi strong {
  display: block; font-size: 1.55rem; letter-spacing: -0.03em; color: #111827;
}
.billing-kpi span { display: block; color: #6b7280; font-size: 13px; margin-top: 2px; }
.billing-kpi small { display: block; color: #9ca3af; font-size: 12px; margin-top: 2px; }
.billing-icon {
  flex: 0 0 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
}
.billing-icon.is-green { background: #dcfce7; color: #166534; }
.billing-icon.is-blue { background: #dbeafe; color: #1d4ed8; }
.billing-icon.is-violet { background: #e7f0fc; color: #0b4aab; }
.sale-inline { display: flex; gap: 8px; align-items: center; margin: 0; }
.sale-inline input {
  width: 120px; margin: 0; background: #0b1326;
}

.product-picks { display: grid; gap: 10px; margin: 0 0 16px; }
label.product-pick {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b1326;
  color: var(--text);
  cursor: pointer;
  white-space: normal;
}
label.product-pick:has(input:checked) {
  border-color: rgba(55, 123, 230, 0.65);
  box-shadow: 0 0 0 1px rgba(55, 123, 230, 0.35);
}
label.product-pick input[type="checkbox"],
label.product-pick input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  padding: 0;
  flex: 0 0 18px;
  accent-color: #377be6;
  background: transparent;
  border: 0;
}
.product-picks.is-2 { grid-template-columns: 1fr 1fr; }
label.product-pick strong { display: block; font-size: 14px; font-weight: 600; color: var(--text); }
label.product-pick small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 400; }
.snippet {
  margin: 0; padding: 12px 14px; overflow: auto;
  font-size: 12px; line-height: 1.45;
  background: rgba(0,0,0,0.35); border: 1px solid var(--line);
  border-radius: 12px; white-space: pre-wrap; word-break: break-all;
}
.url-save { display: flex; gap: 10px; align-items: flex-end; margin: 0 0 16px; }
.url-save label { flex: 1; margin: 0; }
.url-save .btn { flex: 0 0 auto; }
.channel-links { display: grid; gap: 10px; }
.channel-link {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #0b1326;
  min-width: 0;
}
.channel-link-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.channel-link-top > div { min-width: 0; }
.channel-link strong { display: block; font-size: 14px; }
.channel-link small { display: block; color: var(--muted); margin: 2px 0 0; font-size: 12px; }
.channel-link .url {
  margin: 0; padding: 10px 12px;
  background: rgba(0,0,0,0.28); border-radius: 10px;
  overflow-wrap: anywhere; word-break: break-word;
}
.channel-link .btn { flex: 0 0 auto; white-space: nowrap; }
a.kpi-link { text-decoration: none; color: inherit; }
a.kpi-link.is-on { border-color: var(--violet); }
.prospect-edit {
  display: grid;
  grid-template-columns: 150px minmax(140px, 1fr) minmax(180px, 240px) auto;
  gap: 8px 10px;
  align-items: end;
}
.prospect-edit label { margin: 0; }
.prospect-client { margin: 0; min-width: 0; }
.prospect-client select { width: 100%; }
.temp-pass { margin-top: 16px; display: grid; gap: 8px; justify-items: start; }
.temp-pass .url { font-size: 18px; letter-spacing: 0.08em; padding: 10px 12px; }
.prospect-convert { margin: 16px 0; }
.prospect-convert .stat { margin: 0; }
.prospect-convert-sale { text-decoration: none; color: inherit; border-radius: 12px; }
.prospect-convert-sale.is-on .stat { color: var(--green); }
.prospect-edit select,
.prospect-edit input { padding: 8px 10px; }
.bio-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
.bio-kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.bio-kpi .stat { margin: 4px 0 6px; }
td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

@media (max-width: 900px) {
  .side { display: none; }
  .mobile-brand { display: flex; padding-top: 14px; }
  .app-shell .shell-main,
  .app-shell .side.is-rail ~ .shell-main { margin-left: 0; }
  .wrap { width: min(1120px, calc(100% - 24px)); }
  .top-inner { min-height: 56px; }
  .prospect-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .prospect-stats .kpi,
  .prospect-stats > div,
  .prospect-stats > a {
    min-height: 0;
    min-width: 0;
    padding: 12px 8px;
  }
  .prospect-stats .stat { font-size: 1.35rem; margin: 0; }
  .prospect-stats .kicker { font-size: 9px; letter-spacing: 0.04em; }
  .prospect-stats .muted { font-size: 11px; line-height: 1.25; }
  .prospect-convert { padding: 12px; }
  .lead { max-width: none; }
  .card, .channel-link, .page, .wrap { min-width: 0; max-width: 100%; }
  .channel-link .url, .url {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .table-search { max-width: none; width: 100%; flex: 1 1 100%; }
  .channel-link .form-actions { width: 100%; }
  .channel-link .form-actions .btn { flex: 1 1 auto; }
  .dock {
    display: flex;
    position: fixed;
    z-index: 40;
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    width: auto;
    max-width: none;
    gap: 4px;
    align-items: flex-end;
    justify-content: center;
    padding: 8px 8px 10px;
    border-radius: 24px;
    background: rgba(23, 23, 23, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    overflow: hidden;
  }
  .dock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: auto;
    min-width: 0;
    flex: 1 1 0;
    padding: 0 1px;
    color: #a3a3a3;
    text-decoration: none;
  }
  .dock-icon {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: #262626;
    display: grid;
    place-items: center;
    transition: transform 0.18s ease, background 0.18s ease;
  }
  .dock-icon svg { width: 18px; height: 18px; }
  .dock-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.1;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .dock-item.is-on { color: #fff; }
  .dock-item.is-on .dock-icon { background: var(--violet); }
  body { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  .support-fab { bottom: calc(100px + env(safe-area-inset-bottom)); }
}

@media (max-width: 980px) {
  .kpi-row, .peak-grid, .split-2, .split-via, .scan-hero, .plaque-gallery, .billing-kpis, .product-picks.is-2 { grid-template-columns: 1fr; }
  .plaque-frame { width: min(240px, 100%); }
}

@media (max-width: 720px) {
  .url-save, .channel-link-top, .prospect-edit { flex-direction: column; align-items: stretch; }
  .prospect-edit { grid-template-columns: 1fr; }
  .page table:not(.rank) thead { display: none; }
  .page table:not(.rank),
  .page table:not(.rank) tbody,
  .page table:not(.rank) tr,
  .page table:not(.rank) td { display: block; }
  .page table:not(.rank) td { border: 0; padding: 6px 0; }
  .page table td.tag-actions { display: flex; flex-direction: row; justify-content: flex-start; }
  .page table:not(.rank) tr { border-bottom: 1px solid var(--line); padding: 12px 0; }
}
