/* Radar Público: tema escuro "vidro", derivado do Radar de Preços. Sem fontes nem recursos externos. */
:root {
  --bg: #07070a;
  --ink: #f4f4f5;
  --ink-2: #b4b4bd;
  --ink-3: #a0a0ab;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .16);
  --glass: rgba(18, 18, 22, .66);
  --good: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }

body {
  background:
    radial-gradient(900px 500px at 70% -10%, rgba(255, 255, 255, .07), transparent 60%),
    radial-gradient(700px 400px at 0% 100%, rgba(120, 130, 170, .08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  min-height: 100vh;
  padding: 20px 16px 64px;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--line-2); }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
h1 { font-size: 24px; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; }
h2 { font-size: 17px; font-weight: 600; line-height: 1.3; }
h3 { font-size: 15px; font-weight: 600; }
p + p { margin-top: 10px; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #09090b; padding: 8px 14px; border-radius: 8px; z-index: 30; }
.skip:focus { left: 8px; }

/* ---- moldura e vidro ---- */
.shell > * { min-width: 0; }
.shell { position: relative; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.glass {
  position: relative; border-radius: 18px; padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .05) 40%, rgba(255, 255, 255, .08));
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .8);
}
.glass > .in {
  border-radius: 17px; background: var(--glass); height: 100%; padding: 20px;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.stack { display: flex; flex-direction: column; gap: 14px; }
.mono { font: 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.muted { color: var(--ink-2); font-size: 14px; }

/* ---- navegação ---- */
.nav { max-width: 760px; margin: 0 auto 20px; border-radius: 999px; }
.nav > .in {
  border-radius: 999px; display: flex; align-items: center; justify-content: space-between;
  gap: 8px 12px; padding: 8px 10px 8px 18px; flex-wrap: wrap;
}
.brand { font-weight: 600; font-size: 15px; text-decoration: none; }
.brand small { font: 11px var(--mono); color: var(--ink-3); margin-left: 8px; letter-spacing: .1em; text-transform: uppercase; }
.nav-right { display: flex; gap: 8px; align-items: center; min-width: 0; }
.nav-right .who { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--ink-2); }
.pill {
  font-size: 13px; color: var(--ink-2); padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: none; min-height: 36px;
}
.pill:hover { color: var(--ink); background: rgba(255, 255, 255, .06); }

/* ---- botões e campos ---- */
.btn {
  font-weight: 500; font-size: 14px; border-radius: 999px; padding: 10px 18px; min-height: 42px;
  border: 1px solid var(--line-2); background: none; color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
}
.btn:hover { background: rgba(255, 255, 255, .06); }
.btn.main { background: var(--ink); color: #09090b; border-color: transparent; }
.btn.main:hover { background: #fff; }
.btn.danger { color: var(--bad); border-color: rgba(248, 113, 113, .4); }
.btn.danger:hover { background: rgba(248, 113, 113, .08); }
.btn.small { padding: 6px 14px; min-height: 34px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: default; }

.field-label { display: block; font-size: 14px; color: var(--ink-2); }
.field {
  margin-top: 6px; display: block; width: 100%; background: rgba(255, 255, 255, .04); border: 1px solid var(--line-2);
  border-radius: 12px; padding: 11px 14px; font-size: 16px; /* 16px evita o zoom automático no iOS */ min-height: 44px;
}
.field:focus { border-color: var(--ink-2); }
.field::placeholder { color: var(--ink-3); }
.hint { display: block; margin-top: 6px; font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: #f4f4f5; }
.error { color: var(--bad); font-size: 14px; }
.error:empty { display: none; }
.retry { align-self: flex-start; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px;
  border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .03);
}
.seg button { font-weight: 500; font-size: 14px; color: var(--ink-2); background: none; border: 1px solid transparent; border-radius: 10px; padding: 10px; min-height: 44px; }
.seg button[aria-pressed="true"] { color: var(--ink); background: rgba(255, 255, 255, .08); border-color: var(--line-2); }

/* ---- página inicial ---- */
.hero { padding: 4px 4px 0; }
.hero p { color: var(--ink-2); margin-top: 10px; max-width: 56ch; }
.login-card { max-width: 440px; width: 100%; margin: 0 auto; }
.foot { text-align: center; font-size: 13px; color: var(--ink-3); }

/* ---- Telegram ---- */
.status {
  font-size: 13px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.status.good::before { background: var(--good); }
.status.warn::before { background: var(--warn); }
.status.bad::before { background: var(--bad); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.callout { border: 1px dashed rgba(251, 191, 36, .45); border-radius: 12px; background: rgba(251, 191, 36, .06); padding: 10px 14px; font-size: 14px; color: var(--ink-2); }
.callout b { color: var(--warn); font-weight: 600; }

/* ---- adicionar e lista ---- */
.add-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.items { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.item { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: rgba(255, 255, 255, .02); }
.item-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.name { font-size: 16px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; min-width: 0; flex: 1 1 200px; }
.badge {
  font: 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; margin-right: 6px; vertical-align: middle;
}
.price { font-size: 28px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.price.none { font-size: 17px; font-weight: 500; color: var(--ink-3); }
.price small { font-size: 13px; font-weight: 400; color: var(--ink-3); margin-left: 6px; letter-spacing: 0; }
.meta-line { font-size: 13px; color: var(--ink-3); overflow-wrap: anywhere; }
.target-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.target-form .field-label { flex: 1 1 160px; }
.item-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.empty { text-align: center; color: var(--ink-2); padding: 28px 8px; }

/* ---- conta ---- */
details { border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; }
summary { padding: 12px 0; font-weight: 500; font-size: 14px; }
details[open] { padding-bottom: 14px; }
details[open] summary { margin-bottom: 4px; }
.danger-zone { border-color: rgba(248, 113, 113, .35); }

/* ---- aviso (toast) ---- */
#toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; flex-direction: column; gap: 8px; align-items: center; width: calc(100% - 32px); max-width: 420px; pointer-events: none; }
.toast {
  background: rgba(24, 24, 28, .96); border: 1px solid var(--line-2); border-radius: 14px;
  padding: 10px 16px; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .6); text-align: center;
}
.toast.bad { border-color: rgba(248, 113, 113, .55); }

/* ---- texto corrido (privacidade) ---- */
.prose h2 { margin-top: 22px; margin-bottom: 8px; }
.prose ul { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.prose p, .prose li { color: var(--ink-2); font-size: 15px; }
.prose strong { color: var(--ink); font-weight: 600; }
.review { border: 1px solid rgba(251, 191, 36, .5); border-radius: 12px; background: rgba(251, 191, 36, .08); padding: 12px 14px; color: var(--ink); font-size: 14px; }
.review strong { color: var(--warn); }

/* ---- painel do dono (tabela de convites e métricas em JSON) ---- */
.table-wrap { overflow-x: auto; min-width: 0; max-width: 100%; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font: 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 400; }
.tbl th, .tbl td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.tbl td.code { font-family: var(--mono); user-select: all; }
.json { font: 13px/1.5 var(--mono); color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.count-field { width: 90px; }

@media (min-width: 640px) {
  body { padding: 28px 24px 80px; }
  h1 { font-size: 30px; }
  .glass > .in { padding: 24px; }
  .add-grid { grid-template-columns: 1fr 220px auto; align-items: end; }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, .pill { transition: background-color .15s, color .15s; }
}
