/* =====================================================================
   Entre Nós Design System — Componentes (Guia de Marca V2)
   Cada bloco é um componente documentado em /design-system.
   Usa só tokens semânticos de tokens.css.
   ===================================================================== */

/* ---------- Topbar (header) ----------
   Cabeçalho ameixa com a assinatura original em marfim (Guia de Marca V2). */
.topbar, .site-header { background: var(--color-surface-brand); color: var(--color-text-on-brand); border-bottom: 1px solid var(--color-surface-brand-soft); }
.topbar { position: sticky; top: 0; z-index: var(--z-header); }
.topbar-inner {
  max-width: var(--container-max); margin: 0 auto; padding: 0 var(--gutter);
  height: var(--header-height); display: flex; align-items: center; gap: var(--space-5);
}
.brand { display: inline-flex; align-items: center; flex: none; min-width: 0; text-decoration: none; color: inherit; margin-right: auto; padding: var(--space-2) 0; line-height: 1; }
.brand-logo { display: block; height: var(--logo-height); width: auto; max-width: 252px; object-fit: contain; }
.brand-symbol { display: block; height: var(--logo-height); width: auto; }
.nav { display: flex; align-items: stretch; gap: var(--space-2); height: 100%; }
.nav a {
  display: flex; align-items: center; gap: var(--space-2); padding: 0 var(--space-3); position: relative;
  text-decoration: none; font-size: var(--text-md); color: var(--color-text-on-brand-muted);
  transition: color var(--duration-fast);
}
.nav a svg { width: 17px; height: 17px; }
.nav a:hover { color: var(--color-text-on-brand); }
.nav a.active { color: var(--color-text-on-brand); font-weight: var(--weight-bold); }
.nav a.active::after { content: ""; position: absolute; left: var(--space-3); right: var(--space-3); bottom: 0; height: 3px; border-radius: 2px 2px 0 0; background: var(--color-accent); }
.btn-invite {
  display: inline-flex; align-items: center; min-height: 42px; background: var(--color-accent); color: var(--color-text-strong); border: 0; border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4); font-weight: var(--weight-bold); font-size: var(--text-md); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--duration-fast);
}
.btn-invite:hover { background: var(--color-accent-hover); }
.top-avatar { width: 40px; height: 40px; border-radius: var(--radius-full); border: 1px solid var(--color-accent); background: var(--color-surface-brand-soft); overflow: hidden; flex: none; }
.top-bell {
  position: relative; display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: var(--radius-full);
  border: 1px solid #E4B1BE99; color: var(--color-text-on-brand); text-decoration: none;
  transition: background var(--duration-fast), border-color var(--duration-fast);
}
.top-bell svg { width: 20px; height: 20px; }
.top-bell:hover, .top-bell.active { background: var(--color-surface-brand-soft); border-color: var(--color-accent); }
.bell-badge {
  position: absolute; top: -5px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: var(--radius-full);
  display: grid; place-items: center; background: var(--color-accent); color: var(--color-text-strong);
  border: 2px solid var(--color-surface-brand); font-size: var(--text-2xs); font-weight: var(--weight-bold); line-height: 1; font-variant-numeric: tabular-nums;
}
.bell-badge[hidden] { display: none; }
.btn-out {
  display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 54px; min-height: 42px;
  background: transparent; border: 1px solid #E4B1BE99; color: var(--color-text-on-brand); border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3); font-weight: var(--weight-bold); font-size: var(--text-md); cursor: pointer;
  transition: background var(--duration-fast), border-color var(--duration-fast);
}
.btn-out:hover { background: var(--color-surface-brand-soft); border-color: var(--color-accent); }
.topbar :focus-visible, .site-header :focus-visible, .bottomnav :focus-visible { box-shadow: 0 0 0 3px var(--color-accent); }
/* Barra de navegação do celular (aparece até 760px) */
.bottomnav { display: none; }

/* ---------- Layout ---------- */
main { flex: 1; width: 100%; }
.wrap { max-width: var(--container-max); margin: 0 auto; padding: var(--space-6) var(--gutter) var(--space-12); }
.narrow { max-width: var(--container-narrow); }
.back { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--text-sm); font-weight: var(--weight-bold); text-decoration: none; margin: var(--space-2) 0 var(--space-5); min-height: 32px; }
.back svg { width: 14px; height: 14px; }
.page-title { font-size: var(--text-title); font-weight: var(--weight-bold); line-height: var(--leading-tight); margin: var(--space-1) 0 var(--space-2); letter-spacing: -.02em; }
.page-sub { color: var(--color-text-muted); margin: 0 0 var(--space-6); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); flex-wrap: wrap; }
.section-head h2 { font-size: var(--text-xl); letter-spacing: -.015em; }

/* ---------- Card ---------- */
.card {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md); padding: var(--space-6);
}
.card + .card { margin-top: var(--space-4); }
.promo > .card, .clients > .card, .grid-2 > .card, .lp-grid-3 > .card { margin-top: 0; }
.card h2 { font-size: var(--text-lg); margin: 0 0 6px; }
.card--gradient { background: var(--gradient-card); }
.card--points { background: var(--gradient-points); border-color: #D3BDCF; }
.card--invite { background: var(--gradient-invite); border-color: #D3BDCF; }

/* ---------- Button ----------
   Primário: ameixa com texto marfim. Secundário (padrão): contorno ameixa. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 46px; border-radius: var(--radius-md); padding: 10px 19px;
  font-weight: var(--weight-bold); font-size: var(--text-md); cursor: pointer; white-space: nowrap; text-decoration: none;
  border: 1px solid var(--color-surface-brand); background: transparent; color: var(--color-text-strong);
  transition: background var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast);
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { background: var(--color-surface-subtle); }
.btn.primary { background: var(--color-surface-brand); color: var(--color-text-on-brand); box-shadow: var(--shadow-sm); }
.btn.primary:hover { background: var(--color-surface-brand-hover); }
.btn.accent { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-text-strong); }
.btn.accent:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--color-surface-subtle); }
.btn.danger { border-color: var(--color-negative-text); color: var(--color-negative-text); }
.btn.danger:hover { background: var(--color-negative-bg); }
.btn.sm { min-height: 36px; padding: 6px var(--space-3); font-size: var(--text-sm); border-radius: var(--radius-sm); }
.btn.lg { min-height: 54px; padding: var(--space-3) var(--space-6); font-size: var(--text-base); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .65; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; font-weight: var(--weight-bold); color: var(--color-text-strong); font-size: var(--text-sm); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Form: label, input, textarea ---------- */
label.field, .field { display: block; font-weight: var(--weight-bold); font-size: var(--text-md); color: var(--color-text-strong); margin-bottom: 6px; }
.input {
  width: 100%; min-height: 47px; border: 1px solid var(--color-border-strong); background: var(--color-surface-raised);
  border-radius: var(--radius-md); padding: 12px 14px; font-size: var(--text-base); color: var(--color-text); outline: none;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.input::placeholder { color: #8C7785; }
.input:focus { border-color: var(--color-border-focus); box-shadow: var(--focus-ring); }
.input[aria-invalid="true"] { border-color: var(--color-negative-text); }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--color-text-muted); }
.input-icon .input { padding-left: 40px; }
.hint { font-size: var(--text-sm); line-height: 1.45; color: var(--color-text-muted); margin-top: 6px; }

/* Checkbox em cartão */
.check {
  display: flex; align-items: center; gap: var(--space-2); background: var(--color-surface-raised); border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm); padding: 10px var(--space-3); margin-bottom: var(--space-2); font-size: var(--text-sm); cursor: pointer;
  min-height: 46px;
}
.check input { accent-color: var(--color-surface-brand); margin: 0; width: 16px; height: 16px; flex: none; }
.check svg { width: 14px; height: 14px; flex: none; }
.check:has(input:checked) { border-color: var(--color-surface-brand); background: var(--color-surface-subtle); box-shadow: inset 0 0 0 1px var(--color-surface-brand); font-weight: var(--weight-bold); }
fieldset.tags.pos .check input { accent-color: var(--color-positive-text); }
fieldset.tags.neg .check input { accent-color: var(--color-negative-text); }
fieldset.tags.pos .check:has(input:checked) { border-color: var(--color-positive-text); background: var(--color-positive-bg); color: var(--color-positive-text); box-shadow: inset 0 0 0 1px var(--color-positive-text); }
fieldset.tags.neg .check:has(input:checked) { border-color: var(--color-negative-text); background: var(--color-negative-bg); color: var(--color-negative-text); box-shadow: inset 0 0 0 1px var(--color-negative-text); }
.check--plain { border: 0; padding: 0; background: none; min-height: 0; align-items: flex-start; }
.check--plain:has(input:checked) { box-shadow: none; background: none; font-weight: inherit; }

/* Grupo de marcações (fieldset) */
fieldset.tags { border: 1px solid; border-radius: var(--radius-lg); padding: var(--space-4) var(--space-4) var(--space-2); margin: 0; min-width: 0; background: var(--color-surface); }
fieldset.tags legend { display: flex; align-items: center; gap: 7px; font-weight: var(--weight-bold); font-size: var(--text-md); padding: 0 6px; flex-wrap: wrap; }
fieldset.tags legend svg { width: 15px; height: 15px; }
fieldset.tags legend small { font-weight: var(--weight-regular); color: var(--color-text-muted); font-size: var(--text-2xs); }
fieldset.tags.pos { border-color: var(--color-positive-border); }
fieldset.tags.neg { border-color: var(--color-negative-border); }
fieldset.tags.pos legend { color: var(--color-positive-text); }
fieldset.tags.neg legend { color: var(--color-negative-text); }

/* Nota 0–5 */
.rating-row { display: flex; gap: 6px; flex-wrap: wrap; }
.rate-btn {
  width: 46px; height: 46px; border-radius: var(--radius-md); border: 1px solid var(--color-border-strong); background: var(--color-surface-raised);
  display: grid; place-items: center; cursor: pointer; color: var(--color-text-strong); font-size: var(--text-md);
}
.rate-btn svg { width: 18px; height: 18px; }
.rate-btn.on { background: var(--color-surface-brand); color: var(--color-text-on-brand); border-color: var(--color-surface-brand); }
.rate-btn.on svg { fill: currentColor; }

/* ---------- Feedback: alertas, aviso, toast ---------- */
.alert, .error-msg, .ok-msg { border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); font-size: var(--text-sm); margin: var(--space-2) 0; }
.error-msg, .alert--negative { background: var(--color-negative-bg); color: var(--color-negative-text); }
.error-msg { border: 1px solid var(--color-negative-border); font-weight: var(--weight-bold); scroll-margin: var(--space-6); }
.error-msg:focus { outline: none; }
.input.is-invalid { border-color: var(--color-negative-text); box-shadow: 0 0 0 3px var(--color-negative-bg); }
.check.is-invalid { color: var(--color-negative-text); }
.check.is-invalid input { outline: 2px solid var(--color-negative-text); outline-offset: 2px; }
.rating-row.is-invalid { outline: 2px solid var(--color-negative-text); outline-offset: 4px; border-radius: var(--radius-md); }
.ok-msg, .alert--positive { background: var(--color-positive-bg); color: var(--color-positive-text); }
.alert--warning { background: var(--color-warning-bg); color: var(--color-warning-text); }
.notice { background: var(--color-highlight-bg); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); font-size: var(--text-sm); display: flex; gap: var(--space-2); align-items: center; }
.notice svg { width: 14px; height: 14px; flex: none; }
.toast {
  position: fixed; left: 50%; bottom: var(--space-6); transform: translateX(-50%); z-index: var(--z-toast);
  background: var(--color-text-strong); color: var(--color-text-on-brand); padding: 10px 18px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); font-size: var(--text-sm); max-width: calc(100vw - 32px);
}
.loading { padding: var(--space-10); text-align: center; color: var(--color-text-muted); }
.empty { text-align: center; padding: var(--space-8) var(--space-3); color: var(--color-text-muted); }

/* ---------- Pill, badge, chip ---------- */
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: var(--text-sm); font-weight: var(--weight-bold); letter-spacing: .015em; color: var(--color-text-strong); padding: 5px 11px 5px 9px; border-radius: var(--radius-full); background: var(--color-highlight-bg); border: 1px solid var(--rose-200); }
.pill svg { width: 14px; height: 14px; }
.badge { display: inline-block; background: var(--color-surface-brand); color: var(--color-text-on-brand); font-size: var(--text-2xs); font-weight: var(--weight-bold); padding: 1px 7px; border-radius: var(--radius-full); }
.unread { background: var(--color-surface-brand); color: var(--color-text-on-brand); border-radius: var(--radius-full); font-size: var(--text-2xs); padding: 1px 7px; font-weight: var(--weight-bold); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--space-3) 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); padding: 4px 10px; border-radius: var(--radius-sm); line-height: 1.35; }
.chip.pos { background: var(--color-positive-bg); color: var(--color-positive-text); }
.chip.neg { background: var(--color-negative-bg); color: var(--color-negative-text); }
.kicker { display: flex; align-items: center; gap: 7px; font-size: var(--text-sm); font-weight: var(--weight-bold); letter-spacing: .015em; color: var(--color-text-strong); }
.kicker svg { width: 13px; height: 13px; }

/* ---------- Avatar e ícone em bloco ---------- */
.avatar { width: 64px; height: 64px; border-radius: var(--radius-full); overflow: hidden; flex: none; border: 1px solid var(--color-accent); background: var(--color-support); }
.avatar img, .top-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar--sm { width: 36px; height: 36px; }
.avatar--md { width: 40px; height: 40px; }
.icon-tile { width: 54px; height: 54px; border-radius: 17px; display: grid; place-items: center; background: var(--color-support); color: var(--color-surface-brand); flex: none; }
.icon-tile svg { width: 24px; height: 24px; }
/* Grade única e contínua de avatares: 5 colunas, 3 em telas estreitas */
.avatar-pick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; max-width: 420px; }
.avatar-pick button { padding: 3px; border: 2px solid transparent; border-radius: var(--radius-full); background: none; cursor: pointer; aspect-ratio: 1; }
.avatar-pick button:hover { border-color: var(--color-accent); }
.avatar-pick button.on { border-color: var(--color-surface-brand); box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-surface-brand); }
.avatar-pick .avatar { width: 100%; height: 100%; border: 0; }

/* ---------- Hero ----------
   A arte (comunidade + assinatura) é a imagem de fundo; a busca fica em HTML. */
.hero {
  isolation: isolate; position: relative; overflow: hidden; border-radius: var(--radius-2xl); padding: 42px 44px 40px;
  background: var(--brand-ivory) url('/brand/hero-v4.webp') center / cover no-repeat;
  border: 1px solid #DFC0CD; box-shadow: var(--shadow-lg), inset 0 1px 0 var(--color-surface);
  min-height: 360px; display: flex;
}
.hero::after { content: ""; position: absolute; inset: 8px; z-index: 0; border: 1px solid #FFFDFA88; border-radius: 17px; pointer-events: none; }
.hero-text { position: relative; z-index: 2; width: 52%; max-width: 540px; }
.hero h1 { font-size: var(--text-display); font-weight: var(--weight-bold); letter-spacing: -.025em; margin: var(--space-4) 0 var(--space-2); line-height: 1.08; }
.hero p { margin: 0 0 var(--space-5); color: var(--color-text-muted); max-width: 460px; font-size: var(--text-base); line-height: 1.55; }
.search-row { display: flex; gap: var(--space-2); }
.search-row > .input-icon, .search-row > .input { flex: 1; }
.promo { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--space-4); margin-top: var(--space-4); }
.promo h3 { font-size: var(--text-lg); margin: var(--space-2) 0 var(--space-1); }
.promo p { font-size: var(--text-md); color: var(--color-text-muted); margin: 0 0 var(--space-3); }

/* ---------- Client card (número avaliado) ---------- */
.clients { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); align-items: start; }
.client { background: var(--color-surface-accent); border: 1px solid var(--color-border-accent); border-radius: var(--radius-lg); padding: 18px; min-width: 0; }
.client-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding-bottom: var(--space-3); border-bottom: 1px solid var(--color-border); flex-wrap: wrap; }
.client-phone { font-size: clamp(1.375rem, 1rem + 1.6vw, 1.75rem); line-height: 1.2; color: var(--color-text); text-decoration: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
.client-phone:hover { text-decoration: underline; text-underline-offset: 4px; }
.score { display: inline-flex; align-items: baseline; gap: 7px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--color-positive-bg); color: var(--color-positive-text); font-size: var(--text-2xl); line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }
.score svg { width: 24px; height: 24px; align-self: center; fill: currentColor; fill-opacity: .16; }
.score small { font-size: var(--text-sm); }
.score.mid { background: var(--color-warning-bg); color: var(--color-warning-text); }
.score.low { background: var(--color-negative-bg); color: var(--color-negative-text); }
.client-meta { display: flex; align-items: baseline; justify-content: space-between; padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); }
.client-meta b { font-size: var(--text-xl); font-weight: var(--weight-medium); margin-right: 6px; }
.client-meta .cmt { display: flex; align-items: center; gap: var(--space-1); font-size: var(--text-sm); color: var(--color-text-muted); text-decoration: none; }
.client-meta .cmt svg { width: 14px; height: 14px; }
.fict { font-size: var(--text-xs); color: var(--color-text-muted); margin: var(--space-2) 0; }
.marks { border: 2px solid transparent; border-radius: var(--radius-lg); padding: 2px; }
.marks.open { border-color: var(--color-surface-brand); }
.marks-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.mark-box { display: flex; align-items: flex-start; gap: var(--space-2); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); }
.mark-box svg { width: 18px; height: 18px; margin-top: 6px; flex: none; }
.mark-box b { display: block; font-size: var(--text-2xl); font-weight: var(--weight-regular); line-height: 1; font-variant-numeric: tabular-nums; }
.mark-box span { font-size: var(--text-sm); }
.mark-box.pos { background: var(--color-positive-bg); border: 1px solid var(--color-positive-border); color: var(--color-positive-text); }
.mark-box.neg { background: var(--color-negative-bg); border: 1px solid var(--color-negative-border); color: var(--color-negative-text); }
.marks-toggle { width: 100%; display: flex; justify-content: space-between; align-items: center; background: none; border: 0; padding: var(--space-3) 2px var(--space-1); font-weight: var(--weight-bold); font-size: var(--text-sm); color: var(--color-text-strong); cursor: pointer; min-height: 40px; }
.marks-toggle:hover { text-decoration: underline; text-underline-offset: 3px; }
.marks-toggle svg { width: 16px; height: 16px; }
.tag-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); margin-top: var(--space-3); }
.tag-cols h4 { margin: 0 0 var(--space-2); display: flex; align-items: center; gap: 6px; font-size: var(--text-md); }
.tag-cols h4 svg { width: 15px; height: 15px; }
.tag-item { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); margin-bottom: var(--space-2); }
.tag-item svg { width: 14px; height: 14px; flex: none; }
.tag-item .n { margin-left: auto; background: var(--color-surface-raised); border-radius: 5px; min-width: 22px; text-align: center; font-size: var(--text-xs); font-weight: var(--weight-bold); padding: 1px 5px; }
.tag-item.pos { background: var(--color-positive-bg); border: 1px solid var(--color-positive-border); }
.tag-item.neg { background: var(--color-negative-bg-subtle); border: 1px solid var(--color-negative-border); }
.sort { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); color: var(--color-text-muted); }
.sort select { border: 0; background: transparent; font-weight: var(--weight-bold); color: var(--color-text-strong); cursor: pointer; min-height: 32px; }

/* ---------- Review (relato) ---------- */
.review { border-top: 1px solid var(--color-border); padding: var(--space-4) 0; }
.review:first-child { border-top: 0; }
.review-head { display: flex; align-items: center; gap: var(--space-2); }
.stars { display: inline-flex; gap: 2px; color: var(--color-surface-brand); }
.stars svg { width: 14px; height: 14px; }
.reactions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.react { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--color-border); background: var(--color-surface-raised); border-radius: var(--radius-full); padding: 6px var(--space-3); font-size: var(--text-sm); cursor: pointer; min-height: 32px; }
.react svg { width: 14px; height: 14px; }
.react.on { background: var(--color-surface-brand); border-color: var(--color-surface-brand); color: var(--color-text-on-brand); }
.react:disabled { cursor: default; opacity: .7; }
/* Comentários de um relato */
.comments { margin-top: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--color-surface-subtle); border: 1px solid var(--rose-200); border-radius: var(--radius-lg); }
.comment-form { display: flex; gap: var(--space-2); align-items: flex-end; }
.comment-form .input { flex: 1; min-height: 46px; resize: vertical; }
.comment-form .btn { min-height: 46px; }
.comment-list { margin-top: var(--space-2); }
.comment { display: flex; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--rose-200); }
.comment-body { flex: 1; min-width: 0; font-size: var(--text-sm); }
.comment-body p { margin: var(--space-1) 0; font-size: var(--text-md); white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-actions { display: flex; gap: var(--space-4); }
.comment-more { margin-top: var(--space-2); }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); border-top: 1px solid var(--color-border); padding-top: var(--space-4); margin-top: var(--space-4); flex-wrap: wrap; }

/* ---------- Pontos ---------- */
.points-big { font-size: 2.375rem; line-height: 1.2; font-weight: var(--weight-regular); color: var(--color-text-strong); font-variant-numeric: tabular-nums; }
.pts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); margin: var(--space-3) 0; }
.pts { background: var(--color-surface-accent); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); font-size: var(--text-sm); }
.pts b { display: block; font-size: var(--text-xl); font-weight: var(--weight-medium); }
.pts b small { font-size: var(--text-2xs); font-weight: var(--weight-regular); }
details summary { cursor: pointer; font-weight: var(--weight-bold); font-size: var(--text-sm); min-height: 28px; }
.rules { font-size: var(--text-sm); color: var(--color-text-muted); padding-left: var(--space-5); }
.rules li { margin: var(--space-1) 0; }
.plus100 { background: var(--color-surface-brand); color: var(--color-text-on-brand); border-radius: var(--radius-lg); padding: 6px 10px; text-align: center; font-size: var(--text-lg); font-weight: var(--weight-bold); line-height: 1; flex: none; }
.plus100 small { display: block; font-size: 10px; font-weight: var(--weight-regular); }
.invite-link { display: flex; gap: var(--space-2); margin-top: var(--space-2); }
.invite-link .input { font-size: var(--text-sm); }
.list-line { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) 0; border-top: 1px solid var(--color-border); font-size: var(--text-sm); flex-wrap: wrap; min-height: var(--touch-target); }
.list-line:first-child { border-top: 0; }

/* ---------- Ranking ---------- */
.rank-item { padding: var(--space-3); border-radius: var(--radius-lg); }
.rank-item + .rank-item { border-top: 1px solid var(--color-border); border-radius: 0; }
.rank-item.me { background: var(--color-surface-accent); border: 1px solid var(--color-border-accent); border-radius: var(--radius-lg); }
.rank-pos { width: 30px; font-size: var(--text-lg); flex: none; }
.rank-pts { text-align: right; font-size: var(--text-xl); line-height: 1; }
.rank-pts small { display: block; font-size: var(--text-2xs); color: var(--color-text-muted); }
.breakdown { display: grid; grid-template-columns: 1fr 1fr; gap: 6px var(--space-6); font-size: var(--text-sm); margin-top: var(--space-2); }
.breakdown div { display: flex; justify-content: space-between; }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; height: min(70vh, 640px); height: min(70dvh, 640px); padding: 0; overflow: hidden; }
.chat-head { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-border); }
.chat-body { flex: 1; overflow-y: auto; padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); background: var(--color-surface-subtle); }
.msg { max-width: 75%; padding: var(--space-2) var(--space-3); border-radius: var(--radius-lg); background: var(--color-surface-raised); border: 1px solid var(--color-border); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.mine { align-self: flex-end; background: var(--color-surface-brand); color: var(--color-text-on-brand); border-color: var(--color-surface-brand); }
.msg time { display: block; font-size: 10px; opacity: .65; margin-top: 2px; }
.chat-form { display: flex; gap: var(--space-2); padding: var(--space-3); border-top: 1px solid var(--color-border); }

/* ---------- Auth ---------- */
.auth { max-width: var(--container-auth); margin: var(--space-10) auto; }
.brand-big { display: flex; justify-content: center; }
.brand-big .brand-logo { height: 64px; max-width: 100%; }
.tagline { text-align: center; font-style: italic; color: var(--color-text-strong); margin: var(--space-2) 0 var(--space-6); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--color-border); color: var(--color-text-muted); }
.footer-inner { max-width: var(--container-max); margin: 0 auto; padding: var(--space-3) var(--gutter); min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); font-size: var(--text-sm); flex-wrap: wrap; }
.footer .brand { margin: 0; padding: 7px 0; }
.footer .brand-logo { height: 25px; max-width: 170px; }
.footer em { font-size: var(--text-md); color: var(--color-text-strong); }
.footer nav { display: flex; gap: var(--space-4); flex-wrap: wrap; }
.footer a { font-weight: var(--weight-bold); text-decoration: none; color: var(--color-text-strong); }
.footer nav a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Admin: abas ---------- */
.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--color-border); margin: 0 0 var(--space-5); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  display: inline-flex; align-items: center; gap: 6px; padding: var(--space-2) var(--space-3); min-height: var(--touch-target);
  text-decoration: none; font-size: var(--text-md); font-weight: var(--weight-bold); color: var(--color-text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs a svg { width: 15px; height: 15px; }
.tabs a:hover { color: var(--color-text-strong); }
.tabs a.active { color: var(--color-text-strong); border-bottom-color: var(--color-surface-brand); }

/* ---------- Admin: indicadores (stat tiles) ---------- */
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--space-3); }
.stats--queue { grid-template-columns: repeat(3, 1fr); margin-top: var(--space-3); }
.stat {
  display: block; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4); text-decoration: none; min-width: 0; box-shadow: var(--shadow-sm);
}
a.stat:hover { border-color: var(--color-border-strong); }
.stat-label { display: flex; align-items: center; gap: 6px; font-size: var(--text-sm); color: var(--color-text-muted); }
.stat-label svg { width: 14px; height: 14px; flex: none; }
.stat-value { font-size: var(--text-2xl); font-weight: var(--weight-medium); line-height: 1.15; color: var(--color-text-strong); font-variant-numeric: tabular-nums; }
.stat-sub { font-size: var(--text-xs); color: var(--color-text-muted); }
.stat.pos { background: var(--color-positive-bg); border-color: var(--color-positive-border); }
.stat.warn { background: var(--color-warning-bg); border-color: var(--color-warning-border); }
.stat.neg { background: var(--color-negative-bg); border-color: var(--color-negative-border); }
.stat.pos .stat-label, .stat.pos .stat-sub { color: var(--color-positive-text); }
.stat.warn .stat-label, .stat.warn .stat-sub { color: var(--color-warning-text); }
.stat.neg .stat-label, .stat.neg .stat-sub { color: var(--color-negative-text); }

/* ---------- Admin: gráficos ---------- */
.chart { position: relative; margin-top: var(--space-3); }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--color-border); stroke-width: 1; }
.chart .axis { font-size: 11px; fill: var(--color-text-muted); font-family: var(--font-sans); }
.chart .bar { fill: var(--plum-600); transition: fill var(--duration-fast); }
.chart .hit { fill: transparent; }
.chart .col:hover .bar { fill: var(--plum-800); }
.chart-tip {
  position: absolute; transform: translateX(-50%); pointer-events: none; z-index: var(--z-dropdown); white-space: nowrap;
  background: var(--color-text-strong); color: var(--color-text-on-brand); font-size: var(--text-xs);
  padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.chart-table { margin-top: var(--space-2); }
.chart-table table { border-collapse: collapse; font-size: var(--text-sm); margin-top: var(--space-2); }
.chart-table th, .chart-table td { text-align: left; padding: var(--space-1) var(--space-4) var(--space-1) 0; border-bottom: 1px solid var(--color-border); font-variant-numeric: tabular-nums; }
.hbars { display: grid; gap: var(--space-2); }
.hbar { display: grid; grid-template-columns: minmax(120px, 38%) 1fr auto; align-items: center; gap: var(--space-3); font-size: var(--text-sm); min-height: 24px; }
.hbar-label { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hbar-label svg { width: 14px; height: 14px; flex: none; color: var(--color-text-muted); }
.hbar-track { height: 12px; border-radius: var(--radius-sm); background: var(--color-surface-subtle); overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--plum-600); min-width: 0; }
.hbar-fill.pos { background: var(--green-700); }
.hbar-fill.neg { background: var(--red-700); }
.hbar-value { font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }

/* ---------- Admin: tabela e linhas ---------- */
.table-wrap { overflow-x: auto; margin-top: var(--space-3); }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table th { text-align: left; font-size: var(--text-xs); color: var(--color-text-muted); font-weight: var(--weight-bold); padding: var(--space-2) var(--space-3) var(--space-2) 0; border-bottom: 1px solid var(--color-border-strong); white-space: nowrap; }
.table td { padding: var(--space-2) var(--space-3) var(--space-2) 0; border-bottom: 1px solid var(--color-border); vertical-align: top; }
.table td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.chip.warn { background: var(--color-warning-bg); color: var(--color-warning-text); }
.user-line { align-items: flex-start; padding: var(--space-3) 0; gap: var(--space-3); }
.user-out:empty { display: none; }

/* ---------- Central de notificações ----------
   Lista de avisos (curtida, validação, comentário, mensagem). Cada linha é um link. */
.notif-group { font-size: var(--text-md); display: flex; align-items: center; gap: var(--space-2); margin: var(--space-6) 0 var(--space-2); color: var(--color-text-muted); letter-spacing: 0; }
.notif-group:first-child { margin-top: 0; }
.notif-list { display: flex; flex-direction: column; margin: 0 calc(-1 * var(--space-3)); }
.notif {
  display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3); min-height: 64px; border-radius: var(--radius-lg);
  text-decoration: none; color: var(--color-text); transition: background var(--duration-fast);
}
.notif + .notif { margin-top: 2px; }
.notif:hover { background: var(--color-surface-subtle); }
.notif.is-new { background: var(--color-surface-accent); }
.notif.is-new:hover { background: var(--color-support); }
.notif-avatar { position: relative; flex: none; }
.notif-avatar .avatar { display: block; }
.notif-kind {
  position: absolute; right: -5px; bottom: -5px; width: 22px; height: 22px; border-radius: var(--radius-full); display: grid; place-items: center;
  background: var(--color-surface-brand); color: var(--color-text-on-brand); border: 2px solid var(--color-surface);
}
.notif.is-new .notif-kind { border-color: var(--color-surface-accent); }
.notif-kind svg { width: 11px; height: 11px; stroke-width: 2.4; }
.notif-kind--like { background: var(--color-accent); color: var(--color-text-strong); }
.notif-kind--validate { background: var(--color-positive-text); }
.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; line-height: var(--leading-snug); }
.notif-excerpt { color: var(--color-text-muted); font-size: var(--text-sm); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.notif-dot { flex: none; width: 10px; height: 10px; margin-top: 7px; border-radius: var(--radius-full); background: var(--color-surface-brand); }
/* Relato aberto a partir de uma notificação */
.review.is-focus { scroll-margin-top: calc(var(--header-height) + var(--space-4)); background: var(--color-surface-accent); border-top-color: transparent; border-radius: var(--radius-lg); margin: 0 calc(-1 * var(--space-3)); padding-left: var(--space-3); padding-right: var(--space-3); }
.review.is-focus + .review { border-top-color: transparent; }

/* ---------- Responsivo ---------- */
@media (max-width: 860px) {
  .clients, .promo { grid-template-columns: 1fr; }
  .hero { padding: 30px; min-height: 320px; background-size: 100% auto; background-position: right bottom; }
  .pts-grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1100px) {
  /* Cabeçalho compacto: o convite continua em Meu perfil */
  .topbar .btn-invite { display: none; }
  .topbar .topbar-inner { gap: var(--space-3); }
}
@media (max-width: 960px) {
  /* Navegação principal desce para a barra fixa de baixo */
  .topbar .nav { display: none; }
  .top-avatar { width: 36px; height: 36px; }
  .top-bell { width: 40px; height: 40px; }
  /* Com o sino, a assinatura cede espaço em telas estreitas em vez de empurrar o "Sair" para fora */
  .topbar .brand { flex: 0 1 auto; }
  .topbar .brand-logo { max-width: 100%; }
  body:has(.bottomnav) { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .bottomnav {
    display: flex; position: fixed; z-index: var(--z-header); bottom: 0; left: 0; right: 0; justify-content: space-around;
    background: var(--color-surface-brand); border-top: 1px solid var(--color-surface-brand-soft);
    padding: 4px var(--space-3) calc(4px + env(safe-area-inset-bottom));
  }
  .bottomnav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; flex: 1; min-height: 53px;
    font-size: var(--text-xs); color: var(--color-text-on-brand-muted); text-decoration: none;
  }
  .bottomnav a svg { width: 20px; height: 20px; }
  .bottomnav a.active { color: var(--color-text-on-brand); font-weight: var(--weight-bold); }
  .bottomnav a.active svg { background: var(--color-accent); color: var(--color-text-strong); border-radius: var(--radius-lg); box-sizing: content-box; padding: 3px 13px; margin: -3px -13px; }
}
@media (max-width: 760px) {
  .topbar-inner { gap: var(--space-3); }
  .search-row { flex-direction: column; }
  .search-row .btn { width: 100%; }
  .breakdown, .tag-cols { grid-template-columns: 1fr; }
  .hero { min-height: 0; border-radius: var(--radius-xl); padding: 21px 19px 160px; background-size: auto 145px; background-position: right bottom; }
  .hero-text { width: 100%; max-width: none; }
  .hero p { font-size: var(--text-md); max-width: 100%; }
  .card { padding: 19px; }
  .footer-inner { justify-content: center; text-align: center; min-height: 62px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats--queue { grid-template-columns: 1fr; }
  .hbar { grid-template-columns: minmax(96px, 42%) 1fr auto; gap: var(--space-2); }
}
@media (max-width: 350px) {
  .topbar .top-avatar { display: none; } /* o perfil continua na barra de baixo */
}
@media (max-width: 420px) {
  .marks-row { grid-template-columns: 1fr 1fr; }
  .score { font-size: var(--text-xl); padding: 8px 10px; }
  .avatar-pick { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 240px; }
  .comment-form { flex-direction: column; align-items: stretch; }
}
