:root {
  color-scheme: dark;
  --bg: #0d0e12;
  --surface: #13151b;
  --panel: #181b22;
  --panel-strong: #20242d;
  --text: #f3f5f7;
  --muted: #9ba4b3;
  --subtle: #747d8d;
  --line: #2d333f;
  --accent: #39c79b;
  --accent-dark: #239872;
  --accent-soft: rgba(57, 199, 155, 0.13);
  --gold: #f0b84b;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  /* Reserva a calha da barra de rolagem sempre, para o conteúdo centralizado
     não deslocar entre páginas com e sem scroll (ex.: ao abrir o Início). */
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(57, 199, 155, 0.08), transparent 240px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

main {
  flex: 1 0 auto;
}

body.preview-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

.app-header {
  background: rgba(13, 14, 18, 0.92);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(14px);
}

.app-header-inner {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 12px 0;
}

.app-header-inner .brand {
  justify-self: start;
}

.app-header-inner .page-nav {
  justify-self: center;
  margin-inline: 0;
}

.app-header-inner .header-actions {
  justify-self: end;
  align-items: center;
}

/* Todos os controles do header com a mesma altura (42px). O .file-button é
   um <label>, então zera a margin-bottom herdada da regra global de labels. */
.app-header-inner .header-actions > button,
.app-header-inner .header-actions > .file-button,
.app-header-inner .lang-select {
  height: 42px;
  min-height: 42px;
  margin: 0;
}

/* Hambúrguer só aparece no mobile; no desktop o drawer é "transparente"
   (display: contents) e os filhos seguem no grid do header normalmente. */
.menu-toggle {
  display: none;
}

.nav-drawer {
  display: contents;
}

.brand {
  font-weight: 800;
  font-size: 17px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  flex: none;
}

.brand:hover {
  color: var(--accent);
}

.page-head {
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1;
}

main {
  width: min(1280px, calc(100% - 32px));
  margin: 22px auto 48px;
}

.page-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-inline: auto;
}

.page-nav a {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  text-decoration: none;
  font-weight: 800;
}

.page-nav a.active {
  background: var(--panel-strong);
  border-color: var(--line);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.header-actions,
.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
  padding: 16px;
  margin-bottom: 22px;
}

button,
.file-button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  padding: 0 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.secondary {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(57, 199, 155, 0.2);
}

.secondary:hover {
  background: rgba(57, 199, 155, 0.2);
}

.file-button input {
  display: none;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stats-grid article,
.toolbar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.stats-grid article {
  padding: 16px;
}

.stats-grid span {
  display: block;
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  color: var(--text);
}

.stats-grid p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.toolbar > div {
  min-width: 170px;
  flex: 1;
}

.search-box {
  flex: 2 1 280px;
}

/* Busca isolada no topo do corpo da página (estilo "Find a Product" do
   Collectr): barra larga com ícone, acima do título. */
.page-search {
  position: relative;
  margin-bottom: 18px;
}

.page-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--subtle);
  pointer-events: none;
}

.page-search input {
  width: 100%;
  height: 52px;
  padding: 0 16px 0 44px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 15px;
  box-shadow: var(--shadow);
}

.page-search input:focus {
  border-color: var(--accent-dark);
  outline: none;
}

.pokedex-toolbar {
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}

.pokedex-toolbar > div {
  flex: none;
  min-width: 0;
}

.toolbar-selects {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-selects > div {
  min-width: 170px;
  flex: 1;
}

.chip-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Ordenação: empurrada pro canto direito da barra de filtros. */
.toolbar > .sort-select {
  flex: 0 0 auto;
  min-width: 0;
  margin-left: auto;
}

/* Filtro de raridade: ocupa a linha inteira do toolbar (abaixo dos demais). */
.toolbar > .rarity-filter {
  flex: 1 1 100%;
}

.chip {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.chip:hover {
  border-color: var(--accent-dark);
  color: var(--text);
}

/* Chips de geração: menores para caberem numa linha só no desktop; quebram
   alinhados (mesmo gap) quando escalam pro celular. */
#generationChips { gap: 6px; }
#generationChips .chip {
  min-height: 32px;
  padding: 0 11px;
  font-size: 12.5px;
}

.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0c10;
}

/* Toggle segmentado (Todos | EN | JA...): trilho único com a opção ativa
   preenchida, no lugar de <select> para poucas opções. */
.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
}

.segmented-option {
  flex: 1;
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}

.segmented-option:hover {
  color: var(--text);
}

.segmented-option[aria-pressed="true"] {
  background: var(--accent);
  color: #0a0c10;
}

label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #101219;
  color: var(--text);
  padding: 0 12px;
}

input::placeholder {
  color: var(--subtle);
}

.results-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 14px;
}

.results-header h2 {
  margin-bottom: 0;
}

.results-header p {
  color: var(--muted);
  margin-bottom: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* Pokédex em 6 colunas fixas no desktop; abaixo disso volta a fluir
   conforme a largura. */
.card-grid[data-view="pokedex"] {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .card-grid[data-view="pokedex"] {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  }
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.pokedex-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 120ms ease, border-color 120ms ease;
}

.pokedex-card:hover {
  border-color: #414a58;
  transform: translateY(-2px);
}

/* Já tenho ao menos uma carta desse Pokémon: contorno dourado. */
.pokedex-card.owned {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), var(--shadow);
}

.pokedex-card.owned:hover {
  border-color: var(--gold);
}

.pokedex-link {
  min-height: 100%;
  color: inherit;
  display: grid;
  text-decoration: none;
  padding: 14px;
}

.pokedex-number {
  width: fit-content;
  border-radius: 999px;
  background: #242a35;
  color: var(--muted);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
}

.pokedex-image {
  height: 150px;
  display: grid;
  place-items: center;
  margin: 4px 0 10px;
}

.pokedex-image img {
  /* Sprite nativo de 96px: renderiza ampliado e nítido (pixel art), sem borrar. */
  width: 120px;
  height: 120px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.3));
}

.pokedex-info {
  margin-bottom: 12px;
}

.pokedex-info h3 {
  margin: 0 0 5px;
  font-size: 20px;
  line-height: 1.15;
}

.pokedex-info p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.card-image {
  aspect-ratio: 2.5 / 3.5;
  background: #11141b;
  display: grid;
  place-items: center;
  padding: 10px;
}

.card-image img,
.image-open {
  width: 100%;
  height: 100%;
}

/* Recorte do contorno da carta: raio proporcional aos cantos reais
   (≈4.8% x 3.4% numa carta 63x88mm) e leve zoom com overflow hidden para
   esconder a borda branca dos scans da API. */
.image-open {
  border: 0;
  border-radius: 4.8% / 3.4%;
  background: transparent;
  cursor: zoom-in;
  padding: 0;
  display: block;
  overflow: hidden;
}

.image-open img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4.8% / 3.4%;
  transform: scale(1.013);
}

.image-placeholder {
  color: var(--muted);
  font-weight: 800;
}

/* Verso de carta para quando nenhuma API tem a imagem. Mantém a proporção de
   carta (não quebra o layout) e avisa no topo. */
.card-back {
  position: relative;
  width: 100%;
  aspect-ratio: 245 / 337;
  display: grid;
  place-items: center;
  border-radius: 4.8% / 3.4%;
  background:
    radial-gradient(circle at 50% 60%, rgba(255, 255, 255, 0.06), transparent 55%),
    linear-gradient(160deg, #2a3a6b, #16213f 55%, #0e1730);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.card-back-art {
  width: 46%;
  max-width: 110px;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
}

.card-back-art svg {
  width: 100%;
  height: auto;
  display: block;
}

.card-back-label {
  position: absolute;
  top: 7%;
  left: 0;
  right: 0;
  text-align: center;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.card-body {
  padding: 14px;
}

.card-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.tag {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  background: #242a35;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.meta {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 12px;
}

.variant-quantities {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.variant-conditions {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #12151c;
  padding: 9px 10px;
}

.variant-conditions.owned {
  border-color: rgba(57, 199, 155, 0.45);
}

.variant-conditions-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.variant-row-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
}

.variant-total {
  margin-left: auto;
  color: var(--accent);
  font-weight: 800;
  font-size: 13px;
}

.condition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 6px;
}

.condition-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 4px 3px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #0f1218;
}

.condition-stepper.owned {
  border-color: rgba(57, 199, 155, 0.4);
}

.condition-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  cursor: help;
}

.condition-stepper.owned .condition-label {
  color: var(--accent);
}

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.qty-stepper button {
  min-height: 28px;
  width: 28px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  font-weight: 800;
  line-height: 1;
}

.qty-stepper button:hover:not(:disabled) {
  border-color: var(--accent-dark);
}

.qty-stepper button:disabled {
  opacity: 0.35;
  cursor: default;
}

.qty-value {
  min-width: 26px;
  text-align: center;
  font-weight: 800;
  color: var(--text);
}

.owned-toggle {
  width: 100%;
  background: var(--accent);
  color: #06110d;
}

.owned-toggle:hover {
  background: var(--accent-dark);
}

.owned-toggle[aria-pressed="true"] {
  background: #2c3540;
  color: var(--accent);
  border: 1px solid rgba(57, 199, 155, 0.28);
}

.owned-toggle.compact {
  width: auto;
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.details-link {
  min-height: 38px;
  margin-top: 12px;
  border-radius: 7px;
  background: #242a35;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
}

.details-link:hover {
  background: #2c3441;
}

.group-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  transition: transform 120ms ease, border-color 120ms ease;
}

.group-card:hover {
  transform: translateY(-2px);
}

.group-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.group-card-initial {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 20px;
  font-weight: 800;
}

.group-card-head h3 {
  margin: 0;
  min-width: 0;
}

.group-card-body {
  padding: 16px;
}

/* Cabeçalho de série na grade de Sets: ocupa a linha inteira, acima dos sets
   daquela coleção. Clicável → página da série. */
.set-series-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
}

.set-series-head:first-child {
  margin-top: 0;
}

.set-series-name {
  font-size: 20px;
  font-weight: 800;
}

.set-series-head:hover .set-series-name {
  color: var(--accent);
}

.set-series-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--subtle);
  white-space: nowrap;
}

/* Voltar pra lista completa de sets (página de uma série). */
.serie-back {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.serie-back:hover {
  color: var(--accent);
}

.set-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 120ms ease, border-color 120ms ease;
}

.set-card:hover,
.card:hover,
.group-card:hover {
  border-color: #414a58;
}

.set-card:hover {
  transform: translateY(-2px);
}

.set-art {
  min-height: 154px;
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.12), transparent 42%),
    #11141b;
  display: grid;
  place-items: center;
  padding: 22px;
  position: relative;
}

.set-release {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(13, 14, 18, 0.78);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  backdrop-filter: blur(4px);
  white-space: nowrap;
}

.set-logo {
  max-width: 88%;
  max-height: 96px;
  object-fit: contain;
}

.set-logo-placeholder {
  color: var(--muted);
  font-size: 20px;
  font-weight: 900;
  text-align: center;
}

.set-symbol {
  position: absolute;
  right: 14px;
  bottom: 12px;
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(18, 28, 45, 0.18));
}

.set-body {
  padding: 14px;
}

.set-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.set-title-row h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.set-meta {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.set-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.set-footer strong {
  color: var(--text);
  font-size: 16px;
}

/* Resumo da página de detalhe: hero do Pokémon/set + stats lado a lado (duas
   cápsulas) pra economizar espaço vertical. Sem hero (artista/treinador), os
   stats voltam a ocupar a largura toda. */
.detail-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.detail-summary.has-hero {
  grid-template-columns: minmax(0, 1fr) minmax(200px, 260px);
  align-items: stretch;
}

.detail-summary.has-hero .detail-stats {
  grid-template-columns: 1fr;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 18px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}

/* Dentro do resumo, hero e stats não levam a margem inferior própria. */
.detail-summary .detail-hero,
.detail-summary .detail-stats {
  margin-bottom: 0;
}

@media (max-width: 760px) {
  /* No mobile empilha e os stats voltam a 3 colunas. */
  .detail-summary.has-hero {
    grid-template-columns: 1fr;
  }
  .detail-summary.has-hero .detail-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.detail-hero h2 {
  margin-bottom: 8px;
  font-size: 28px;
  line-height: 1.1;
}

.detail-hero p {
  margin-bottom: 0;
  color: var(--muted);
}

.detail-set-art {
  border-radius: 6px;
  min-height: 120px;
}

.pokemon-hero-art {
  min-height: 160px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 28%, rgba(57, 199, 155, 0.16), transparent 48%),
    #11141b;
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 8px;
}

/* Navegação acima da foto: Voltar · Anterior · Próximo. */
.pokemon-hero-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.pokemon-hero-navbtn {
  flex: 1 1 auto;
  text-align: center;
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.pokemon-hero-navbtn:hover {
  border-color: var(--accent-dark);
  color: var(--text);
}
.pokemon-hero-navbtn.disabled {
  opacity: 0.4;
  pointer-events: none;
}
.pokemon-hero-art .pokemon-hero-image {
  margin: auto;
}

.pokemon-hero-image {
  max-width: 210px;
  max-height: 160px;
  object-fit: contain;
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.34));
}

.pokemon-hero-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.pokemon-hero-title {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.pokemon-hero-title .dex-num {
  color: var(--subtle);
  font-weight: 800;
}

.pokemon-hero-name {
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.type-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.type-badge {
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--type-color);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}

.pokemon-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.meta-pill {
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.pokemon-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.favorite-button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: 0 22px;
  gap: 8px;
}

.favorite-button:hover {
  border-color: var(--accent-dark);
}

.favorite-button[aria-pressed="true"] {
  border-color: #e0506a;
  color: #f08aa0;
}

.forms-toggle {
  background: transparent;
  border: 0;
  color: var(--accent);
  padding: 0;
  font-weight: 700;
}

.forms-toggle:hover {
  text-decoration: underline;
}

.forms-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.form-chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pokemon-hero-count {
  margin: 0;
  color: var(--subtle);
  font-size: 13px;
}

.group-card h3 {
  margin: 0 0 5px;
  font-size: 19px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: #242a35;
  overflow: hidden;
  margin-bottom: 14px;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.mini-card {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #12151c;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px;
}

.mini-card strong,
.mini-card span {
  display: block;
}

.mini-card strong {
  font-size: 14px;
  line-height: 1.2;
}

.mini-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.grid-sentinel {
  height: 1px;
}

.load-more {
  display: flex;
  margin: 16px auto 0;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  text-align: center;
  color: var(--muted);
}

.empty-state a {
  color: var(--accent);
}

.card-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 28px;
}

.card-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

.card-preview-panel {
  position: relative;
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  background: #111722;
  border: 1px solid #2b3443;
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58);
  display: grid;
  grid-template-columns: minmax(260px, 400px) 1fr;
  grid-template-rows: minmax(0, 1fr);
  gap: 28px;
  padding: 24px;
  overflow: hidden;
}

.preview-close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  border-radius: 50%;
  border: 1px solid #2b3443;
  background: rgba(17, 23, 34, 0.82);
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  padding: 0;
}

.preview-close:hover {
  color: var(--text);
  background: #1b2230;
}

.preview-image-wrap {
  display: grid;
  align-items: start;
  min-height: 0;
}

.preview-image-wrap img {
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  max-height: 100%;
  border-radius: 4.8% / 3.4%;
  filter: drop-shadow(0 20px 34px rgba(0, 0, 0, 0.42));
}

/* Só a coluna de detalhes rola quando o conteúdo passa da altura do painel —
   a imagem e a moldura do modal ficam sempre inteiras na tela. */
.preview-content {
  min-width: 0;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 14px;
  padding-right: 12px;
  overflow-y: auto;
}

.preview-content h2 {
  margin: 0 40px 6px 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
}

.preview-subtitle {
  color: var(--muted);
  margin-bottom: 0;
}

.preview-details {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #121923;
}

.preview-details h3 {
  margin: 0;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.preview-details dl {
  margin: 0;
}

.preview-details div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}

.preview-details div:last-child {
  border-bottom: 0;
}

.preview-details dt {
  color: var(--muted);
  font-weight: 700;
}

.preview-details dd {
  margin: 0;
  text-align: right;
  color: var(--text);
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* Ações da carta: linha com Compartilhar + Desejo e, abaixo, Marcar como
   tenho ocupando a largura inteira. */
.preview-actions {
  display: grid;
  gap: 10px;
}

.preview-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.preview-share,
.preview-want {
  gap: 8px;
  min-height: 46px;
  border-radius: 999px;
  font-size: 15px;
}

.preview-want.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.preview-owned {
  min-height: 46px;
  border-radius: 999px;
  font-size: 15px;
}

@media (max-width: 860px) {
  /* Header fixo no topo: marca à esquerda, hambúrguer à direita. A navegação
     e as ações ficam num drawer suspenso aberto pelo botão. */
  .app-header {
    position: sticky;
    top: 0;
  }

  .app-header-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 10px;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text);
  }

  /* Ícone de 3 tracinhos: barra do meio é o elemento, topo/baixo são pseudos. */
  .menu-toggle-bars {
    position: relative;
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: background 0.15s;
  }

  .menu-toggle-bars::before,
  .menu-toggle-bars::after {
    content: "";
    position: absolute;
    left: 0;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.15s, top 0.15s;
  }

  .menu-toggle-bars::before {
    top: -6px;
  }

  .menu-toggle-bars::after {
    top: 6px;
  }

  /* Aberto: vira um "X". */
  .app-header-inner.menu-open .menu-toggle-bars {
    background: transparent;
  }

  .app-header-inner.menu-open .menu-toggle-bars::before {
    top: 0;
    transform: rotate(45deg);
  }

  .app-header-inner.menu-open .menu-toggle-bars::after {
    top: 0;
    transform: rotate(-45deg);
  }

  /* Painel suspenso abaixo do header. */
  .nav-drawer {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    z-index: 20;
  }

  .app-header-inner.menu-open .nav-drawer {
    display: flex;
  }

  .app-header-inner .page-nav {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 4px;
  }

  .app-header-inner .page-nav > a,
  .app-header-inner .nav-group-toggle {
    justify-content: flex-start;
    width: 100%;
  }

  /* Submenu "Pokémon" expande dentro do drawer, sem flutuar. */
  .app-header-inner .nav-group {
    width: 100%;
  }

  .app-header-inner .nav-dropdown:not([hidden]) {
    position: static;
    box-shadow: none;
    margin-top: 4px;
  }

  .app-header-inner .header-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 8px;
    padding: 0;
    margin: 0;
  }
}

@media (max-width: 720px) {
  .header-actions {
    flex: 1;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  /* No mobile a grade de cartas fica com 2 colunas em vez de 1. */
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .toolbar {
    display: grid;
  }

  .group-grid {
    grid-template-columns: 1fr;
  }

  .detail-hero {
    grid-template-columns: 1fr;
  }

  .card-preview-modal {
    /* Alinha ao topo e respeita a safe-area, pra barra do navegador/notch
       não cobrir o topo da carta. */
    align-items: start;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 14px calc(14px + env(safe-area-inset-bottom, 0px));
  }

  /* Empilhado (imagem em cima), volta a rolar o painel inteiro. */
  .card-preview-panel {
    width: calc(100vw - 20px);
    /* dvh = altura real visível no mobile (desconta a barra do navegador);
       vh fica como fallback para browsers antigos. */
    max-height: calc(100vh - 28px);
    max-height: calc(100dvh - 28px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: 18px;
    padding: 18px;
    border-radius: 14px;
    overflow: auto;
  }

  .preview-content {
    overflow-y: visible;
  }

  /* O painel inteiro rola no mobile, então o botão fica fixo na viewport
     para continuar acessível enquanto o usuário desce até os detalhes. */
  .preview-close {
    position: fixed;
    top: calc(14px + env(safe-area-inset-top, 0px));
    right: 20px;
    z-index: 60;
    width: 44px;
    height: 44px;
    min-height: 44px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  }

  .preview-image-wrap img {
    max-height: 58vh;
  }

  .preview-details div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .preview-details dd {
    text-align: left;
  }
}

/* Home / landing */
.home {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 7px;
  background: var(--accent);
  color: #0a0c10;
  font-weight: 700;
  text-decoration: none;
}

.button-link:hover {
  background: var(--accent-dark);
  color: #0a0c10;
}

.home-main {
  width: min(1280px, calc(100% - 32px));
  margin: 22px auto 0;
  flex: 1;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 36px;
  align-items: center;
  padding: 44px 0 36px;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.12;
  margin: 10px 0 16px;
}

.accent {
  color: var(--accent);
}

.hero-sub {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
  max-width: 52ch;
  margin: 0;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 24px 0 12px;
}

.cta {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 9px;
  background: var(--accent);
  color: #0a0c10;
  font-weight: 800;
  text-decoration: none;
}

.cta:hover {
  background: var(--accent-dark);
}

.secondary-cta {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(57, 199, 155, 0.25);
}

.secondary-cta:hover {
  background: rgba(57, 199, 155, 0.2);
  color: var(--accent);
}

.hero-note {
  color: var(--subtle);
  font-size: 13px;
  margin: 0;
}

.hero-cards {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 0;
}

.hero-cards img {
  width: clamp(120px, 13vw, 160px);
  border-radius: 4.8% / 3.4%;
  box-shadow: var(--shadow);
}

.hero-cards img:nth-child(1) {
  transform: rotate(-9deg) translateX(20px) translateY(8px);
}

.hero-cards img:nth-child(2) {
  position: relative;
  z-index: 1;
  transform: translateY(-10px);
}

.hero-cards img:nth-child(3) {
  transform: rotate(9deg) translateX(-20px) translateY(8px);
}

.home-features h2,
.home-steps h2 {
  font-size: 24px;
  margin: 44px 0 18px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.feature-grid article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
}

.feature-grid h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.feature-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
}

.steps li {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
}

.steps li span {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  margin-bottom: 10px;
}

.steps h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

/* Home: manifesto "por que existe" */
.home-why h2 {
  font-size: 24px;
  margin: 44px 0 10px;
}

.home-why-lead {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
  max-width: 70ch;
  margin: 0 0 18px;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.why-grid article {
  background: var(--accent-soft);
  border: 1px solid rgba(57, 199, 155, 0.22);
  border-radius: 10px;
  padding: 18px;
}

.why-grid h3 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--accent);
}

.why-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

/* Home: roadmap aberto */
.home-roadmap h2 {
  font-size: 24px;
  margin: 44px 0 6px;
}

.home-roadmap-sub {
  color: var(--subtle);
  font-size: 14px;
  margin: 0 0 18px;
}

.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.roadmap-grid article {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  padding: 16px 18px;
}

.roadmap-grid h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.roadmap-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.roadmap-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.roadmap-link:hover {
  text-decoration: underline;
}

/* Home: apoie o projeto (café / Pix / GitHub) */
.home-support {
  margin-top: 44px;
}

.support-card {
  background: linear-gradient(135deg, var(--accent-soft), rgba(240, 184, 75, 0.1));
  border: 1px solid rgba(57, 199, 155, 0.25);
  border-radius: 14px;
  padding: 28px 24px;
  text-align: center;
}

.support-card h2 {
  font-size: 22px;
  margin: 0 0 10px;
}

.support-body {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  max-width: 56ch;
  margin: 0 auto 20px;
}

.support-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.support-actions .cta {
  cursor: pointer;
  border: none;
  font-size: 14px;
}

#pixButton.copied {
  background: var(--accent-dark);
}

.support-note {
  color: var(--subtle);
  font-size: 12.5px;
  margin: 18px 0 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
}

.site-footer-inner {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 34px;
  text-align: center;
  color: var(--subtle);
  font-size: 12.5px;
  line-height: 1.6;
}

.site-footer-inner p {
  margin: 0 0 7px;
}

.site-footer-inner p:last-child {
  margin-bottom: 0;
}

.site-footer-inner a {
  color: var(--muted);
}

.site-footer-inner a:hover {
  color: var(--accent);
}

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 24px;
  }

  .hero-cards {
    order: -1;
  }

  .hero-cards img {
    width: clamp(96px, 24vw, 130px);
  }
}

/* Seletor de idioma do site */
.lang-select {
  width: auto;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--panel);
}

/* Pílula de idioma das cartas: bandeira + select (estilo do seletor de moeda
   do Collectr). O select por dentro fica sem borda/fundo próprios. */
/* Seletor de idioma de carta: dropdown customizado, colapsado só com a
   bandeira (estilo Collectr, mas simplificado). */
.lang-dd {
  position: relative;
}

.lang-dd-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 42px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
}

.lang-dd-toggle:hover {
  border-color: var(--accent-dark);
}

.lang-dd-caret {
  font-size: 11px;
  color: var(--subtle);
}

.lang-dd .card-flag {
  flex: none;
}

.card-flag-globe {
  width: 16px;
  height: 16px;
  background: transparent;
  color: var(--muted);
  border-radius: 0;
}

.lang-dd-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  min-width: 150px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.lang-dd-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}

.lang-dd-option:hover {
  background: var(--panel);
  color: var(--text);
}

.lang-dd-option.active {
  color: var(--accent);
}

/* Controles do header como pílulas arredondadas (Exportar/Importar). */
.app-header-inner .header-actions > button,
.app-header-inner .header-actions > .file-button,
.app-header-inner .header-actions > .export-dd > button {
  border-radius: 999px;
}

/* Itens do menu de exportar são texto puro (sem bandeira), alinhados à esquerda. */
.export-dd .lang-dd-menu {
  min-width: 170px;
}


/* Coleção: abas e visão de progresso por grupo */
.collection-subtitle {
  color: var(--muted);
  margin: -6px 0 16px;
}

.collection-tabs {
  margin-bottom: 18px;
}

.group-summary {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 14px;
}

.group-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.summary-pct {
  color: var(--accent);
  font-weight: 800;
}

.sort-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.sort-row .chip {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.progress-row-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.progress-row {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: border-color 120ms ease, transform 120ms ease;
}

a.progress-row:hover {
  border-color: #414a58;
  transform: translateY(-2px);
}

.progress-row-art {
  width: 52px;
  height: 52px;
  flex: none;
  display: grid;
  place-items: center;
  background: #11141b;
  border-radius: 8px;
  overflow: hidden;
}

.progress-row-art img {
  max-width: 48px;
  max-height: 48px;
  object-fit: contain;
}

.progress-row-initial {
  font-weight: 800;
  color: var(--muted);
  font-size: 18px;
}

.progress-row-body {
  flex: 1;
  min-width: 0;
}

.progress-row-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 7px;
}

.progress-row-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dex-tag {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 800;
}

.row-count {
  margin-left: auto;
  flex: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.progress-row-meta {
  margin: 7px 0 0;
  color: var(--subtle);
  font-size: 12px;
}

/* Tile minimalista de carta (imagem em destaque, estilo binderbuilder) */
.card-tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.card-tile.owned {
  border-color: rgba(57, 199, 155, 0.55);
  box-shadow: 0 0 0 1px rgba(57, 199, 155, 0.25), var(--shadow);
}

/* Visão "Sua coleção": cartas que você não tem ficam em preto e branco; as
   que você tem ficam coloridas. Só a imagem é dessaturada (botões intactos). */
.card-grid.scope-collection .card-tile:not(.owned) .card-image {
  filter: grayscale(1);
  opacity: 0.68;
}

.card-tile .card-image {
  padding: 8px 8px 0;
  background: transparent;
  aspect-ratio: auto;
}

.card-tile .image-open img {
  border-radius: 4.8% / 3.4%;
  /* Proporção padrão de carta: reserva o espaço antes da imagem carregar,
     evitando o layout "pular" enquanto a grade baixa as miniaturas. */
  width: 100%;
  aspect-ratio: 245 / 337;
  object-fit: contain;
}

.tile-info {
  padding: 10px 12px 12px;
}

.tile-info h3 {
  margin: 0 0 2px;
  font-size: 15px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-variant {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #7aa2ff;
}

.variant-holo,
.variant-holofoil {
  color: #c084fc;
}

.variant-reverse {
  color: #f0b84b;
}

.variant-1st-edition {
  color: #fbbf24;
}

.variant-unlimited {
  color: #9ba4b3;
}

.tile-set {
  margin: 0 0 10px;
  color: var(--subtle);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Ações da carta (querer / coleção) sozinhas na própria linha, à direita. */
.tile-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.tile-btn {
  position: relative;
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tile-btn:hover:not(:disabled) {
  border-color: var(--accent-dark);
  color: var(--text);
}

.tile-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.tile-own.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* Preço BR por condição (no preview da carta) */
.price-row {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.price-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.price-row-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.price-updated {
  font-size: 11px;
  color: var(--subtle);
}

.price-cells {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 6px;
}

.price-cell {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
  border-radius: 6px;
  background: #0f1218;
}

.price-cell span {
  font-size: 11px;
  font-weight: 800;
  color: var(--subtle);
}

.price-cell input {
  width: 100%;
  min-width: 0;
  min-height: 26px;
  padding: 0 4px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  text-align: right;
}

.price-cell input:focus {
  border-color: var(--accent-dark);
  background: var(--panel-strong);
  outline: none;
}

/* Links para conferir preço nos marketplaces BR */
/* Cotação de mercado (preview) — cards por moeda com MÍN/MEDIANA/MÁX. */
.market-quote-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 0 8px;
}

.market-quote-head h3 {
  margin: 0;
  font-size: 15px;
}

.market-updated {
  font-size: 11px;
  color: var(--subtle);
}

.market-loading {
  margin: 0;
  font-size: 12.5px;
  color: var(--subtle);
}

.market-finish + .market-finish {
  margin-top: 10px;
}

.market-finish-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--subtle);
  margin-bottom: 6px;
}

.market-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}

.market-card {
  background: var(--accent-soft);
  border: 1px solid rgba(57, 199, 155, 0.18);
  border-radius: 10px;
  padding: 10px 13px;
}

.market-card-cur {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.market-cells {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.market-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.market-cell span {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--subtle);
}

.market-cell strong {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.market-cell.med strong {
  color: var(--accent);
}

.market-source {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--subtle);
  line-height: 1.5;
}

/* Mercado BR / EUA: grade rótulo | chips para os chips alinharem entre as
   linhas (a coluna do rótulo tem a largura do maior rótulo). */
.market-links {
  display: grid;
  grid-template-columns: max-content 1fr;
  align-items: center;
  gap: 8px 12px;
  margin-top: 10px;
}

.br-links-label {
  font-size: 12px;
  color: var(--subtle);
}

.br-links-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.br-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.br-link:hover {
  color: var(--accent);
  border-color: var(--accent-dark);
}

/* Portfólio: tabela de cartas mais valiosas */
.portfolio-table-wrap {
  overflow-x: auto;
}

.portfolio-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  font-size: 14px;
}

.portfolio-table th,
.portfolio-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.portfolio-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--subtle);
  background: var(--surface);
}

.portfolio-table tr:last-child td {
  border-bottom: none;
}

.portfolio-table .num {
  text-align: right;
  white-space: nowrap;
}

.portfolio-table a {
  color: var(--text);
  text-decoration: none;
}

.portfolio-table a:hover {
  color: var(--accent);
}

.price-estimated {
  color: var(--gold);
  cursor: help;
}

.portfolio-note {
  margin: 14px 0 0;
  color: var(--subtle);
  font-size: 12.5px;
  line-height: 1.6;
}

.tile-want:hover:not(:disabled) {
  border-color: #f0719a;
  color: #f0719a;
}

.tile-want.active {
  border-color: #f0719a;
  background: rgba(240, 113, 154, 0.14);
  color: #f0719a;
}

.card-tile.wanted {
  border-color: rgba(240, 113, 154, 0.5);
  box-shadow: 0 0 0 1px rgba(240, 113, 154, 0.22), var(--shadow);
}

.card-tile.owned.wanted {
  border-color: rgba(57, 199, 155, 0.55);
  box-shadow: 0 0 0 1px rgba(57, 199, 155, 0.25), var(--shadow);
}

.tile-qty {
  position: absolute;
  top: -7px;
  right: -7px;
  background: var(--accent);
  color: #0a0c10;
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
  padding: 2px 5px;
  line-height: 1;
}

/* Submenu Pokémon na navegação */
.nav-group {
  position: relative;
}

.nav-group-toggle {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  font-weight: 800;
}

.nav-group-toggle:hover {
  color: var(--text);
}

.nav-group-toggle.active {
  background: var(--panel-strong);
  border-color: var(--line);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.nav-caret {
  font-size: 10px;
  line-height: 1;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 170px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
  display: grid;
  gap: 2px;
  z-index: 20;
  box-shadow: var(--shadow);
}

.nav-dropdown[hidden] {
  display: none;
}

.page-nav .nav-dropdown a {
  justify-content: flex-start;
}

.page-nav .nav-dropdown a.active {
  background: var(--panel);
}

.page-nav .nav-dropdown a:hover {
  color: var(--text);
}

/* Bandeira de idioma da carta */
.card-flag {
  display: inline-flex;
  width: 20px;
  height: 14px;
  flex: none;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
  vertical-align: middle;
}

.card-flag svg {
  width: 100%;
  height: 100%;
  display: block;
}

.card-flag-text {
  width: auto;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  background: var(--panel-strong);
  align-items: center;
}

.tile-set {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.tile-set > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-subtitle {
  display: flex;
  align-items: center;
  gap: 7px;
}
.preview-year {
  font-weight: 700;
  color: var(--muted);
}

/* Filtro mestre (origem dos sets) */
.master-filter {
  margin-bottom: 18px;
}

/* Resumo de condições no tile (ex.: "NM ×2 · M ×1") */
.tile-conditions {
  margin: 6px 0 0;
  min-height: 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--subtle);
  letter-spacing: 0.2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Binders (Coleção / Venda) ============================================ */
.primary {
  background: var(--accent);
  color: #0a0c10;
}
.primary:hover {
  background: var(--accent-dark);
}

.binder-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
  padding: 16px;
  margin-bottom: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.binder-toolbar input[type="text"] {
  flex: 1 1 220px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}
.binder-grid-label {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.binder-grid-label select {
  min-height: 42px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
}

.binder-list {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

/* --- Galeria de binders (criar + lista/grid, clicar abre o binder) --- */
.binder-gallery-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  margin: 14px 0;
}
.binder-view-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.binder-view-btn {
  min-width: 40px;
  min-height: 38px;
  border: none;
  background: var(--panel);
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
}
.binder-view-btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.binder-sort-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}
.binder-sort-label select {
  min-height: 38px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}
.binder-gallery.is-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.binder-gallery.is-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.binder-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease;
}
.binder-card:hover { border-color: var(--accent-dark); transform: translateY(-2px); }
.binder-card.has-color { border-left: 4px solid var(--binder-color, var(--accent)); }
.binder-card-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #11141b;
  overflow: hidden;
}
.binder-card-cover-img { width: 100%; height: 100%; object-fit: cover; object-position: center 28%; }
.binder-card-cover-empty {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  font-size: 2rem; font-weight: 800; color: var(--subtle);
}
.binder-card-acts {
  position: absolute; top: 8px; right: 8px;
  display: flex; gap: 6px;
  opacity: 0; transition: opacity 120ms ease;
}
.binder-card:hover .binder-card-acts,
.binder-card:focus-within .binder-card-acts { opacity: 1; }
@media (hover: none) { .binder-card-acts { opacity: 1; } }
.binder-card-act {
  width: 30px; height: 30px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(13, 14, 18, 0.85);
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
}
.binder-card-act.danger { color: #e7796f; }
.binder-card-body { padding: 10px 12px 12px; }
.binder-card-titlerow { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.binder-card-name { font-size: 1rem; font-weight: 800; color: var(--text); }
.binder-card-type {
  flex: none;
  font-size: 0.66rem; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  background: var(--surface); color: var(--subtle);
  border: 1px solid var(--line);
}
.binder-card-meta {
  display: flex; justify-content: space-between;
  font-size: 0.78rem; color: var(--muted);
  margin: 8px 0 6px;
}
/* Lista: capa pequena à esquerda, infos em linha. */
.binder-gallery.is-list .binder-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  align-items: center;
}
.binder-gallery.is-list .binder-card-cover { aspect-ratio: auto; height: 100%; min-height: 64px; }
.binder-gallery.is-list .binder-card-body { padding: 10px 56px 10px 14px; }

.binder-detail-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.binder-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.binder {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.binder-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* Abas do binder (Cartas | Resumo | Editar | Imprimir). */
.binder-tabbar {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.binder-tab {
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.binder-tab:hover { color: var(--text); }
.binder-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.binder-tabpanel { margin-bottom: 16px; }
/* Controles do Resumo: navegação de páginas à esquerda, exportar à direita. */
.binder-resumo-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.binder-titles {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 240px;
  min-width: 0;
}
.binder-name-input {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 6px;
}
.binder-name-input:hover,
.binder-name-input:focus {
  border-color: var(--line);
  background: var(--surface);
  outline: none;
}
.binder-subtitle-input {
  font-size: 0.9rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 3px 6px;
}
.binder-subtitle-input:hover,
.binder-subtitle-input:focus {
  border-color: var(--line);
  background: var(--surface);
  outline: none;
}
.binder-meta {
  font-size: 0.82rem;
  color: var(--subtle);
  padding: 0 6px;
}
.binder-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: end;
}
.binder-actions .secondary {
  min-height: 38px;
  font-size: 0.85rem;
}
.binder-delete {
  color: #e7796f !important;
  background: rgba(231, 121, 111, 0.12) !important;
  border-color: rgba(231, 121, 111, 0.25) !important;
}

/* Navegação de páginas do binder (‹ Página X de Y › + Nova página), na mesma
   linha das demais ações do binder (Layout / Exportar / Excluir). */
.binder-pagenav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.binder-page-indicator {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}
.binder-page-btn {
  min-width: 38px;
  font-size: 1.1rem;
  line-height: 1;
}
.binder-page-remove {
  color: #e7796f !important;
  background: rgba(231, 121, 111, 0.12) !important;
  border-color: rgba(231, 121, 111, 0.25) !important;
}

/* Cor do binder: faixa de destaque na borda esquerda. */
.binder.has-color {
  border-left: 4px solid var(--binder-color, var(--accent));
}

/* Faixa de resumo no topo do binder (Páginas / Cartas / Tenho / Faltando). */
.binder-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.binder-stat {
  flex: 1 1 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.binder-stat strong { font-size: 1.25rem; font-weight: 800; color: var(--text); }
.binder-stat span { font-size: 0.72rem; color: var(--subtle); }
.binder-stat.is-owned strong { color: var(--accent); }
.binder-stat.is-missing strong { color: #e7796f; }
.binder-progress {
  flex: 2 1 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.binder-progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
}
.binder-progress-head strong { color: var(--text); }

/* Painel de configurações (recolhível). */
.binder-settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.binder-settings-section h4 {
  margin: 0 0 10px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--subtle);
}
.binder-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.binder-field input[type="text"],
.binder-field input[type="number"],
.binder-field select {
  min-height: 38px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}
.binder-field input[type="color"] {
  width: 100%;
  min-height: 38px;
  padding: 2px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.binder-field-row {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
}
.binder-field-narrow { flex: 1 1 90px; margin-bottom: 0; }
.binder-print-layouts,
.binder-print-opts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.binder-print-opts { flex-flow: row wrap; gap: 6px 14px; }
.binder-print-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
}

.binder-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
  gap: 12px;
}
.binder-slot {
  position: relative;
  aspect-ratio: 5 / 7;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}
.binder-slot-empty {
  border-style: dashed;
  color: var(--subtle);
  gap: 6px;
  font-size: 0.85rem;
}
.binder-slot-filled {
  cursor: grab;
}
/* Carta do binder que você não tem: preto e branco até marcar como tenho. */
.binder-slot.not-owned .binder-slot-media {
  filter: grayscale(1);
  opacity: 0.62;
}
/* Botão "Tenho / Marcar como tenho" — aparece ao passar o mouse no slot. */
.binder-slot-own {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 3;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(13, 14, 18, 0.92);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}
.binder-slot:hover .binder-slot-own,
.binder-slot:focus-within .binder-slot-own {
  opacity: 1;
  pointer-events: auto;
}
.binder-slot-own.owned {
  color: var(--accent);
  border-color: var(--accent-dark);
}
.binder-slot-dragging {
  opacity: 0.4;
  cursor: grabbing;
}
.binder-slot-dragover {
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
}
.binder-slot-plus {
  font-size: 1.8rem;
  line-height: 1;
  color: var(--accent);
}
.binder-slot-media {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f1116;
}
.binder-slot-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.binder-slot-free {
  padding: 10px;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}
.binder-slot-caption {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  padding: 6px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #f3f5f7;
  background: linear-gradient(to bottom, rgba(8, 10, 14, 0.82), rgba(8, 10, 14, 0));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}
.binder-slot-price {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 7px 8px;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--gold);
  background: rgba(8, 10, 14, 0.82);
  text-align: left;
}

/* Editor de slot (modal reaproveita .card-preview-modal/.card-preview-panel) */
.binder-editor-panel {
  display: block;
  width: min(840px, 100%);
  max-height: calc(100vh - 56px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
}
.binder-editor-body h2 {
  margin: 0 0 14px;
  font-size: 1.25rem;
}
.binder-editor-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.binder-editor-tabs .chip.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(57, 199, 155, 0.3);
}
.binder-editor-search,
.binder-editor-field input,
.binder-editor-sale input,
.binder-editor-sale select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}
.binder-editor-field,
.binder-editor-sale label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}
.binder-editor-results {
  margin-top: 12px;
  max-height: 440px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.binder-result {
  flex-direction: column;
  padding: 6px;
  height: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  gap: 4px;
}
.binder-result.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.binder-result-media {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 7;
  display: block;
  border-radius: 5px;
  overflow: hidden;
}
.binder-result-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #0a0c10;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.binder-pick-info {
  align-self: center;
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 700;
}
.binder-result-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.binder-result-label {
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--muted);
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.binder-editor-hint {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  color: var(--subtle);
  margin: 6px 0;
}
.binder-editor-selected {
  margin: 12px 0 0;
  padding: 8px 10px;
  background: var(--accent-soft);
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}
.binder-editor-photo-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.binder-editor-photo-wrap {
  flex: 0 0 90px;
}
.binder-editor-photo {
  width: 90px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.binder-editor-photo-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
}
.binder-editor-photo-actions .file-button,
.binder-editor-photo-actions .secondary {
  align-self: flex-start;
  min-height: 38px;
}
.binder-editor-sale {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.binder-editor-note {
  grid-column: 1 / -1;
}
.binder-editor-footer {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

@media (max-width: 560px) {
  .binder-editor-sale {
    grid-template-columns: 1fr;
  }
  .binder-actions {
    width: 100%;
  }
}

/* ===== Valores: moeda, preço no tile, total geral ========================== */
/* Badge de moeda no dropdown de bandeira (R$/US$/€). */
.lang-dd-cur {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 16px;
  padding: 0 4px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 4px;
  line-height: 1;
}

/* Preço na carta (tile). */
.tile-price {
  margin: 2px 0 0;
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--gold);
}
.tile-price-ref {
  color: var(--muted);
  font-weight: 700;
}

/* Total geral em destaque no portfólio. */
.stat-grand strong,
.stat-grand span {
  color: var(--accent);
}

/* Valores no topo do detalhe (set/artista/pokémon). */
.detail-values {
  margin-top: 12px;
}

/* Coração na carta do binder que você não tem (igual aos tiles). */
.binder-slot-want {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(10, 12, 18, 0.72);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.binder-slot:hover .binder-slot-want,
.binder-slot-want.wanted {
  opacity: 1;
}
.binder-slot-want.wanted {
  color: #ff5d73;
}
