/* catalog.css — Catálogo (SEPARADO por breakpoint, sem vazamento)
   =========================================================
   0) BASE (comum e neutra — NÃO define layout de tabela nem sticky)
   1) INÍCIO DESKTOP (>= 981px) ... FIM DESKTOP
   2) INÍCIO MOBILE  (<= 980px) ... FIM MOBILE  (MANTIDO, sem mexer)
   3) TOP (rank/likes) — separado por breakpoint (sem vazar)
   ========================================================= */


/* =========================================================
   0) BASE (COMUM / NEUTRA)
   - Não define grid da tabela
   - Não define sticky/overflow de results
   - Não define layout da cat-layout
========================================================= */
html{
  scroll-behavior: smooth;
}

body{
  background: var(--bg);
  color: var(--text);
}

/* HERO (desktop usa; mobile esconde no bloco mobile) */
.cat-hero{
  padding: 18px 0 10px;
}

.cat-hero h1{
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
  letter-spacing: -.4px;
}

.cat-hero p{
  margin: 8px 0 0;
  color: var(--muted);
  font-size: var(--p);
}

/* Sidebar / Panel (skin comum) */
.sidebar{
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.sidebar__head{
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar__head b{
  font-size: 14px;
}

#btnFiltersToggle{
  width: 40px;
  height: 40px;
  padding: 0;
  display: none; /* desktop mantém escondido; mobile liga no bloco mobile */
  place-items: center;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}

#btnFiltersToggle i{
  font-size: 1.05rem;
}

.sidebar__body{
  padding: 12px 14px 14px;
  display: grid;
  gap: 10px;
}

.field label{
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input,
.field select{
  width: 100%;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  outline: none;
  color: var(--text);
}

.sidebar__actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}

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

.panel__head{
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.count{
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.panel__body{
  padding: 14px;
}

.status{
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}

/* Botões / badges (comum) */
.plan-badge{
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--brand) 10%, var(--surface-2));
  color: var(--text);
  white-space: nowrap;
}

.fav-btn{
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 14px;
  cursor: pointer;
  line-height: 1;
}

.fav-btn i{
  display: block;
  line-height: 1;
  font-size: 18px;
}

.fav-btn.on{
  border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
  background: color-mix(in srgb, var(--brand) 18%, var(--surface-2));
}

/* Header actions (topo) */
.k-actions.k-actions--icons{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  max-width: 52vw;
  padding-bottom: 2px;
}

.k-actions.k-actions--icons::-webkit-scrollbar{
  height: 0;
}

/* Inputs dark */
html[data-theme="dark"] select,
html[data-theme="dark"] input{
  color-scheme: dark !important;
  background: #0b1020 !important;
  color: #f7f7fb !important;
  border-color: rgba(255,255,255,.22) !important;
}

/* Nitidez resultados */
#results, #results *{
  text-shadow: none !important;
  filter: none !important;
}

#results{
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}


/* POPUP PDF */
/* ===== Modal PDFs (não suja a tela) ===== */
.pdf-modal{
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
}

.pdf-modal.is-open{
  display: block;
}

.pdf-modal__overlay{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(3px);
}

.pdf-modal__panel{
  position: relative;
  width: min(720px, calc(100vw - 24px));
  margin: 84px auto 0;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(16,18,26,.96);
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
  overflow: hidden;
}

.pdf-modal__head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}

.pdf-modal__title{
  font-weight: 900;
  font-size: 16px;
}

.pdf-modal__sub{
  margin-top: 2px;
  font-size: 12px;
  opacity: .75;
}

.pdf-modal__close{
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
  cursor: pointer;
}

.pdf-tabs{
  display: flex;
  gap: 8px;
  padding: 12px 14px;
}

.pdf-tab{
  flex: 1 1 0;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.88);
  font-weight: 900;
  cursor: pointer;
}

.pdf-tab.is-active{
  background: var(--brand);
  border-color: rgba(255,255,255,.20);
  color: #fff;
  box-shadow: 0 10px 26px rgba(255,43,94,.28);
}

.pdf-grid{
  padding: 0 14px 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pdf-card{
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pdf-card__left{
  min-width: 0;
}

.pdf-card__name{
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-card__meta{
  margin-top: 2px;
  font-size: 12px;
  opacity: .75;
}

.pdf-card__btn{
  height: 38px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
  color: rgba(255,255,255,.92);
  cursor: pointer;
  white-space: nowrap;
}

.pdf-card__btn:hover{
  background: rgba(255,255,255,.08);
}

/* Mobile: 1 coluna */
@media (max-width: 980px){
  .pdf-modal__panel{ margin-top: 66px; }
  .pdf-grid{ grid-template-columns: 1fr; }
}
/* POPUP FIM PDF */




/* =========================================================
   1) INÍCIO DESKTOP (>= 981px)
   - tudo de layout/tabela/scroll fica aqui
========================================================= */
@media (min-width: 981px){

  /* Esconde a lupa/botão de busca no DESKTOP */
  button[aria-label="Buscar"],
  .icon-search,
  .nav-search-btn,
  .search-toggle,
  .header__search,
  .topbar__search{
    display: none !important;
  }

  /* MOBILE UI OFF */
  .appbar{ display: none !important; }


  /* LAYOUT DESKTOP */
  .cat-layout{
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-template-rows: auto 1fr; /* linha 1 = A–Z, linha 2 = sidebar/panel */
    gap: 18px;
    padding-bottom: 0;
    align-items: start;
  }

  /* SIDEBAR DESKTOP (sticky só no desktop) */
  .sidebar{
    position: sticky;
    top: 74px;
    align-self: start;
    z-index: 3;
    grid-column: 1;
    grid-row: 2;
  }

  /* PANEL DESKTOP */
  .panel{
    grid-column: 2;
    grid-row: 2;
    background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.18));
    border-color: rgba(255,255,255,.10);
  }

  /* DESKBAR */
  .deskbar{
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    margin: 10px 0 14px;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.04);
    backdrop-filter: blur(10px);
  }

  .deskbar__item{
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.04);
    color: rgba(255,255,255,.88);
    text-decoration: none;
    cursor: pointer;
    user-select: none;
  }

  .deskbar__item i{
    font-size: 18px;
    line-height: 1;
  }

  .deskbar__item.active{
    background: var(--brand);
    border-color: color-mix(in srgb, var(--brand) 75%, rgba(255,255,255,.18));
    color: #fff;
    box-shadow: 0 10px 26px rgba(255,43,94,.28);
  }

  .deskbar .badge{
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
    background: var(--brand);
    color: #fff;
    border: 2px solid rgba(10,12,18,.92);
    box-shadow: 0 8px 16px rgba(0,0,0,.35);
    pointer-events: none;
  }

  /* A–Z DESKTOP (horizontal) */
  .az-rail{
    display: flex !important;
    grid-column: 1 / -1;
    grid-row: 1;
    flex-direction: row;
    gap: 6px;
    padding: 10px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    border-radius: 18px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.10);
  }

  .az-rail::-webkit-scrollbar{ height: 0; }

  .az-rail .az-btn{
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(0,0,0,.12);
    color: rgba(255,255,255,.86);
    font-weight: 950;
    font-size: 12px;
    display: grid;
    place-items: center;
    cursor: pointer;
    flex: 0 0 auto;
  }

  .az-rail .az-btn.active{
    background: var(--brand);
    border-color: rgba(255,255,255,.25);
    color: #fff;
    box-shadow: 0 10px 24px rgba(255,43,94,.28);
  }

  /* ===== TABELA DESKTOP ===== */
  .results-head{
    display: grid;
    /* Código | Título | Artista | Plano | Favoritos */
    grid-template-columns: 96px minmax(240px, 1.35fr) minmax(200px, 1.05fr) 120px 92px;
    gap: 6px;
    padding: 10px 12px;
    font-size: 12px;
    color: rgba(255,255,255,.70);
    font-weight: 800;
    background: rgba(16,18,26,.92); /* fundo real (não depende de var) */
    border-bottom: 1px solid rgba(255,255,255,.10);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(8px);
  }

  .row{
    display: grid;
    grid-template-columns: 96px minmax(240px, 1.35fr) minmax(200px, 1.05fr) 120px 92px;
    gap: 6px;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.03);
  }

  /* Cabeçalho: alinhar Plano/Favoritos */
  .results-head > div:nth-child(4),
  .results-head > div:nth-child(5){
    text-align: center;
  }

  .row:nth-child(even){ background: rgba(255,255,255,.02); }
  .row:hover{ background: rgba(255,255,255,.05); }

  .cell-title,
  .cell-singer{
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .cell-pack{ display: flex; justify-content: center; }
  .cell-actions{ display: flex; justify-content: center; align-items: center; }

  /* Coluna Favoritos (desktop) */
  .fav-cell{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 92px;
  }

  /* Desktop: NÃO mostrar texto "Favoritos" embaixo da estrela */
  .fav-label{ display: none !important; }

  /* Badge do plano: centraliza */
  .plan-badge{
    min-width: 86px;
    justify-content: center;
  }

  /* Código com “placa” */
  .cell-code{
    font-weight: 950;
    letter-spacing: .9px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 11px;
    border-radius: 12px;
    color: rgba(255,255,255,.98) !important;
    background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(0,0,0,.30));
    border: 1px solid rgba(255,255,255,.22);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 8px 18px rgba(0,0,0,.18);
  }

  /* Plano (desktop) */
  .plan-badge{
    background: rgba(0,0,0,.18) !important;
    border-color: rgba(255,255,255,.18) !important;
    color: rgba(255,255,255,.92) !important;
    padding: 6px 12px !important;
    letter-spacing: .35px;
  }

  /* Estrela glow (desktop) */
  .fav-btn{
    position: relative;
    background: rgba(0,0,0,.18) !important;
    border-color: rgba(255,255,255,.22) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 10px 22px rgba(0,0,0,.25) !important;
  }

  .fav-btn::after{
    content: "";
    position: absolute;
    inset: -10px;
    border-radius: 999px;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255,255,255,.30) 0%, rgba(255,255,255,.10) 22%, rgba(255,255,255,0) 58%);
    opacity: .55;
    filter: blur(1px);
  }

  .fav-btn i{
    text-shadow: 0 0 10px rgba(255,255,255,.35), 0 0 18px rgba(255,255,255,.18);
    filter: drop-shadow(0 0 12px rgba(255,255,255,.22));
  }

  .fav-btn.on i{
    text-shadow: 0 0 12px rgba(255,255,255,.45), 0 0 22px rgba(255,43,94,.25);
    filter: drop-shadow(0 0 14px rgba(255,43,94,.22));
  }

  /* ===== DESKTOP: SOMENTE O PAINEL ROLA ===== */
  body:has(.cat-layout){
    overflow: hidden;
  }

  body:has(.cat-layout) > .k-container{
    height: calc(100vh - 74px);
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-bottom: 0;
  }

  body:has(.cat-layout) .cat-layout{
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
  }

  body:has(.cat-layout) .panel{
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  /* 1) Header do painel FIXO (impede “vazamento” visual atrás dele) */
  body:has(.cat-layout) .panel__head{
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(10,12,18,.92);
    backdrop-filter: blur(10px);
  }

  /* 2) Corpo do painel vira casca (sem scroll) */
  body:has(.cat-layout) .panel__body{
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* evita scroll duplo */
  }

  /* 3) Só o wrap rola — e tem “fundo”/borda pra não parecer que passa por dentro */
  body:has(.cat-layout) .results-wrap{
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.03);
  }

  /* no desktop, quem rola é o wrap */
  body:has(.cat-layout) #results,
  body:has(.cat-layout) .results{
    overflow: visible;
  }

  /* ===== DESKTOP: TOP FAVORITOS ===== */
  .panel:has(#results .row.row-top) .results-head,
  .panel:has(#results .row.row-top) .row.row-top{
    grid-template-columns: 96px minmax(240px, 1.35fr) minmax(200px, 1.05fr) 120px 170px;
    gap: 6px;
  }

  .row.row-top .cell-actions{ justify-content: center; }

  .row.row-top .cell-actions .top-rank{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    max-width: 100%;
  }

  .row.row-top .cell-actions .top-rank .pos{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 36px;
    padding: 0 10px;
    border-radius: 999px;
    font-weight: 950;
    letter-spacing: .4px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    color: rgba(255,255,255,.92);
  }

  .row.row-top .cell-actions .top-rank .likes{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 900;
    letter-spacing: .2px;
    background: rgba(0,0,0,.18);
    border: 1px solid rgba(255,255,255,.14);
    color: rgba(255,255,255,.86);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Desktop: NÃO adicionar “favoritos” */
  .row.row-top .cell-actions .top-rank .likes::after{
    content: "";
  }
}

/* =========================
   FIM DESKTOP
========================= */


/* =========================================================
   2) INÍCIO MOBILE (<= 980px) — MANTIDO (SEM MEXER)
========================================================= */
@media (max-width: 980px) {

  :root{
    --headerH: 74px;
    --appbarH: 78px;
    --azW: 30px;
    --gapM: 6px;
    --padM: 8px;

    --cardPad: 12px;
    --starSize: 42px;
    --starInset: 10px;

    --cardGrayTop: rgba(255,255,255,.06);
    --cardGrayBot: rgba(0,0,0,.22);
    --cardBorder: rgba(255,255,255,.14);
    --cardBorderOdd: rgba(255,255,255,.16);
  }

  html, body{
    height: 100%;
    overflow-x: hidden;
  }

  body{
    overflow: hidden;
    overscroll-behavior: none;
  }

  .cat-hero{ display: none; }

  /* deskbar OFF no mobile */
  .deskbar{ display: none !important; }

  /* APPBAR */
  .appbar{
    display: flex !important;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    gap: 8px;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    background: rgba(10,12,18,.92);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255,255,255,.10);
  }

  .appbar__item{
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 56px;
    padding: 8px 6px;
    border-radius: 16px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.10);
    color: rgba(255,255,255,.85);
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    touch-action: manipulation;
  }

  .appbar__item i{
    font-size: 18px;
    line-height: 1;
  }

  .appbar__item.active{
    background: var(--brand);
    border-color: color-mix(in srgb, var(--brand) 75%, rgba(255,255,255,.18));
    color: #fff;
    box-shadow: 0 10px 26px rgba(255,43,94,.28);
  }

  .appbar__item .badge{
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(10px);
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 900;
    background: var(--brand);
    color: #fff;
    border: 2px solid rgba(10,12,18,.92);
    box-shadow: 0 8px 16px rgba(0,0,0,.35);
    pointer-events: none;
  }

  /* Layout mobile */
  .cat-layout{
    height: calc(100dvh - var(--headerH));
    min-height: 0;
    padding: var(--gapM);
    padding-bottom: calc(var(--gapM) + var(--appbarH));
    box-sizing: border-box;
    display: grid;
    grid-template-columns: var(--azW) 1fr;
    grid-template-rows: auto 1fr;
    gap: var(--gapM);
    overflow: hidden;
    max-width: 100%;
  }

  /* A–Z vertical */
  .az-rail{
    display: flex !important;
    grid-column: 1;
    grid-row: 1 / 3;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    border-radius: 14px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    touch-action: pan-y;
    overscroll-behavior: contain;
  }

  .az-rail::-webkit-scrollbar{ display: none; }

  .az-rail .az-btn{
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(0,0,0,.12);
    color: rgba(255,255,255,.82);
    font-weight: 950;
    font-size: 11px;
    display: grid;
    place-items: center;
    cursor: pointer;
    touch-action: manipulation;
  }

  .az-rail .az-btn.active{
    background: var(--brand);
    border-color: rgba(255,255,255,.25);
    color: #fff;
    box-shadow: 0 10px 24px rgba(255,43,94,.28);
  }

  .az-rail.is-disabled{
    opacity: .35;
    pointer-events: none;
    filter: grayscale(1);
  }

  /* filtros */
  .sidebar{
    grid-column: 2;
    grid-row: 1;
    margin: 0 !important;
    border-radius: 16px;
    z-index: 20;
  }

  #btnFiltersToggle{ display: grid; }

  .sidebar__head{ padding: 10px; }

  .sidebar__body{
    padding: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .sidebar__body .field:first-child{ grid-column: 1 / -1; }

  .field label{
    margin-bottom: 3px;
    font-size: 10px;
  }

  .field input, .field select{
    padding: 8px 10px;
    border-radius: 12px;
  }

  .sidebar__actions{
    grid-column: 1 / -1;
    padding-top: 0;
  }

  #btnSearch{
    width: 100%;
    height: 40px;
    border-radius: 12px;
  }

  /* painel mobile */
  .panel{
    grid-column: 2;
    grid-row: 2;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    border-radius: 16px;
    max-width: 100%;
  }

  .panel__head{
    padding: 10px;
    max-width: 100%;
  }

  .results-head{ display: none !important; }

  .panel__body{
    padding: var(--padM);
    min-height: 0;
    height: calc(100% - 52px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: var(--gapM);
    max-width: 100%;
  }

  .status{ margin-bottom: 0; }

  .results-wrap{
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.03);
    max-width: 100%;
  }

  #results{
    height: 100%;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-x: hidden;
  }

  /* Cards */
  #results .row{
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    border: 1px solid var(--cardBorder);
    border-radius: 18px;
    padding: var(--cardPad);
    padding-right: calc(var(--cardPad) + var(--starSize) + 10px);
    box-shadow: 0 12px 34px rgba(0,0,0,.28);
    background: linear-gradient(180deg, var(--cardGrayTop) 0%, var(--cardGrayBot) 100%);
    text-align: left !important;
    align-items: start;
    justify-items: start;
    max-width: 100%;
  }

  #results .row:nth-child(odd){
    background: color-mix(in srgb, var(--brand) 78%, #0b1020 22%);
    border-color: var(--cardBorderOdd);
  }

  #results .cell-topline{
    width: 100%;
    display: flex !important;
    align-items: center;
    gap: 12px;
    justify-content: flex-start;
  }

  #results .code-pack{
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    max-width: 100%;
  }

  #results .code-pack .code{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 950;
    font-variant-numeric: tabular-nums;
    letter-spacing: .9px;
    line-height: 1;
    font-size: 22px;
    padding: 7px 11px;
    border-radius: 12px;
    color: rgba(255,255,255,.98);
    background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(0,0,0,.28));
    border: 1px solid rgba(255,255,255,.22);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 8px 18px rgba(0,0,0,.22);
  }

  #results .row:nth-child(even) .code-pack .code{
    background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(0,0,0,.36));
    border-color: rgba(255,255,255,.30);
  }

  #results .row:nth-child(odd) .code-pack .code{
    background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(0,0,0,.16));
    border-color: rgba(255,255,255,.26);
  }

  #results .code-pack .plan-mini{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .4px;
    line-height: 1;
    white-space: nowrap;
    color: rgba(255,255,255,.92);
    background: rgba(0,0,0,.18);
    border: 1px solid rgba(255,255,255,.18);
  }

  #results .row:nth-child(odd) .code-pack .plan-mini{
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.22);
  }

  #results .cell-title .lbl,
  #results .cell-singer .lbl{
    display: none !important;
  }

  #results .cell-title,
  #results .cell-title .val{
    margin: 0;
    padding: 0;
    width: 100%;
    min-width: 0;
    font-size: 16px !important;
    font-weight: 900;
    line-height: 1.15;
    color: rgba(255,255,255,.94);
    text-align: left !important;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  #results .cell-singer,
  #results .cell-singer .val{
    margin: 0;
    padding: 0;
    width: 100%;
    min-width: 0;
    font-size: 13px !important;
    font-weight: 750;
    line-height: 1.15;
    color: rgba(255,255,255,.82);
    text-align: left !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* estrela */
  #results .fav-btn{
    position: absolute !important;
    top: var(--starInset);
    right: var(--starInset);
    z-index: 2;
    width: var(--starSize);
    height: var(--starSize);
    min-width: var(--starSize);
    min-height: var(--starSize);
    padding: 0;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(0,0,0,.18);
    border: 1px solid rgba(255,255,255,.22);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 10px 22px rgba(0,0,0,.25);
  }

  #results .fav-btn::after{
    content: "";
    position: absolute;
    inset: -10px;
    border-radius: 999px;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255,255,255,.35) 0%, rgba(255,255,255,.12) 22%, rgba(255,255,255,0) 58%);
    opacity: .55;
    filter: blur(1px);
  }

  #results .row:nth-child(odd) .fav-btn::after{
    background: radial-gradient(circle, rgba(255,255,255,.40) 0%, rgba(255,43,94,.12) 26%, rgba(255,255,255,0) 60%);
    opacity: .60;
  }

  #results .fav-btn i{
    position: relative;
    z-index: 1;
    font-size: 18px;
    line-height: 1;
    color: rgba(255,255,255,.96);
    text-shadow: 0 0 10px rgba(255,255,255,.35), 0 0 18px rgba(255,255,255,.18);
    filter: drop-shadow(0 0 12px rgba(255,255,255,.22));
  }

  #results .fav-btn.on i{
    text-shadow: 0 0 12px rgba(255,255,255,.45), 0 0 22px rgba(255,43,94,.25);
    filter: drop-shadow(0 0 14px rgba(255,43,94,.22));
  }

  #results .fav-btn:active{ transform: scale(.97); }

  /* instalar mobile */
  #btnInstall{ display: inline-flex !important; }

  /* overlay */
  html.no-filters .sidebar{ display: none !important; }
  html.no-filters .panel{ grid-row: 1 / 3; }

  html.filters-open .sidebar{
    display: block !important;
    position: fixed !important;
    left: calc(var(--azW) + var(--gapM) + 6px);
    right: var(--gapM);
    top: calc(var(--headerH) + var(--gapM));
    z-index: 90;
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(0,0,0,.55);
  }

  html.filters-open::before{
    content: "";
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(2px);
  }
}

/* =========================
   FIM MOBILE
========================= */


/* =========================================================
   3) TOP (rank/likes) — MANTIDO (separado por breakpoint)
========================================================= */

/* MOBILE: rank destacado + some estrela no TOP */
@media (max-width: 980px){

  /* Quando a row tem rank, é TOP */
  #results .row.row-top .fav-btn{
    display: none !important;
  }

  #results .row.row-top{
    padding-right: var(--cardPad) !important;
  }

  #results .row.row-top .cell-rank-mobile{
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 2px 0;
  }

  #results .row.row-top .cell-rank-mobile .top-rank{
    display: inline-flex;
    align-items: center;
    gap: 10px;
  }

  #results .row.row-top .cell-rank-mobile .pos{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 950;
    font-size: 13px;
    letter-spacing: .4px;
    color: rgba(255,255,255,.98);
    background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(0,0,0,.32));
    border: 1px solid rgba(255,255,255,.24);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 10px 22px rgba(0,0,0,.22);
  }

  #results .row.row-top .cell-rank-mobile .likes{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 900;
    font-size: 12px;
    letter-spacing: .2px;
    color: rgba(255,255,255,.96);
    background: rgba(0,0,0,.18);
    border: 1px solid rgba(255,255,255,.18);
  }

  #results .row.row-top .cell-rank-mobile .likes::after{
    content: " favoritos";
    opacity: .85;
    margin-left: 6px;
    font-weight: 800;
    font-size: 11px;
  }

  #results .row.row-top:nth-child(odd) .cell-rank-mobile .pos{
    background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(0,0,0,.16));
    border-color: rgba(255,255,255,.26);
  }

  #results .row.row-top:nth-child(odd) .cell-rank-mobile .likes{
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.22);
  }
}

/* DESKTOP: rank/likes com “pills” fortes */
@media (min-width: 981px){

  .row.row-top .top-rank{
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .row.row-top .top-rank .pos{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 950;
    letter-spacing: .4px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    color: rgba(255,255,255,.92);
  }

  .row.row-top .top-rank .likes{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 900;
    letter-spacing: .2px;
    background: rgba(0,0,0,.18);
    border: 1px solid rgba(255,255,255,.14);
    color: rgba(255,255,255,.86);
  }

  /* Desktop: NÃO adicionar "favoritos" */
  .row.row-top .top-rank .likes::after{
    content: "";
  }
}

/* botao pdf e loja virtual*/

.deskbar__item_loja {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.04);
    color: rgba(255,255,255,.88);
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    background: #1B6DFF !important;
}

.send-wrap {
    margin-top: 12px;
}

.send-btn{
    width:100%;
    min-height:42px;

    border-radius:14px;
    border:1px solid rgba(255,255,255,.14);

    background:rgba(255,255,255,.06);
    color:rgba(255,255,255,.94);

    font-size:14px;
    font-weight:900;

    cursor:pointer;

    transition:.2s;
}

.send-btn:hover{
    background:rgba(255,255,255,.10);
}

.send-btn:not(:disabled){
    box-shadow:0 8px 18px rgba(0,0,0,.18);
}

.krj-equip-box{
    margin: 6px 0 12px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.92);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.krj-equip-box b{
    color: #fff;
}

.krj-equip-box button{
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 12px;
    padding: 8px 12px;
    font-weight: 900;
    color: rgba(255,255,255,.92);
    background: rgba(255,255,255,.08);
    cursor: pointer;
}

.send-btn.is-disabled,
.send-btn:disabled{
    opacity:.45;
    filter:grayscale(1);
    cursor:not-allowed;
}

#results .row.row-selected{
    border: 2px solid rgba(255,255,255,.95) !important;
    outline: 3px solid rgba(255,43,94,.35);
    box-shadow: 0 0 24px rgba(255,255,255,.28), 0 18px 40px rgba(0,0,0,.35) !important;
}

#results .row.row-selected::before{
    content: "🎤 SUA ESCOLHA";
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 950;
    color: #fff;
    background: rgba(0,0,0,.28);
    border: 1px solid rgba(255,255,255,.20);
    margin-bottom: 2px;
}
#krjAvisoProximo{
    position: fixed !important;
    inset: 0 !important;
    z-index: 999999 !important;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.82);
    backdrop-filter: blur(4px);
}

#krjAvisoProximo.is-open{
    display: flex !important;
}

.krj-aviso-card{
    width: min(92vw, 460px);
    padding: 28px;
    border-radius: 28px;
    border: 2px solid rgba(255,120,0,.85);
    background: linear-gradient(135deg, #ff4b00, #2b0000);
    box-shadow: 0 0 45px rgba(255,80,0,.75);
    color: #fff;
    text-align: center;
    animation: krjPulse 1s infinite;
}

.krj-aviso-icon{
    font-size: 62px;
    margin-bottom: 12px;
}

.krj-aviso-title{
    font-size: 38px;
    font-weight: 950;
}

.krj-aviso-sub{
    margin-top: 10px;
    font-size: 22px;
    font-weight: 900;
}

.krj-aviso-code{
    margin-top: 16px;
    font-size: 17px;
    opacity: .92;
}

@keyframes krjPulse{
    0%,100%{ transform: scale(1); }
    50%{ transform: scale(1.04); }
}

#krjPlanoBox{
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.86);
    backdrop-filter: blur(4px);
}

#krjPlanoBox.is-open{
    display: flex;
}

.krj-plano-card{
    width: min(92vw, 420px);
    padding: 26px;
    border-radius: 26px;
    background: #111;
    color: #fff;
    text-align: center;
    border: 1px solid rgba(255,255,255,.18);
}

.krj-plano-icon{
    font-size: 46px;
    margin-bottom: 10px;
}

.krj-plano-title{
    font-size: 24px;
    font-weight: 950;
}

.krj-plano-sub{
    margin: 10px 0 18px;
    opacity: .8;
}

.krj-plano-btn{
    width: 100%;
    margin-top: 10px;
    padding: 16px;
    border: 0;
    border-radius: 18px;
    background: rgba(255,255,255,.10);
    color: #fff;
    font-size: 22px;
    font-weight: 950;
    cursor: pointer;
}

.krj-plano-btn span{
    display: block;
    margin-top: 4px;
    font-size: 13px;
    opacity: .8;
}

.krj-plano-plus{
    background: var(--brand);
}

#btnInstall[hidden]{
    display:none !important;
}


.update-required{margin-top:5px;font-size:11px;font-weight:800;line-height:1.3;color:#f5b942}.row:has(.update-required){opacity:.78}.fav-btn:disabled{opacity:.35;cursor:not-allowed}

/* =========================================================
   APP 2.2.6 — identidade visual dos resultados no DESKTOP
   Mantém a tabela compacta, mas replica a linguagem visual
   dos cards mobile usando a cor da empresa (var(--brand)).
========================================================= */
@media (min-width: 981px){
  /* Dá leitura de card sem perder a estrutura de tabela. */
  body:has(.cat-layout) #results{
    padding: 7px 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  body:has(.cat-layout) #results .row{
    position: relative;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 13px;
    background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(0,0,0,.20));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 6px 18px rgba(0,0,0,.10);
    overflow: hidden;
  }

  /* Mesmo critério do mobile: linhas ímpares recebem a cor da empresa. */
  body:has(.cat-layout) #results .row:nth-child(odd){
    background: color-mix(in srgb, var(--brand) 78%, #0b1020 22%);
    border-color: color-mix(in srgb, var(--brand) 62%, rgba(255,255,255,.32));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.10),
                0 8px 22px color-mix(in srgb, var(--brand) 18%, transparent);
  }

  body:has(.cat-layout) #results .row:hover{
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--brand) 58%, rgba(255,255,255,.35));
  }

  /* Nas linhas de identidade, texto sempre com contraste forte. */
  body:has(.cat-layout) #results .row:nth-child(odd) .cell-title,
  body:has(.cat-layout) #results .row:nth-child(odd) .cell-singer{
    color: #fff !important;
  }

  /* Código segue a placa visual do mobile. */
  body:has(.cat-layout) #results .row:nth-child(odd) .cell-code{
    background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(0,0,0,.14));
    border-color: rgba(255,255,255,.30);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 7px 16px rgba(0,0,0,.18);
  }

  /* Selo BÁSICO / PLUS integrado à cor do card, como no celular. */
  body:has(.cat-layout) #results .row:nth-child(odd) .plan-badge{
    background: rgba(255,255,255,.10) !important;
    border-color: rgba(255,255,255,.26) !important;
    color: #fff !important;
  }

  /* Estrela recebe o mesmo acabamento visual do mobile. */
  body:has(.cat-layout) #results .row:nth-child(odd) .fav-btn{
    background: rgba(0,0,0,.15) !important;
    border-color: rgba(255,255,255,.28) !important;
  }

  body:has(.cat-layout) #results .row:nth-child(odd) .fav-btn::after{
    background: radial-gradient(circle,
      rgba(255,255,255,.40) 0%,
      color-mix(in srgb, var(--brand) 24%, transparent) 28%,
      rgba(255,255,255,0) 62%);
    opacity: .62;
  }

  /* Indisponíveis continuam identificáveis sem apagar a identidade. */
  body:has(.cat-layout) #results .row.row-unavailable{
    opacity: .72;
  }
}
