/* components.css — pecas de UI reutilizaveis: card, botao, chip, item-card,
   precos, formulario de auth, feedback de salvamento. Importado por ultimo. */

/* Card generico (wrapper de secao). ---------------------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
  margin-bottom: 14px;
}

/* Painel de dicas de como fotografar (/adicionar). ----------- */
.foto-dicas {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 20px;
  margin-bottom: 12px;
}
.foto-dicas-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
}
.foto-dicas-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}
@media (max-width: 480px) {
  .foto-dicas-grid { grid-template-columns: 1fr; }
}
.foto-dica-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}
.foto-dica-item strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 2px;
}
.foto-dica-icon {
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1.3;
}

/* Exemplo visual de enquadramento ideal. -------------------- */
.foto-exemplo-wrap {
  margin-bottom: 14px;
}
.foto-exemplo-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.foto-exemplo-card {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 14px;
  max-width: 320px;
}
.foto-exemplo-svg {
  width: 52px;
  height: 70px;
  flex-shrink: 0;
  border-radius: 5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.14);
}
.foto-exemplo-checks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.foto-exemplo-checks span {
  color: var(--accent, #e85d2f);
  font-weight: 500;
}

/* Aviso de lote grande (>5 fotos). -------------------------- */
.batch-tip {
  background: color-mix(in srgb, var(--accent, #e85d2f) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent, #e85d2f) 30%, transparent);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  margin-top: 10px;
  line-height: 1.45;
}

/* Dropzone de upload de foto. --------------------------------- */
label.file {
  display: block;
  border: 2px dashed var(--border-2);
  border-radius: var(--r);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  color: var(--muted);
}
label.file:hover { border-color: var(--accent); color: var(--text); }
label.file input { display: none; }

.preview {
  margin-top: 16px;
  display: none;
}
.preview img {
  max-width: 100%;
  max-height: 400px;
  border-radius: var(--r-sm);
  display: block;
  margin: 0 auto;
}

/* F6.2.3: quando o usuario envia varias fotos, o preview vira um grid de
   thumbnails numeradas. Clamp no tamanho do card evita layout shift
   absurdo com 5+ fotos. */
.preview.preview-multi {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.preview-thumb {
  position: relative;
  border-radius: var(--r-sm);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: rgba(255, 255, 255, 0.04);
}
.preview-thumb img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  border-radius: 0;
  margin: 0;
}
/* Botao "×" pra remover foto individual do grid de preview. Posicionado
   no canto superior direito do thumb. Sempre visivel em touch (sem hover). */
.preview-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  padding: 0;
  min-width: unset;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  z-index: 2;
}
.preview-thumb:hover .preview-thumb-remove { opacity: 1; }
.preview-thumb-remove:hover { background: rgba(220, 50, 50, 0.85); }
/* Mobile: touch device nao tem hover, botao fica sempre visivel */
@media (hover: none) {
  .preview-thumb-remove { opacity: 1; }
}

/* Preview de crop dentro do card de staging (antes do commit).
   Exibe o recorte gerado pelo bbox do Claude — sem bg-removal ainda. */
.card-preview {
  margin: 4px 0 12px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 180px;
}
.card-preview img {
  max-width: 100%;
  max-height: 180px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--r-sm);
  margin: 0;
  display: block;
}

.preview-thumb-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Linha de botoes horizontal. --------------------------------- */
.row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* Botoes. ----------------------------------------------------- */
button {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 10px 20px;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
button:hover { background: var(--accent-2); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border-2);
}
button.ghost:hover { color: var(--text); border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.04); }
button.ghost.danger { color: var(--err); border-color: var(--err); }
button.ghost.danger:hover { background: rgba(239,68,68,0.08); color: var(--err); }
button.small {
  padding: 6px 12px;
  font-size: 12px;
  letter-spacing: 0.3px;
}

/* Resultado da identificacao. --------------------------------- */
.results { margin-top: 8px; }
.notas-gerais {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
  padding: 10px 14px;
  background: var(--panel-2);
  border-radius: var(--r-sm);
  border-left: 2px solid var(--accent);
}

/* Card de item identificado (staging, antes de commit na colecao). */
.item-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 10px;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}
.item-card.validated {
  border-color: rgba(74, 222, 128, 0.4);
  background: linear-gradient(var(--panel-2), rgba(74,222,128,0.04) 200%);
}
.item-card.validated.dest-wishlist {
  border-color: rgba(124, 92, 255, 0.4);
  background: linear-gradient(var(--panel-2), rgba(124,92,255,0.04) 200%);
}
.item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
/* Botao × de descarte no canto direito do cabecalho do card.
   Separado dos botoes de acao pra nao poluir a linha de Colecao/Wishlist. */
.card-discard-btn {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid #cc3355;
  border-radius: 4px;
  color: #cc3355;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  transition: background 0.15s;
  align-self: flex-start;
  white-space: nowrap;
}
.card-discard-btn:hover {
  background: rgba(204, 51, 85, 0.12);
  color: #cc3355;
}
.item-title {
  font-size: 17px;
  font-weight: 600;
  flex: 1;
}

/* Badge de confianca da identificacao (alta/media/baixa) e estado "ok". */
.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.badge.alta  { background: rgba(74, 222, 128, 0.15); color: var(--ok); }
.badge.media { background: rgba(251, 191, 36, 0.15); color: var(--warn); }
.badge.baixa { background: rgba(255, 122, 133, 0.15); color: var(--err); }
.badge.ok    { background: rgba(74, 222, 128, 0.2); color: var(--ok); }
/* F6.2.2: badge "→ Wishlist" em tom lilás — mesma familia do accent. */
.badge.wish  { background: rgba(124, 92, 255, 0.2); color: #b3a0ff; }

/* Grade de campos rotulo/valor dentro do item-card. */
.fields {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 6px 12px;
  font-size: 13px;
}
.fields .lbl {
  color: var(--muted);
  padding-top: 6px;
}

/* Chip editavel (contenteditable) usado nos campos do item-card. */
.chip {
  display: inline-block;
  padding: 5px 10px;
  background: var(--panel-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xs);
  cursor: text;
  min-height: 28px;
  min-width: 60px;
  line-height: 1.4;
  word-break: break-word;
  transition: border-color 0.15s, background 0.15s;
}
.chip:hover { border-color: var(--accent); }
.chip.empty { color: var(--muted); font-style: italic; }
.chip:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--panel);
}
.chip.edited { border-color: var(--accent); }
.chip.edited::after {
  content: " ●";
  color: var(--accent);
  font-size: 10px;
}

/* ── Campos de formulário no card de staging ────────────────────────────── */
/* Substitui os chips contenteditable por inputs/selects reais.             */
/* Mais affordance: cursor, focus-ring, placeholder, autocomplete nativo.   */

.field-row {
  display: contents; /* participa do grid .fields sem criar novo contexto */
}

.field-input,
.field-select {
  width: 100%;
  padding: 5px 9px;
  background: var(--panel-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xs);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
  min-height: 30px;
  transition: border-color .15s, background .15s;
  box-sizing: border-box;
}

.field-input::placeholder { color: var(--muted); font-style: italic; }
.field-input:hover,
.field-select:hover  { border-color: var(--accent); }
.field-input:focus,
.field-select:focus  { outline: none; border-color: var(--accent); background: var(--panel); }

/* Campo editado (valor diferente do original do Claude) */
.field-input.edited,
.field-select.edited { border-color: var(--accent); }

/* Campo de preço com estimativa de IA */
.field-input.is-estimate { border-style: dashed; color: var(--gold); }

/* Nome do item no cabeçalho — maior, bold, fundo transparente */
.field-input--nome {
  font-size: 17px;
  font-weight: 700;
  background: transparent;
  border-color: transparent;
  padding-left: 0;
  min-height: 28px;
}
.field-input--nome:hover  { border-color: var(--border-2); background: var(--panel-3); }
.field-input--nome:focus  { border-color: var(--accent);   background: var(--panel-3); padding-left: 9px; }

/* Select de escala — remove seta padrão em WebKit e adiciona ↕ estilizada */
.field-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23888' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  padding-right: 24px;
  cursor: pointer;
}

/* Observacoes do item identificado (abaixo dos campos). */
.obs {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

/* Bloco de match do catálogo canônico no card de staging. */
.catalog-match {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: rgba(124, 92, 255, 0.07);
  border: 1px solid rgba(124, 92, 255, 0.2);
}

.catalog-match-wrapper.hidden { display: none; }
.catalog-match.hidden         { display: none; }

/* Estado "catálogo aplicado" — compacto, após o usuário aceitar uma sugestão */
.catalog-applied {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  background: rgba(74, 222, 128, 0.07);
  border: 1px solid rgba(74, 222, 128, 0.22);
}
.catalog-applied-check {
  font-size: 13px;
  font-weight: 700;
  color: var(--ok);
  flex-shrink: 0;
}
.catalog-applied-name {
  flex: 1;
  font-size: 12px;
  color: var(--text-secondary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.catalog-applied-clear {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color .15s;
}
.catalog-applied-clear:hover { color: var(--text); }

/* Pulse nos botões de CTA após selecionar item do catálogo */
@keyframes actionsPulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 77, 0, 0); }
  40%  { box-shadow: 0 0 0 6px rgba(255, 77, 0, 0.25); }
  100% { box-shadow: 0 0 0 0 rgba(255, 77, 0, 0); }
}
.item-actions--pulse > [data-action="commit-owned"] {
  animation: actionsPulse 0.7s ease;
}

.catalog-match-body {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  text-align: left;
  border-radius: var(--r-xs);
  transition: opacity .15s;
}
.catalog-match-body:hover { opacity: .8; }

.catalog-match-dismiss {
  margin-left: 4px;
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color .15s;
}
.catalog-match-dismiss:hover { color: var(--text); }

.catalog-match-body img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: var(--r-xs);
  flex-shrink: 0;
  background: var(--surface2);
}

.catalog-match-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.catalog-match-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.catalog-match-nome {
  font-size: 12px;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ---- Busca manual no catálogo -------------------------------- */
.catalog-search-section {
  margin-top: 8px;
}
.catalog-search-toggle {
  background: none;
  border: none;
  padding: 4px 0;
  font-size: 12px;
  font-family: var(--font-body);
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .15s;
}
.catalog-search-toggle:hover { color: var(--text); }

.catalog-search-panel { margin-top: 8px; }
.catalog-search-panel.hidden { display: none; }

.catalog-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  background: var(--panel-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
  margin-bottom: 6px;
}
.catalog-search-input:focus { border-color: var(--accent); }

.catalog-search-loading { padding: 10px 0; text-align: center; }
.catalog-search-empty   { font-size: 13px; color: var(--muted); padding: 8px 0; }

/* Variante opt-in — seção no staging card. */
.variante-section {
  padding: 8px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.variante-add-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  transition: color .15s;
}
.variante-add-btn:hover { color: var(--text); }
.variante-active {
  display: flex;
  align-items: center;
  gap: 8px;
}
.variante-pill-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .4px;
  flex-shrink: 0;
}
.variante-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-2);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 2px 0;
  outline: none;
}
.variante-input:focus { border-color: var(--accent); }
.variante-clear-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
}
.variante-clear-btn:hover { color: var(--err); }

.catalog-search-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 240px;
  overflow-y: auto;
}

.catalog-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  text-align: left;
  transition: background .15s, border-color .15s;
}
.catalog-result-item:hover {
  background: rgba(124,92,255,.12);
  border-color: rgba(124,92,255,.35);
}
.catalog-result-item img,
.catalog-result-no-photo {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: var(--r-xs);
  flex-shrink: 0;
  background: var(--panel-3);
}
.catalog-result-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.catalog-result-nome {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.catalog-result-sub {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  justify-content: flex-end;
}

.meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 14px;
  text-align: right;
}

/* Caixa de erro e spinner de loading. ------------------------- */
.err-box {
  color: var(--err);
  background: rgba(255, 122, 133, 0.08);
  border: 1px solid rgba(255, 122, 133, 0.3);
  border-radius: var(--r-sm);
  padding: 12px;
}
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -2px;
  margin-right: 8px;
}

.empty-state {
  color: var(--muted);
  font-style: italic;
  padding: 10px 0;
}

/* Cabecalho de secao (ex.: "Colecao desta sessao" + contador). */
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-title h2 {
  font-size: 16px;
  margin: 0;
  font-weight: 600;
}
.section-title .count {
  color: var(--muted);
  font-size: 13px;
}

/* Aviso de sessao (ex.: "salvo localmente, sem cloud"). */
.session-notice {
  font-size: 12px;
  color: var(--warn);
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: var(--r-xs);
  padding: 8px 12px;
  margin-bottom: 12px;
}

/* Item compacto na lista da colecao (thumb + info + remover). */
.coll-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: flex-start;
  padding: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: 8px;
}
.coll-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--r-xs);
  background: var(--panel-3);
  flex-shrink: 0;
}
.coll-thumb.thumb-error { display: none; }

/* Placeholder visual quando não há foto */
.coll-no-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-3);
  color: var(--muted);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0;
  flex-shrink: 0;
}
.coll-no-photo span { opacity: 0.5; }
.coll-info .name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
}
.coll-info .sub-line {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.coll-remove {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: var(--r-xs);
  font-size: 14px;
  cursor: pointer;
}
.coll-remove:hover {
  color: var(--err);
  border-color: var(--err);
  background: rgba(255, 122, 133, 0.08);
}

/* F6.2.1 — .wishlist-actions mantida: empilha "Adquiri" e "×" no card da
   wishlist. O "Adquiri" faz flip status wishlist → owned reusando o cadastro
   existente (evita forcar nova foto + re-identificacao). Removidas
   .detail-status-row / .detail-status-hint — no detalhe o status e write-once. */
.wishlist-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}
.wishlist-actions button {
  font-size: 12px;
  padding: 6px 10px;
  white-space: nowrap;
}

/* Separador de batch (ex.: divide uma identificacao da seguinte). */
.batch-sep {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin: 12px 0 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Bloco de precos do item dentro da colecao (Fase 2). ---------- */
.coll-prices {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.price-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
}
.price-label {
  color: var(--muted);
  white-space: nowrap;
  min-width: 110px;
}
.price-chip {
  display: inline-block;
  padding: 3px 10px;
  background: var(--panel-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xs);
  font-size: 12px;
  min-width: 70px;
  line-height: 1.4;
  cursor: text;
  transition: border-color 0.15s, background 0.15s;
}
.price-chip:hover { border-color: var(--accent); }
.price-chip:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--panel);
  font-style: normal !important;
  border-style: solid !important;
  color: var(--text) !important;
}
.price-chip.empty { color: var(--muted); font-style: italic; }
/* Valor de mercado destacado em âmbar — token exclusivo do core feature */
.price-chip--market {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  font-weight: 500;
  color: var(--gold);
}
.price-chip--market.empty { color: var(--muted); font-family: var(--font-body); font-style: italic; font-size: 14px; }

/* Chip em estado "estimativa do AI" (nao confirmado ainda).
   Aplicavel tanto em .chip (staging) quanto .price-chip (colecao). */
.chip.is-estimate, .price-chip.is-estimate {
  font-style: italic;
  color: var(--muted);
  border-style: dashed;
}
.chip.is-estimate:focus, .price-chip.is-estimate:focus {
  font-style: normal;
  color: var(--text);
  border-style: solid;
}

/* Botao "Concordo" que confirma a estimativa sem edicao. */
.btn-agree {
  padding: 3px 10px;
  font-size: 11px;
  background: transparent;
  color: var(--ok);
  border: 1px solid var(--ok);
  border-radius: 5px;
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-agree:hover { background: rgba(74, 222, 128, 0.12); }
.btn-agree .tag {
  font-size: 9px;
  color: var(--muted);
  margin-left: 4px;
}
.estimate-hint {
  font-size: 10px;
  color: var(--muted);
  font-style: italic;
}

/* Feedback discreto de "salvo" que aparece por ~1.5s apos
   editar um campo de preco. Some com fade pra nao chamar atencao
   depois que o usuario ja absorveu a confirmacao. */
.save-indicator {
  color: var(--ok);
  font-size: 11px;
  font-weight: 500;
  margin-left: 6px;
  opacity: 1;
  transition: opacity 0.35s ease;
  pointer-events: none;
  white-space: nowrap;
}
.save-indicator.fade-out { opacity: 0; }

/* Formulario de login/cadastro. ------------------------------- */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-form input[type="email"],
.login-form input[type="password"] {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}
.login-form input[type="email"]:focus,
.login-form input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
}
.login-help {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.login-status {
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--r-xs);
  display: none;
}
.login-status.ok,
.login-status.err,
.login-status.info { display: block; }
.login-status.ok   { background: rgba(74,222,128,.08);  color: var(--ok);    border: 1px solid rgba(74,222,128,.3); }
.login-status.info { background: rgba(124,156,255,.08); color: var(--accent); border: 1px solid rgba(124,156,255,.3); }
.login-status.err  { background: rgba(255,122,133,.08); color: var(--err);   border: 1px solid rgba(255,122,133,.3); }

/* Tabs Entrar / Cadastrar na tela de auth-gate. --------------- */
.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.auth-tab {
  flex: 1;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 0;
  margin-bottom: -1px; /* sobreposicao com a borda do container */
  transition: color .15s, border-color .15s;
}
.auth-tab:hover { color: var(--text); background: transparent; }
.auth-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Link "Esqueci a senha". ------------------------------------- */
.auth-link {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
  align-self: flex-end;
}
.auth-link:hover { color: var(--accent); text-decoration: underline; }

/* Divider "ou" entre os metodos de login. -------------------- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ============================================================
   Home view (Fase 5.4) — dashboard.
   ============================================================ */

/* Hero CTA — card especial do topo da home, unica acao em destaque. */
.hero-cta {
  padding: 0;
  overflow: hidden;
}
.hero-cta-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 28px 20px;
  background: linear-gradient(135deg, var(--accent) 0%, #5b43c9 100%);
  color: #0b0d12;
  text-decoration: none;
  text-align: center;
  font-weight: 600;
  transition: filter .15s, transform .05s;
}
.hero-cta-btn:hover  { filter: brightness(1.08); }
.hero-cta-btn:active { transform: scale(.995); }
.hero-cta-icon {
  font-size: 28px;
  line-height: 1;
  font-weight: 400;
  margin-bottom: 2px;
}
.hero-cta-label {
  font-size: 18px;
  letter-spacing: .2px;
}
.hero-cta-sub {
  font-size: 12px;
  opacity: .75;
  font-weight: 500;
}

/* Grid de stats: 2 colunas no mobile, 4 no desktop. ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 640px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
.stat-card {
  background: var(--panel);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 4px;
}
.stat-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.stat-up   { color: var(--gain); }
.stat-down { color: var(--loss); }
.stat-dim  { color: var(--muted); font-weight: 500; }

/* Grid de mini-cards (Recentes + Mais valiosos). ------------- */
.home-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}
@media (min-width: 720px) {
  .home-grid { grid-template-columns: repeat(6, 1fr); }
}
.mini-card {
  background: var(--panel);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.mini-thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--panel-3);
  display: block;
}
.mini-info {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mini-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mini-sub {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-price {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  margin-top: 3px;
}

/* mini-card e um <a> — tira decoracao default de link e adiciona hover. */
a.mini-card {
  text-decoration: none;
  color: inherit;
  transition: transform .08s, border-color .15s;
}
a.mini-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* Links dentro da Colecao (thumb + nome) — levam pro detalhe. */
.coll-thumb-link {
  display: block;
  flex-shrink: 0;
  text-decoration: none;
}
.coll-thumb-link:hover { opacity: .9; }
.coll-name-link {
  text-decoration: none;
  color: inherit;
  display: inline-block;
}
.coll-name-link:hover .name { color: var(--accent); }

/* ============================================================
   View Detalhe (Fase 5.6) — /item/:id.
   Layout fullscreen inspirado no Letterboxd: foto grande em cima,
   titulo/metadata logo abaixo, blocos de informacao agrupados em cards.
   ============================================================ */

.detail-back {
  margin-bottom: 12px;
}

/* Back button reutilizavel (Perfil, Detalhe). Pill compacto com
   borda sutil — se destaca como acao sem competir com o conteudo.
   A seta ganha uma microanimacao no hover pra reforcar o affordance
   de "voltar" sem precisar de cor forte. */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  transition: color .15s, background .15s, border-color .15s;
}
.back-btn:hover {
  color: var(--text);
  background: var(--panel-2);
  border-color: var(--border-2);
  text-decoration: none;
}
.back-btn-arrow {
  font-size: 14px;
  display: inline-block;
  transition: transform .15s ease;
}
.back-btn:hover .back-btn-arrow {
  transform: translateX(-3px);
}

/* Slogan da Home. Texto com gradient fill pra se destacar do .sub
   sem gritar. letter-spacing + weight elevam o status visual, mas
   o fonte segue o resto do app — nao e caricato. */
.home-slogan {
  display: inline-block;
  margin: 0 0 24px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.6px;
  background: linear-gradient(90deg, var(--accent) 0%, #5eead4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Hero: foto grande no topo. Ocupa a largura total do wrap. */
.detail-hero {
  margin-bottom: 16px;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
}
/* Foto individual (crop justo do item): exibe inteira sem cortar. */
.detail-hero img {
  width: 100%;
  height: 260px;
  object-fit: contain;
  object-position: center center;
  display: block;
  background: var(--bg);
}
/* Foto do batch (prateleira completa — fallback pra itens sem crop individual).
   Usa cover pra enquadrar a area central. */
.detail-hero--batch img {
  object-fit: cover;
  object-position: center center;
  height: 220px;
}

/* Titulo h1 editavel. */
.detail-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 10px;
}
.detail-title-wrap .detail-title {
  margin-bottom: 0;
  flex: 1;
}
.detail-edit-icon {
  font-size: 13px;
  margin-top: 4px;
  flex-shrink: 0;
  opacity: 0.5;
}
.detail-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 10px;
  color: var(--text);
  outline: none;
  padding: 2px 4px;
  margin-left: -4px;
  border-radius: var(--r-xs);
  border-bottom: 1px dashed var(--border-2);
  transition: background .15s, border-color .15s;
}
.detail-title:hover  { background: rgba(255, 77, 0, .05); border-color: var(--accent); }
.detail-title:focus  { background: rgba(255, 77, 0, .08); border-color: var(--accent); outline: none; }
.detail-title.empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  font-weight: 400;
}

/* Sub-linha: franquia · fabricante · ano. Chips inline editaveis. */
/* Subtitle — fabricante · franquia · ano · stars em linha plana */
.detail-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}
.detail-sub-chip {
  outline: none;
  color: var(--muted);
  font-size: 12px;
  min-width: 4px;
  transition: color .15s, border-color .15s;
  border: 1px dashed rgba(242,238,232,0.2);
  border-radius: 20px;
  padding: 3px 10px;
}
.detail-sub-chip:hover { color: var(--text-secondary); border-color: rgba(242,238,232,0.35); }
.detail-sub-chip:focus { color: var(--text); outline: none; border-color: rgba(242,238,232,0.55); border-style: solid; }
.detail-sub-chip.empty::before {
  content: attr(data-placeholder);
  opacity: .35;
}
.detail-sub-sep { display: none; }
.detail-sub-stars { display: inline-flex; align-items: center; }
.detail-sub-stars .star-btn { font-size: 13px; padding: 0 1px; color: var(--muted); }
.detail-sub-stars .star-btn.filled { color: var(--gold); }

/* Price cards — 3 col horizontal (Pago | Mercado | Retorno) */
.detail-price-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 0;
}
.detail-price-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.detail-price-card-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
}
.detail-price-card-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  outline: none;
  min-width: 4px;
}
.detail-price-card-value:focus { color: var(--text); outline: none; }
.detail-price-card-value.gold  { color: var(--gold); }
.detail-price-card-value.gain  { color: var(--gain); }
.detail-price-card-value.loss  { color: var(--loss); }
.detail-price-card-value.empty { color: var(--muted); }

/* Lançamento — linha sutil abaixo dos 3 cards */
.detail-price-lanc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.detail-price-lanc-label {
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}
.detail-price-lanc-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.detail-price-lanc-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  outline: none;
  min-width: 4px;
}
.detail-price-lanc-value:focus { outline: none; }
.detail-price-lanc-value.empty { color: var(--muted); }

/* Atributos compactos (sem título) */
.detail-attrs-wrap .detail-grid { margin-top: 0; }

/* Picker de confianca: 3 botoes alta/media/baixa. ------------- */
.detail-confianca {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.confianca-pick {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.confianca-pick:hover { color: var(--text); border-color: var(--muted); }
.confianca-pick.active.alta  { background: rgba(94,234,212,.12); color: #5eead4; border-color: #5eead4; }
.confianca-pick.active.media { background: rgba(124,92,255,.12); color: var(--accent); border-color: var(--accent); }
.confianca-pick.active.baixa { background: rgba(255,122,133,.12); color: var(--err);   border-color: var(--err); }

/* Rating — estrelas interativas (detalhe) e read-only (colecao). */
.detail-rating {
  display: flex;
  gap: 4px;
  margin-top: 10px;
}

.star-btn {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--border);
  transition: color .1s, transform .1s;
}
.star-btn.filled        { color: #f59e0b; }
.star-btn.hover         { color: #fbbf24; transform: scale(1.15); }
.star-btn:not(.filled):hover { color: #fbbf24; }

.star-ro {
  font-size: 13px;
  line-height: 1;
  color: var(--border);
}

.detail-visibility {
  margin-top: 10px;
}

.visibility-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 5px 10px;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: border-color .15s, color .15s;
}
.visibility-toggle:hover {
  border-color: var(--text-dim);
  color: var(--text);
}
.visibility-toggle.is-public {
  border-color: var(--brand);
  color: var(--brand);
}
.visibility-icon {
  font-size: 14px;
  line-height: 1;
}
.star-ro.filled { color: #f59e0b; }

.coll-grid-stars { margin: 2px 0 1px; }

/* Bloco de precos — reusa .price-row/.price-chip, so mais espacoso. */
.detail-prices .price-row { padding: 6px 0; }

/* Grid de atributos (linha, escala, variante). */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 600px) {
  .detail-grid { grid-template-columns: repeat(3, 1fr); }
}
.detail-attr {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px;
}
.detail-attr-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  margin-bottom: 4px;
}
.detail-attr-value {
  font-size: 14px;
  color: var(--text);
  outline: none;
  min-height: 20px;
  border-radius: 4px;
  padding: 2px 4px;
  margin-left: -4px;
  transition: background .15s;
}
.detail-attr-value:hover { background: rgba(124,92,255,.06); }
.detail-attr-value:focus { background: rgba(124,92,255,.12); }
.detail-attr-value.empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}

/* Textarea de observacoes — contenteditable multi-linha. */
.detail-textarea {
  min-height: 80px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  outline: none;
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  transition: border-color .15s;
}
.detail-textarea:hover { border-color: var(--muted); }
.detail-textarea:focus { border-color: var(--accent); }
.detail-textarea.empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  font-style: italic;
}

/* Meta (adicionado em, lote) — linha pequenininha. */
.detail-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}
.detail-meta code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ============================================================
   Colecao — toolbar (busca + sort + filtros + view toggle) (F5.7)
   ============================================================ */

.coll-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.coll-toolbar-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.coll-search {
  flex: 1;
  min-width: 180px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
.coll-search:focus { border-color: var(--accent); }
.coll-search::placeholder { color: var(--muted); }

.coll-sort {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: 14px;
  outline: none;
  cursor: pointer;
  transition: border-color .15s;
}
.coll-sort:focus { border-color: var(--accent); }

.coll-view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.coll-view-btn {
  background: var(--bg);
  color: var(--muted);
  border: 0;
  padding: 8px 12px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 0;
  cursor: pointer;
  transition: background .15s, color .15s;
  min-width: 40px;
}
.coll-view-btn:hover { background: var(--panel); color: var(--text); }
.coll-view-btn.active {
  background: var(--accent);
  color: #0b0d12;
}

/* Chips de filtro por status. Toggle individual (1 ativo). */
.coll-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.coll-filter-chip {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.coll-filter-chip:hover { color: var(--text); border-color: var(--muted); }
.coll-filter-chip.active {
  background: rgba(124,92,255,.12);
  color: var(--accent);
  border-color: var(--accent);
}

/* Header da pagina de colecao (titulo + total de mercado). */
/* Sub-tabs Coleção / Wishlist */
.coll-sub-tabs {
  display: flex;
  gap: 4px;
  padding: 0 16px 12px;
}
.coll-sub-tab {
  padding: 6px 16px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  background: transparent;
  border: 1.5px solid transparent;
  transition: color .15s, border-color .15s;
}
.coll-sub-tab:hover { color: var(--text); }
.coll-sub-tab.active {
  color: var(--text);
  border-color: rgba(242,238,232,0.2);
}

.coll-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.coll-page-title {
  font-family: var(--font-body);
  font-size: 32px;
  font-weight: 700;
  font-style: normal;
  line-height: 1.1;
  margin: 0 0 2px;
  color: var(--text);
}
.coll-page-count {
  font-size: 13px;
  color: var(--muted);
  display: block;
}
.coll-page-market {
  text-align: right;
  flex-shrink: 0;
}
.coll-page-market-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 2px;
}
.coll-page-market-value {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: -.01em;
}

/* ============================================================
   Colecao — view Grid (modo visual, Letterboxd-style) (F5.7)
   ============================================================ */

.coll-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 520px) { .coll-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 760px) { .coll-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 960px) { .coll-grid { grid-template-columns: repeat(5, 1fr); } }

.coll-grid-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform .08s, border-color .15s;
}
.coll-grid-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.coll-grid-thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--panel-3);
  display: block;
}
.coll-grid-thumb.thumb-error { display: none; }
.coll-grid-thumb.coll-no-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 700;
  color: var(--muted);
}
.coll-grid-thumb.coll-no-photo span { opacity: 0.35; }
.coll-grid-info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.coll-grid-sub {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.coll-jamais-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  background: rgba(192,132,252,0.12);
  color: #C084FC;
  border-radius: 100px;
  font-size: 9px;
  font-weight: 700;
}
.is-never-sell .coll-grid-thumb {
  outline: 1px solid rgba(192,132,252,0.25);
  outline-offset: -1px;
}
.coll-grid-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.coll-grid-price-block { margin-top: 8px; }
.coll-grid-paid {
  font-size: 11px;
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: rgba(138,132,124,.5);
  margin-bottom: 2px;
}
.coll-grid-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}
.coll-grid-price {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: -.01em;
}
.coll-grid-delta {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.delta-up   { color: #22c55e; }
.delta-down { color: #ef4444; }

/* Sparkline row: linha SVG + delta % lado a lado */
.coll-sparkline-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.coll-sparkline {
  flex-shrink: 0;
  display: block;
}

/* Barra de progresso owned vs. planejados */
.coll-progress {
  padding: 8px 16px 12px;
}
.coll-progress-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.coll-progress-pct {
  font-weight: 600;
  color: var(--accent);
}
.coll-progress-track {
  height: 4px;
  border-radius: 2px;
  background: var(--panel-3);
  overflow: hidden;
}
.coll-progress-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width .4s ease;
}
.coll-progress-wishlist-btn {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  opacity: .8;
  transition: opacity .15s;
}
.coll-progress-wishlist-btn:hover { opacity: 1; }

/* Agrupado por franquia (F6.3). Cada secao e uma "estante": header
   colapsavel + grid de cards (reusa .coll-grid/.coll-grid-card). */
.coll-group {
  margin-bottom: 24px;
}
.coll-group:last-child { margin-bottom: 0; }
.coll-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  margin: 0 0 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.coll-group-header:hover {
  border-color: var(--accent);
}
.coll-group-caret {
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  transition: transform 0.15s;
}
.coll-group.collapsed .coll-group-caret {
  transform: rotate(-90deg);
}
.coll-group-name {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.coll-group-count {
  color: var(--muted);
  font-size: 12px;
  background: var(--panel);
  padding: 3px 8px;
  border-radius: 999px;
}
/* Quando colapsado, esconde o grid (mas mantem o header visivel). */
.coll-group.collapsed .coll-group-grid { display: none; }

/* ============================================================
   View Perfil (Fase 5.8) — /perfil.
   ============================================================ */

/* Conta: email + botao sair alinhados. */
.perfil-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.perfil-account-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  margin-bottom: 4px;
}
.perfil-account-email {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  word-break: break-all;
}

/* Breakdowns (top franquias + top fabricantes) — 2 colunas no desktop. */
.perfil-breakdowns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 20px;
}
@media (min-width: 640px) {
  .perfil-breakdowns { grid-template-columns: 1fr 1fr; gap: 24px; }
}
.perfil-breakdown-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.perfil-bar-row {
  display: grid;
  grid-template-columns: 1fr 90px auto;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
}
.perfil-bar-label {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.perfil-bar-track {
  height: 6px;
  background: var(--panel-2);
  border-radius: 3px;
  overflow: hidden;
}
.perfil-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width .2s;
}
.perfil-bar-count {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  white-space: nowrap;
}
.perfil-bar-pct {
  color: var(--muted);
}

/* Dados: lista de acoes (CSV, limpar). */
.perfil-data {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.perfil-data-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.perfil-data-row:last-child {
  border-bottom: 0;
}
.perfil-data-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}
.perfil-data-sub {
  font-size: 12px;
  color: var(--muted);
  max-width: 480px;
}
.perfil-danger .perfil-data-title {
  color: var(--err);
}

/* ============================================================
   View Dashboard (Fase 6.1) — /dashboard.
   Cards com graficos via Chart.js. .chart-wrap tem altura fixa
   pro canvas nao colapsar (Chart.js respeita o container).
   ============================================================ */

/* Grid de 2 colunas pros donuts no desktop. No mobile vira 1 coluna
   pra dar espaco ao legend lateral do Chart.js respirar. */
.dashboard-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 760px) {
  .dashboard-grid-2 { grid-template-columns: 1fr 1fr; }
}

/* Slot = container vertical: titulo + canvas + meta opcional. */
.chart-slot {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chart-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
}
.chart-meta {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  font-style: italic;
}

/* Canvas wrapper. Chart.js pega o tamanho do parent — sem altura
   explicita, o <canvas> colapsa pra 0. 240px cabe donut + legend
   lateral; 320px pra line/bar horizontal com labels longos. */
.chart-wrap {
  position: relative;
  height: 240px;
  width: 100%;
}
.chart-wrap-wide {
  height: 320px;
}
/* No mobile, o legend do donut vai pra baixo — dar mais altura
   pra ele nao comer o donut. */
@media (max-width: 759px) {
  .chart-wrap { height: 280px; }
}

/* ============================================================
   Nav persistente (Fase 5.9).
   Mobile (< 720px): fixed no bottom, items + icone de busca.
   Desktop (>= 720px): horizontal inline, logo abaixo do brand-header.
   ============================================================ */

/* Base: layout grid com items distribuidos. */
.app-nav {
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  gap: 2px;
  background: #EDEAE3;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: var(--r-lg);
  padding: 6px;
  margin: 10px 0 18px;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  color: #7A736B;
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: color .15s, background .15s;
  /* Reset default button styling que interfere com o reset do ".row button". */
  font-family: inherit;
}
.nav-item:hover {
  color: #13110F;
  background: rgba(0,0,0,.06);
}
.nav-item.active {
  color: var(--accent);
  background: rgba(255, 77, 0, .10);
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}
.nav-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
/* Emoji nav icons — tamanho fixo, sem herdar color (emojis têm cor própria) */
.nav-emoji {
  font-size: 20px;
  line-height: 1;
  display: block;
  filter: grayscale(0);   /* garante emoji colorido em todos os browsers */
}
.nav-label {
  line-height: 1;
  white-space: nowrap;
}

/* FAB central de Adicionar — 56px, elevado 8px acima da barra */
.nav-fab-wrap {
  flex: 0 0 auto;
  width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  text-decoration: none;
  /* Eleva o FAB para fora da barra */
  margin-top: -16px;
}
.nav-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(255, 77, 0, .45);
  transition: transform .15s, box-shadow .15s;
  color: #fff;
  border: 3px solid var(--panel);
}
.nav-fab svg { width: 26px; height: 26px; }
.nav-fab-wrap:hover .nav-fab {
  transform: scale(1.07);
  box-shadow: 0 10px 24px rgba(255, 77, 0, .60);
}
.nav-fab-wrap.active .nav-fab { background: var(--accent-2); }

/* --- Mobile: fixa no bottom ------------------------------- */
@media (max-width: 719px) {
  .app-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    /* Altura 56px + safe area. Overflow visible p/ FAB elevado aparecer */
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    overflow: visible;
    z-index: 50;
    background: #EDEAE3;
    border-top: 1px solid rgba(0,0,0,.08);
  }
  /* Padding-bottom generoso p/ conteudo não ficar atrás do nav + FAB elevado */
  .wrap { padding-bottom: 100px; }
  .nav-search-btn::before { display: none; }
}

/* Desktop: o FAB elevado pode extrapolar o radius do nav — corrigir overflow */
@media (min-width: 720px) {
  .app-nav { overflow: visible; }
}

/* ============================================================
   Search overlay (Fase 5.9).
   Fullscreen, backdrop escurecido, panel centrado.
   ============================================================ */

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 64px 16px 16px;
  overflow-y: auto;
}
.search-overlay-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
}
.search-overlay-panel {
  position: relative;
  width: 100%;
  max-width: 640px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 96px);
  overflow: hidden;
}

.search-overlay-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.search-overlay-input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 17px;
  padding: 6px 2px;
  font-family: inherit;
}
.search-overlay-input::placeholder { color: var(--muted); }
/* Esconde o X nativo do type="search" pra nao concorrer com o botao close. */
.search-overlay-input::-webkit-search-cancel-button { display: none; }

.search-overlay-close {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--r-sm);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: color .15s, border-color .15s;
}
.search-overlay-close:hover {
  color: var(--text);
  border-color: var(--muted);
  background: transparent;
}

.search-overlay-results {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.search-overlay-section {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  padding: 8px 10px 4px;
}
.search-overlay-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--r-sm);
  text-decoration: none;
  color: inherit;
  transition: background .15s;
}
.search-result:hover {
  background: var(--panel-2);
}
.search-result-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: var(--r-xs);
  background: var(--border);
  flex-shrink: 0;
}
.search-result-info {
  flex: 1;
  min-width: 0;
}
.search-result-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-price {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}

.search-overlay-hint {
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}
.search-overlay-hint kbd {
  display: inline-block;
  padding: 1px 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  color: var(--text);
}

/* ============================================================
   Skeletons (Fase 5.10).
   Retangulos cinza estaticos com a forma do conteudo real.
   Comunicam "ta carregando" sem fazer o layout pular quando
   os dados chegam. Sem animacao proposital — em rede boa o SW
   serve o shell na hora e o skel passa em <300ms; animacao ai
   mais atrapalha do que ajuda.
   ============================================================ */

.skel {
  background: var(--panel-2);
  border-radius: var(--r-xs);
  display: block;
}

/* Linha de texto (titulo/subtitulo). Larguras variaveis pra
   nao parecer robotico. */
.skel-line {
  height: 10px;
  margin-bottom: 8px;
}
.skel-line:last-child { margin-bottom: 0; }
.skel-line.w-40 { width: 40%; }
.skel-line.w-50 { width: 50%; }
.skel-line.w-60 { width: 60%; }
.skel-line.w-70 { width: 70%; }
.skel-line.w-80 { width: 80%; }
.skel-line.w-100 { width: 100%; }
.skel-line.tall { height: 16px; }

/* Mimica .stat-card: altura/radius/padding equivalentes.
   Quando o valor real entrar, o layout NAO muda. */
.skel-stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px;
  min-height: 76px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}

/* Mimica .mini-card da home (aspect ratio do thumb + 2 linhas
   de info). */
.skel-mini {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.skel-mini-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--panel-2);
}
.skel-mini-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Mimica .coll-item da lista (thumb 56px + info + espaco btn). */
.skel-coll-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  padding: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: 8px;
  align-items: center;
}
.skel-coll-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--r-xs);
  background: var(--panel-3);
}
.skel-coll-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Mimica .coll-grid-card (aspect 3/4 + info abaixo). */
.skel-grid-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.skel-grid-thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--panel-2);
}
.skel-grid-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Hero da view Detalhe. */
.skel-detail-hero {
  width: 100%;
  height: 320px;
  border-radius: var(--r-lg);
  background: var(--panel-2);
  margin-bottom: 16px;
}
.skel-detail-block {
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 16px;
}

/* Breakdowns do Perfil. */
.skel-bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 40px;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

/* ============================================================
   Empty state hero (Fase 5.10).
   Estado vazio elevado: icone SVG cinza + titulo + body + CTA
   opcional. Usado quando tem dados pra renderizar mas o usuario
   chegou num ponto sem conteudo (colecao vazia, busca sem match).
   Coexiste com o .empty-state legado (text-only) — novo pra telas
   "principais", antigo pra casos pontuais dentro de cards.
   ============================================================ */

.empty-state-hero {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.empty-state-hero-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  color: var(--muted);
  opacity: .55;
}
.empty-state-hero-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.empty-state-hero-title {
  font-size: 15px;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}
.empty-state-hero-body {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
  max-width: 340px;
  line-height: 1.5;
}
/* Pill CTA do empty state — menor, inline, dentro de um hero. */
.empty-state-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--accent);
  color: #0b0d12;
  font-weight: 600;
  font-size: 14px;
  border-radius: 999px;
  text-decoration: none;
  transition: background .15s, transform .08s;
  border: 0;
  cursor: pointer;
}
.empty-state-hero-cta:hover {
  background: var(--accent-2);
  text-decoration: none;
}
.empty-state-hero-cta:active {
  transform: translateY(1px);
}

/* Section CTA — "proximo passo" no final de uma view (ex.: fim
   da /colecao leva pra /adicionar). Maior e mais robusto que o
   pill do empty-state, pra chamar olho sem competir com o hero
   do topo da Home. Gradient sutil + shadow + ponto de elevacao
   sugere interatividade mesmo em tela cheia. */
.section-cta-row {
  display: flex;
  justify-content: center;
  margin-top: 24px;
  margin-bottom: 8px;
}
.section-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--accent) 0%, #5b43c9 100%);
  color: #0b0d12;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .2px;
  border-radius: var(--r-lg);
  text-decoration: none;
  transition: filter .15s, transform .05s, box-shadow .15s;
  box-shadow: 0 4px 14px rgba(124, 156, 255, .22);
  border: 0;
  cursor: pointer;
  min-width: 220px;
}
.section-cta:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 18px rgba(124, 156, 255, .32);
  text-decoration: none;
}
.section-cta:active {
  transform: scale(.98);
}

/* ============================================================
   Billing — plano, upgrade e banner de limite
   ============================================================ */

/* Linha de plano em /perfil */
.billing-plan-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.billing-plan-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 3px 10px;
  border-radius: 99px;
  margin-bottom: 6px;
}
.billing-plan-badge.pro      { background: #16a34a22; color: #22c55e; border: 1px solid #16a34a44; }
.billing-plan-badge.free     { background: var(--bg);  color: var(--muted); border: 1px solid var(--border); }
.billing-plan-badge.overdue  { background: #dc262622; color: #f87171; border: 1px solid #dc262644; }
.billing-plan-sub   { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.billing-plan-renew { font-size: 12px; color: var(--muted); opacity: .7; }

/* Barra de progresso do limite free */
.billing-plan-bar {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 6px;
  max-width: 180px;
}
.billing-plan-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width .3s;
}

/* Nota abaixo da row quando no free */
.billing-upgrade-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

/* Botao de upgrade — destaque mais forte que .ghost */
.btn-upgrade {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--accent);
  color: #0b0d12;
  font-weight: 700;
  font-size: 13px;
  border-radius: var(--r-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, transform .08s;
}
.btn-upgrade:hover  { background: var(--accent-2); text-decoration: none; }
.btn-upgrade:active { transform: translateY(1px); }

/* Modal de upgrade — overlay full-screen */
/* ── Modal de confirmação perigosa (apagar coleção) ─────────────────────── */
.danger-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9100;
  background: rgba(0, 0, 0, .75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn .18s ease;
}
.danger-modal {
  background: var(--surface);
  border: 1px solid rgba(239, 68, 68, .35);
  border-radius: 16px;
  padding: 28px 24px 24px;
  max-width: 380px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 24px 48px rgba(0,0,0,.6);
  animation: slideUp .2s ease;
}
.danger-modal-icon   { font-size: 34px; line-height: 1; text-align: center; }
.danger-modal-title  { font-size: 17px; font-weight: 700; color: var(--text); margin: 0; text-align: center; }
.danger-modal-body   { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.55; text-align: center; }
.danger-modal-body strong { color: var(--text); }
.danger-modal-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--panel-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color .15s;
}
.danger-modal-input:focus { outline: none; border-color: #ef4444; }
.danger-modal-error {
  font-size: 12px;
  color: #ef4444;
  text-align: center;
  padding: 4px 0;
}
.danger-modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.danger-modal-actions .ghost { flex: 1; }
.btn-danger {
  flex: 1;
  padding: 10px 16px;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: var(--r-pill);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}
.btn-danger:hover    { background: #dc2626; }
.btn-danger:disabled { opacity: .6; cursor: not-allowed; }

.upgrade-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, .65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn .18s ease;
}

.upgrade-modal {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 16px;
  padding: 32px 28px 24px;
  max-width: 420px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  box-shadow: 0 24px 48px rgba(0,0,0,.5);
  animation: slideUp .2s ease;
}

.upgrade-modal-icon   { font-size: 36px; line-height: 1; }
.upgrade-modal-title  { font-size: 17px; font-weight: 700; color: var(--text); margin: 0; }
.upgrade-modal-body   { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.55; }
.upgrade-modal-body strong { color: var(--text); }

.upgrade-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}

.upgrade-modal-btn-pro {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: var(--accent);
  color: #0b0d12;
  font-weight: 700;
  font-size: 14px;
  border-radius: var(--r);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .08s;
}
.upgrade-modal-btn-pro:hover  { background: var(--accent-2); text-decoration: none; }
.upgrade-modal-btn-pro:active { transform: translateY(1px); }

.upgrade-modal-btn-partial {
  padding: 10px;
  font-size: 13px;
}

.upgrade-modal-btn-cancel {
  padding: 10px;
  font-size: 13px;
  color: var(--muted);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Banner inline legado (mantido por compatibilidade, não usado no fluxo novo) */
.upgrade-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #1e293b;
  border: 1px solid var(--accent);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 16px;
  animation: fadeInDown .25s ease;
}
.upgrade-banner-icon { font-size: 24px; flex-shrink: 0; }
.upgrade-banner-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text);
}
.upgrade-banner-body strong { color: var(--text); }
.upgrade-banner-body span   { color: var(--muted); }

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Feed social (/feed)
   ============================================================ */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.feed-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  background: var(--surface);
  transition: background .12s;
}
.feed-card:hover { background: var(--surface-raised); }

.feed-card-img-wrap {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: var(--r-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-raised);
  text-decoration: none;
}
.feed-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.feed-card-img-placeholder {
  color: var(--text-dim);
  font-size: 22px;
}

.feed-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.feed-card-who {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.feed-card-user {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
}
.feed-card-user:hover { text-decoration: underline; }
.feed-card-time {
  font-size: 11px;
  color: var(--text-dim);
}

.feed-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}
.feed-card-name:hover { color: var(--brand); }

.feed-card-meta {
  font-size: 12px;
  color: var(--text-dim);
}

.feed-stars {
  font-size: 12px;
  color: #f59e0b;
}

/* ============================================================
   Item público (/u/:username/item/:itemId)
   ============================================================ */
.item-pub-owner {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 6px;
}
.item-pub-stars {
  color: #f59e0b;
  font-size: 18px;
  margin-top: 6px;
}
.item-pub-meta {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.item-pub-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.item-pub-meta-row span:first-child { color: var(--text-dim); }
.item-pub-meta-row span:last-child  { font-weight: 600; }

/* Comentários */
.comment-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.comment-row:last-child { border-bottom: none; }
.comment-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.comment-user {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
}
.comment-user:hover { text-decoration: underline; }
.comment-time {
  font-size: 11px;
  color: var(--text-dim);
}
.comment-delete {
  margin-left: auto;
  padding: 2px 6px !important;
  font-size: 14px !important;
  line-height: 1;
  opacity: 0.5;
}
.comment-delete:hover { opacity: 1; }
.comment-body {
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.comment-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ---- Trending ---- */
.trending-section {
  margin-bottom: 20px;
}
.trending-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 10px;
}
.trending-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.trending-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.trending-rank {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  min-width: 16px;
  text-align: center;
  flex-shrink: 0;
}
.trending-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.trending-item-nome {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trending-item-sub {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trending-item-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}
.trending-count-label {
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
}
.trending-franchises {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.trending-franchise-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
}
.trending-franchise-name {
  font-size: 12px;
  color: var(--text);
}
.trending-franchise-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}
.trending-placeholder-label {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 14px;
  letter-spacing: .02em;
}
.trending-item--ghost {
  opacity: .32;
  pointer-events: none;
  user-select: none;
}
.trending-franchise-pill--ghost {
  opacity: .32;
  pointer-events: none;
  user-select: none;
}

/* ---- Descobrir — barra de busca ---- */
.discover-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border-2);
  border-radius: var(--r-pill);
  padding: 0 14px;
  margin: 14px 14px 0;
}
.discover-search-icon {
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.discover-search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  padding: 12px 0;
}
.discover-search-bar input::placeholder { color: var(--muted); }

/* ---- Descobrir — horizontal scroll de trending cards ---- */
.trending-cards-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.trending-cards-scroll::-webkit-scrollbar { display: none; }
.trending-card {
  flex-shrink: 0;
  width: 80px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-radius: 8px;
  overflow: hidden;
}
.trending-card-img {
  aspect-ratio: 3 / 4;
  background: var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.trending-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.trending-card-placeholder {
  font-size: 24px;
  color: var(--muted);
  opacity: .5;
}
.trending-card-info {
  padding: 6px 7px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.trending-card-nome {
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.trending-card-sub {
  font-size: 9px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trending-card-count {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 2px;
}

/* ---- Descobrir — franchise pill buttons ---- */
.trending-franchise-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.trending-franchise-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  background: var(--panel);
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background .15s;
}
.trending-franchise-btn:hover { background: var(--panel-2); }
.trending-franchise-btn.active {
  background: var(--accent);
  color: #fff;
}
.trending-franchise-btn.active .trending-franchise-badge { color: rgba(255,255,255,0.75); }
.trending-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 12px 4px;
}
.trending-franchise-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
}

/* ---- Descobrir — cards de colecionador ---- */
.discover-user-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}
.discover-user-row:last-child { border-bottom: none; }
.discover-user-row:hover .discover-name { color: var(--brand); }
.discover-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}
.discover-info { flex: 1; min-width: 0; }
.discover-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  transition: color .15s;
}
.discover-meta {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}
.discover-bio {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ---- Wishlist → Coleção: card de promoção ---- */
.wishlist-promote-card {
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
  border-radius: var(--r);
  padding: 16px;
  text-align: center;
  margin-top: 12px;
}
.wishlist-promote-hint {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0 0 12px;
}
.wishlist-promote-btn {
  width: 100%;
  font-size: 15px;
  padding: 12px 20px;
}

/* ---- Overlay de celebração "Desejo realizado" ---- */
@keyframes desejo-in  { from { opacity:0; } to { opacity:1; } }
@keyframes desejo-pop { from { transform:scale(.7); opacity:0; } 60% { transform:scale(1.08); } to { transform:scale(1); opacity:1; } }

.desejo-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9990;
  animation: desejo-in .25s ease;
  cursor: pointer;
}
.desejo-overlay.desejo-out { animation: desejo-in .3s ease reverse forwards; }
.desejo-box {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 36px 28px;
  text-align: center;
  max-width: 320px;
  width: 90%;
  animation: desejo-pop .4s cubic-bezier(.22,.68,0,1.2);
  cursor: default;
}
.desejo-emoji {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 16px;
}
.desejo-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}
.desejo-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}
.desejo-cta {
  width: 100%;
}

/* ─── Feed Social ─────────────────────────────────────── */
.feed-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 20px 0 14px;
}
.feed-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}
.feed-count {
  font-size: 12px;
  color: var(--muted);
}
.feed-loading {
  display: flex;
  justify-content: center;
  padding: 40px 0;
}
.feed-posts {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 24px;
}

/* Post card */
.feed-post {
  background: var(--panel);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 16px;
}
.feed-post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}
.feed-post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--panel-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
  border: 2px solid var(--border-2);
}
.feed-post-who {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.feed-post-username {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.feed-post-username:hover { color: var(--accent); }
.feed-post-time {
  font-size: 11px;
  color: var(--muted);
}
.feed-follow-btn {
  font-size: 13px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
  font-family: var(--font-body);
  flex-shrink: 0;
}
.feed-follow-btn:hover { opacity: .85; }
.feed-follow-btn.following { background: var(--panel-3); color: var(--muted); pointer-events: none; }

/* Badge "Sugerido" — aparece inline ao lado do tempo no cabeçalho */
.feed-suggested-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.85;
}

/* Imagem do post — quadrada 1:1 (Instagram clássico) */
.feed-post-img-wrap {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--panel-3);
  text-decoration: none;
}
.feed-post-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Placeholder quando não há imagem */
.feed-post-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}
.feed-post-placeholder-icon {
  width: 40px;
  height: 40px;
  color: var(--muted);
  opacity: 0.3;
}

/* Ações: like + comentário — logo abaixo da imagem */
.feed-post-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 6px;
}
.feed-like-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  font-family: var(--font-body);
  transition: color 0.15s;
}
.feed-like-btn:hover { color: #e0245e; }
.feed-like-btn.liked  { color: #e0245e; }
.feed-like-count {
  font-size: 13px;
  font-weight: 600;
  min-width: 14px;
}
.feed-comment-btn {
  display: flex;
  align-items: center;
  color: var(--muted);
  transition: color 0.15s;
}
.feed-comment-btn:hover { color: var(--text); }

/* Info: nome · preço · estrelas */
.feed-post-body {
  padding: 2px 14px 14px;
}
.feed-post-name {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  line-height: 1.3;
  margin-bottom: 4px;
}
.feed-post-name:hover { color: var(--accent); }
.feed-post-sub {
  display: flex;
  align-items: center;
  gap: 10px;
}
.feed-post-price {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
}
.feed-post-price-label {
  font-weight: 400;
  color: var(--gold);
  opacity: .75;
}
.feed-post-fabricante {
  color: var(--muted);
  font-weight: 500;
}
.feed-post-avatar--catalog {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  font-size: 12px;
}
.feed-catalog-cta {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feed-catalog-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border-radius: var(--r);
  border: 1.5px solid var(--border-2);
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-body);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.feed-catalog-cta-btn:hover,
.feed-catalog-cta-btn.active { border-color: var(--accent); color: var(--accent); }
.feed-search-panel {
  display: none;
  flex-direction: column;
  gap: 4px;
}
.feed-catalog-cta.search-open .feed-search-panel {
  display: flex;
}
.feed-search-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel-2);
  border: 1.5px solid var(--border-2);
  border-radius: var(--r-sm);
  padding: 0 12px;
}
.feed-search-icon { color: var(--muted); flex-shrink: 0; }
.feed-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 11px 0;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text);
}
.feed-search-input::placeholder { color: var(--muted); }
.feed-search-results { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.feed-search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--panel-2);
  border-radius: var(--r-sm);
}
.feed-search-result-info { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.feed-search-empty { font-size: 13px; color: var(--muted); text-align: center; padding: 12px 0; }
.feed-post--catalog .feed-post-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================
   Scan-line — container de identificação com linha animada
   ============================================================ */
.identify-scanning {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: var(--panel-2);
  padding: 28px 20px;
  text-align: center;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.identify-scanning::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: var(--scan-line);
  box-shadow: 0 0 8px var(--scan-line);
  animation: scanMove 1.5s linear infinite;
  border-radius: 1px;
}
.identify-scanning .scan-label {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

/* ============================================================
   Scan overlay — linha animada sobreposta à foto de preview
   ============================================================ */
.scan-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
  border-radius: 8px;
}
.scan-line-bar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(255, 77, 0, 0.9), 0 0 20px rgba(255, 77, 0, 0.4);
  animation: scanMove 1.5s linear infinite;
  border-radius: 1px;
}
.scan-line-bar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 2px;
  height: 48px;
  background: linear-gradient(to bottom, rgba(255, 77, 0, 0.18), transparent);
}

/* Status de scan simples abaixo da foto (substitui o card animado) */
.scan-status-text {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 14px 0 4px;
}

/* ============================================================
   Reveal card — spring entry para cards identificados
   ============================================================ */
.item-card--reveal {
  animation: springUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Thumbnail pequeno no header do card (substitui card-preview full-width) */
.card-thumb {
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--panel-3);
  border: 1px solid var(--border);
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Header do card: nome+badge à esquerda, thumbnail à direita */
.item-head-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Cabeçalho limpo pós-identificação: "✓ N figura(s) identificada(s)" */
.identify-count-header {
  font-size: 14px;
  font-weight: 600;
  color: var(--ok);
  padding: 0 0 10px;
}

/* Bloco compacto de info-chave no card de staging (fabricante + preço) */
.item-key-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.item-key-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.item-key-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.item-key-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.item-key-price { color: var(--gold); }
.est-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  background: var(--panel-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xs);
  padding: 1px 5px;
  letter-spacing: 0.03em;
  vertical-align: middle;
  margin-left: 4px;
}

/* Separador visual entre os CTAs e os campos editáveis */
.item-card .fields {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Botões de ação primários — grandes, lado a lado */
.item-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  justify-content: stretch;
}
.item-actions > button {
  flex: 1;
  padding: 13px 12px;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--r);
  cursor: pointer;
  font-family: var(--font-body);
  line-height: 1;
}
.item-actions > [data-action="commit-owned"] {
  background: var(--accent);
  color: #fff;
  border: none;
}
.item-actions > [data-action="commit-wishlist"] {
  background: transparent;
  border: 1.5px solid var(--border-2);
  color: var(--text);
}
.item-actions > [data-action="commit-owned"]:hover  { opacity: .88; }
.item-actions > [data-action="commit-wishlist"]:hover { border-color: var(--accent); color: var(--accent); }

/* Estado validado — botões menores de mudança de destino */
.item-card.validated .item-actions > button {
  padding: 10px 12px;
  font-size: 13px;
}

/* Ações secundárias (descartar) — discretas abaixo dos botões principais */
.item-actions-secondary {
  display: flex;
  gap: 16px;
  margin-top: 6px;
  justify-content: center;
}
.item-actions-secondary button {
  font-size: 12px;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  font-family: var(--font-body);
  transition: color 0.15s;
}
.item-actions-secondary button:hover { color: var(--text); }
.item-actions-secondary .card-discard-btn {
  border: none;
  padding: 4px 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}

/* Confidence badge colorido por threshold */
.badge.confidence-high   { background: rgba(76, 175, 125, .15); color: var(--success); }
.badge.confidence-medium { background: rgba(245, 166, 35, .15); color: var(--warning); }
.badge.confidence-low    { background: rgba(229, 57, 53, .15);  color: var(--error); }

/* ============================================================
   Celebration toast — feedback efêmero pós-commit
   ============================================================ */
.fig-toast-container {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.fig-toast {
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-pill);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
  animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  white-space: nowrap;
}
.fig-toast.toast-out {
  animation: toastOut 0.3s ease forwards;
}

/* ============================================================
   Home — valor total em destaque
   ============================================================ */
/* ---- Home brand bar ---- */
.home-brand-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0 8px;
}
.home-brand-mark {
  width: 20px;
  height: 20px;
  display: block;
}
.home-brand-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
}

.home-portfolio-value {
  padding: 16px 20px 20px;
  margin-bottom: 12px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.home-stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.home-portfolio-value .portfolio-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 4px;
}
.home-portfolio-value .portfolio-amount {
  font-size: 34px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: -1px;
  line-height: 1;
}
.home-portfolio-value .portfolio-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
}
.home-portfolio-value .portfolio-delta.gain { color: var(--success); }
.home-portfolio-value .portfolio-delta.loss { color: var(--error); }

/* ============================================================
   Grid editorial 3-col (Letterboxd-style) — modo compacto
   ============================================================ */
#collectionList.view-compact {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
#collectionList.view-compact .coll-item {
  /* esconde detalhes textuais */
  display: block;
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--panel-2);
  border: 1px solid var(--border);
  cursor: pointer;
}
#collectionList.view-compact .coll-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
#collectionList.view-compact .coll-item-compact-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, transparent 50%);
  opacity: 0;
  transition: opacity .2s;
  display: flex;
  align-items: flex-end;
  padding: 8px;
}
#collectionList.view-compact .coll-item:hover .coll-item-compact-overlay,
#collectionList.view-compact .coll-item:focus .coll-item-compact-overlay {
  opacity: 1;
}
#collectionList.view-compact .coll-item-compact-name {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}
/* Mobile tap: sempre visível no touch */
@media (hover: none) {
  #collectionList.view-compact .coll-item-compact-overlay { opacity: 1; }
}

/* ============================================================
   Editable hints — chips e campos contenteditable
   ============================================================ */
.chip--editable {
  padding-right: 26px;
  position: relative;
}
.chip--editable::after {
  content: "✏";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--muted);
  opacity: 0.65;
  pointer-events: none;
}
.chip--editable:hover { border-color: var(--accent); }
.chip--editable:focus { border-color: var(--accent); outline: none; }

/* Hint "Toque em qualquer campo para editar" — detalhe do item */
.edit-hint-text {
  font-size: 11px;
  color: var(--muted);
  margin: -4px 0 16px;
  opacity: 0.65;
}

/* Badge de proveniência de preço — "estimativa IA" / "manual" */
.price-source-badge {
  font-size: 9px;
  color: var(--warning);
  margin-left: 5px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* Micro-copy de contribuição ao catálogo (adicionar.js staging) */
.catalog-contrib-hint {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  padding: 4px 0 16px;
}

/* Grid 2-col para trending items (descobrir) */
.trending-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.trending-cards-grid .trending-card {
  width: auto;
  flex-shrink: unset;
}

/* ============================================================
   Save micro-celebration — feedback batch save
   ============================================================ */
.save-celebration {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--success);
  animation: springUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.save-celebration svg {
  width: 16px;
  height: 16px;
}

/* ============================================================
   Empty states acolhedores
   ============================================================ */
.empty-state-rich {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
  gap: 12px;
}
.empty-state-rich .empty-icon {
  font-size: 48px;
  line-height: 1;
}
.empty-state-rich .empty-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.empty-state-rich .empty-sub {
  font-size: 14px;
  color: var(--muted);
  max-width: 260px;
  line-height: 1.5;
  margin: 0;
}
.empty-state-rich .empty-cta {
  margin-top: 4px;
  display: inline-block;
  padding: 10px 22px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: background .15s;
}
.empty-state-rich .empty-cta:hover { background: var(--accent-2); }

/* ============================================================
   Avatar com inicial — fallback quando sem foto de perfil
   ============================================================ */
.avatar-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  text-transform: uppercase;
  border: 1.5px solid var(--border-2);
}

/* ============================================================
   Spinner ritual — loading de IA com mensagem viva
   ============================================================ */
.ai-spinner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.ai-spinner .spinner {
  color: var(--accent);
}
.ai-spinner strong {
  color: var(--accent);
  font-weight: 700;
}

/* ============================================================
   Stars — filled em orange (accent), vazio em muted
   ============================================================ */
.star-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 3px;
  transition: color .1s, transform .1s;
  line-height: 1;
  font-family: inherit;
}
.star-btn.filled { color: var(--accent); }
.star-btn.hover  { color: var(--accent); opacity: .7; }
.star-btn:hover  { transform: scale(1.12); }

/* ============================================================
   Revelation toast — item que mais valorizou (home)
   ============================================================ */
.revelation-toast {
  background: linear-gradient(135deg, rgba(255,215,0,.07), rgba(212,168,67,.04));
  border: 1px solid rgba(255,215,0,.18);
  border-radius: var(--r);
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color .15s;
}
.revelation-toast:hover { border-color: rgba(255,215,0,.35); }
.revelation-icon { font-size: 20px; flex-shrink: 0; }
.revelation-body { flex: 1; min-width: 0; }
.revelation-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--revelation);
  line-height: 1.3;
}
.revelation-sub  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.revelation-share {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

/* ============================================================
   Ranking — top 5 valorizações (home)
   ============================================================ */
/* ── Home: card de destaque (item que mais valorizou) ────────────── */
.home-destaque-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 77, 0, .10);
  border: 1px solid rgba(255, 77, 0, .22);
  border-radius: var(--r);
  padding: 14px 16px;
  margin-bottom: 14px;
  text-decoration: none;
  color: inherit;
  transition: background .15s, opacity .15s;
}
.home-destaque-card:hover { background: rgba(255, 77, 0, .16); }
.home-destaque-icon {
  font-size: 28px;
  flex-shrink: 0;
  line-height: 1;
}
.home-destaque-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.home-destaque-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.3;
}
.home-destaque-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.home-destaque-arrow {
  font-size: 20px;
  color: var(--accent);
  flex-shrink: 0;
  opacity: .8;
}

.ranking-block {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.ranking-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  margin-bottom: 10px;
}
.ranking-list { display: flex; flex-direction: column; gap: 0; }
.ranking-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: opacity .15s;
}
.ranking-row:last-child { border-bottom: none; }
.ranking-row:hover { opacity: .75; }
.ranking-pos {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}
.ranking-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ranking-gain {
  font-size: 13px;
  font-weight: 700;
  color: var(--gain);
  flex-shrink: 0;
}

/* ---- Home breakdown: Franquias + Fabricantes ---- */
.home-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
  margin-bottom: 24px;
}
.home-breakdown-col-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin-bottom: 10px;
}
.home-breakdown-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}
.home-breakdown-label {
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 70px;
  flex-shrink: 0;
}
.home-breakdown-bar-wrap {
  flex: 1;
  height: 4px;
  background: var(--panel-3);
  border-radius: 2px;
  overflow: hidden;
}
.home-breakdown-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width .4s ease;
}
.home-breakdown-meta {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 42px;
  text-align: right;
}

/* ============================================================
   Price metric grid — 3 cards: Pago | Mercado | Retorno
   ============================================================ */
.detail-prices-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.price-metric-card {
  background: var(--panel-2);
  border-radius: var(--r-sm);
  padding: 10px 10px 8px;
  text-align: center;
}
.price-metric-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  margin-bottom: 5px;
}
.price-metric-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: block;
  border-bottom: 1px dashed var(--border-2);
  padding-bottom: 2px;
  background: transparent;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  text-align: center;
  width: 100%;
  cursor: text;
  outline: none;
  font-family: inherit;
}
.price-metric-value:focus { border-color: var(--accent); }
.price-metric-value.price-chip--market { color: var(--gold); }
.price-metric-return {
  font-size: 15px;
  font-weight: 700;
}
.price-metric-return.gain { color: var(--gain); }
.price-metric-return.loss { color: var(--loss); }

/* Lançamento row — secundário abaixo do grid */
.price-row--launch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   Price list — layout vertical (Dir 6 Minimal Drop)
   ============================================================ */
.price-list-header {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  margin-bottom: 10px;
}
.price-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.price-list-row:last-child { border-bottom: none; }
.price-list-label {
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}
.price-list-value-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.price-list-retorno {
  font-size: 13px;
  font-weight: 700;
}
.price-list-retorno.gain { color: var(--gain); }
.price-list-retorno.loss { color: var(--loss); }
.price-list-row--retorno { border-bottom: none; padding-top: 8px; }

/* price-chip editable hint in list rows */
.price-chip--editable {
  border-bottom: 1px dashed var(--border-2);
  cursor: text;
}
.price-chip--editable:focus { border-color: var(--accent); outline: none; }
.estimate-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--warning);
  background: rgba(245,166,35,.12);
  border-radius: var(--r-pill);
  padding: 2px 7px;
  flex-shrink: 0;
}
.detail-edit-hint {
  font-size: 11px;
  color: var(--muted);
  padding: 6px 0 10px;
  opacity: .7;
}

/* ---- Detalhe — lista vertical de preços ---- */
.detail-prices-header {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: 4px;
}
.detail-price-list {
  display: flex;
  flex-direction: column;
}
.detail-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.detail-price-row:last-child { border-bottom: none; }
.detail-price-lbl {
  font-size: 14px;
  color: var(--muted);
  flex-shrink: 0;
}
.detail-price-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.detail-price-return {
  font-size: 14px;
  font-weight: 700;
}
.detail-price-return.gain { color: var(--gain); }
.detail-price-return.loss { color: var(--loss); }
.detail-price-row--return .detail-price-lbl { color: var(--muted); }

/* ---- Jamais vendo ---- */
.jamais-vendo-wrap {
  padding: 0 16px 8px;
}
.jamais-vendo-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(168, 85, 247, .12);
  border: 1px solid rgba(168, 85, 247, .25);
  border-radius: var(--r);
  color: #A855F7;
  font-size: 15px;
  font-weight: 600;
}
.jamais-vendo-card span:first-child { font-size: 18px; }
.jamais-vendo-card span:nth-child(2) { flex: 1; }
.jamais-vendo-remove {
  background: transparent;
  border: none;
  color: rgba(168, 85, 247, .6);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.jamais-vendo-btn {
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: 1.5px dashed rgba(168, 85, 247, .3);
  border-radius: var(--r);
  color: rgba(168, 85, 247, .6);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, color .15s;
}
.jamais-vendo-btn:hover {
  border-color: rgba(168, 85, 247, .6);
  color: #A855F7;
}
