/* NAONDE — Salvos com coleções (prompt 28) */
.nds-aviso { position: fixed; z-index: 2147483100; transform: translate(-50%, -50%) scale(.94); opacity: 0; pointer-events: none; display: none;
  padding: 14px 22px; border-radius: 16px; background: rgba(28, 28, 30, .86); color: #fff; font: 600 16px/1.3 var(--nd-fonte, system-ui, sans-serif); letter-spacing: -.01em;
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%); box-shadow: 0 12px 40px rgba(0, 0, 0, .25); white-space: nowrap; max-width: calc(100vw - 48px); overflow: hidden; text-overflow: ellipsis; }
.nds-aviso.on { display: block; animation: nds-aviso-in .2s cubic-bezier(.22, 1, .36, 1) forwards; }
.nds-aviso.on.sai { animation: nds-aviso-out .24s ease forwards; }
@keyframes nds-aviso-in { from { opacity: 0; transform: translate(-50%, -50%) scale(.94); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes nds-aviso-out { from { opacity: 1; transform: translate(-50%, -50%) scale(1); } to { opacity: 0; transform: translate(-50%, -50%) scale(.97); } }

/* janela "Salvar em coleção" */
.nds-janela { position: fixed; z-index: 100070; width: 320px; max-height: min(460px, calc(100dvh - 24px)); display: flex; flex-direction: column; overflow: hidden;
  background: #fff; color: #1d1d1f; border-radius: 18px; box-shadow: 0 18px 50px rgba(0, 0, 0, .18), 0 0 0 1px rgba(0, 0, 0, .06); font-family: var(--nd-fonte, system-ui, sans-serif);
  opacity: 0; transform: translateY(6px) scale(.98); transition: opacity .16s ease, transform .16s cubic-bezier(.22, 1, .36, 1); }
.nds-janela.on { opacity: 1; transform: none; }
.nds-janela.sai { opacity: 0; transform: translateY(4px) scale(.98); }
.nds-veu { position: fixed; inset: 0; z-index: 100069; background: rgba(0, 0, 0, .32); opacity: 0; transition: opacity .16s ease; }
.nds-veu.on { opacity: 1; }
.nds-janela.folha { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: auto; max-height: 78dvh; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); transform: translateY(24px); }
.nds-janela.folha.on { transform: none; }
.nds-j-cab { display: flex; align-items: center; gap: 12px; padding: 14px 12px 12px 14px; border-bottom: 1px solid rgba(0, 0, 0, .07); }
.nds-j-cab img, .nds-j-sem { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; background: #f2f2f7; display: grid; place-items: center; color: #8e8e93; }
.nds-j-cab div { flex: 1; min-width: 0; }
.nds-j-cab b { display: block; font-size: 15px; }
.nds-j-cab small { display: block; color: #6e6e73; font-size: 12.5px; margin-top: 2px; }
.nds-j-lista { overflow-y: auto; padding: 6px; }
.nds-lin { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: inherit; font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.nds-lin:hover, .nds-lin:focus-visible { background: #f2f2f7; outline: none; }
.nds-lin-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nds-lin-n em { font-style: normal; color: #8e8e93; font-size: 12.5px; margin-left: 4px; }
.nds-marca { width: 22px; height: 22px; border-radius: 50%; border: 1.6px solid #c7c7cc; display: grid; place-items: center; flex: none; color: #fff; transition: background-color .12s, border-color .12s; }
.nds-lin.tem .nds-marca { background: #0a84ff; border-color: #0a84ff; }
.nds-j-mais, .nds-j-tirar { display: flex; align-items: center; gap: 8px; margin: 0 6px 6px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.nds-j-mais { color: #0a84ff; }
.nds-j-tirar { color: #ff3b30; border-top: 1px solid rgba(0, 0, 0, .07); border-radius: 0 0 10px 10px; padding-top: 4px; }
.nds-j-mais:hover, .nds-j-tirar:hover { background: #f2f2f7; }
.nds-j-nova { display: flex; gap: 8px; padding: 6px 12px 10px; }
.nds-j-nova[hidden] { display: none; }
.nds-j-nova input, .nds-caixa input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid rgba(0, 0, 0, .14); border-radius: 10px; font: inherit; font-size: 15px; background: #fff; color: inherit; }
.nds-j-nova input:focus, .nds-caixa input:focus { outline: none; border-color: #0a84ff; box-shadow: 0 0 0 3px rgba(10, 132, 255, .16); }

.nds-bt { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border: 0; border-radius: 12px; background: #0a84ff; color: #fff; font: 600 15px/1 var(--nd-fonte, system-ui, sans-serif); cursor: pointer; white-space: nowrap; }
.nds-bt:hover { filter: brightness(1.05); }
.nds-bt:disabled { opacity: .5; cursor: default; filter: none; }
.nds-bt.sec { background: #f2f2f7; color: #1d1d1f; }
.nds-bt.perigo { background: #ff3b30; }
.nds-ic { width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: transparent; color: inherit; display: grid; place-items: center; cursor: pointer; }
.nds-ic:hover { background: rgba(0, 0, 0, .06); }

/* página */
.nds { max-width: 980px; margin: 0 auto; padding: 8px 16px 40px; font-family: var(--nd-fonte, system-ui, sans-serif); color: #1d1d1f; }
.nds-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 18px; }
.nds-cab h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.nds-cab p { margin: 4px 0 0; color: #6e6e73; font-size: 14.5px; }
.nds-cab.col { justify-content: flex-start; }
.nds-cab.col > div { flex: 1; min-width: 0; }
.nds-cab.col h1 { font-size: 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nds-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 22px 18px; }
.nds-col { display: flex; flex-direction: column; gap: 4px; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.nds-capa { position: relative; display: block; width: 100%; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: #f2f2f7; margin-bottom: 6px; transition: transform .18s cubic-bezier(.22, 1, .36, 1), box-shadow .18s; }
.nds-capa img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nds-capa.m4 { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; }
.nds-capa.vazia { display: grid; place-items: center; color: #aeaeb2; }
.nds-capa.vazia svg { width: 34px; height: 34px; }
.nds-col:hover .nds-capa, .nds-col:focus-visible .nds-capa { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .12); }
.nds-col:focus-visible { outline: none; }
.nds-col:focus-visible .nds-capa { outline: 2px solid #0a84ff; outline-offset: 2px; }
.nds-col-n { font-size: 15.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nds-col small { color: #8e8e93; font-size: 12.5px; }
.nds-dica { display: flex; align-items: center; gap: 6px; color: #6e6e73; font-size: 14px; margin-top: 22px; }
.nds-dica svg { width: 16px; height: 16px; }
.nds-itens { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; }
.nds-it { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #f2f2f7; transition: opacity .2s, transform .2s; }
.nds-it.sai { opacity: 0; transform: scale(.96); }
.nds-it-abrir { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; color: #1d1d1f; }
.nds-it-abrir img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nds-it-txt { position: absolute; inset: 0; padding: 14px; font-size: 14px; line-height: 1.4; text-align: left; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; }
.nds-it-play { position: absolute; top: 8px; right: 8px; color: #fff; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .5)); }
.nds-it-acoes { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; justify-content: flex-end; gap: 6px; opacity: 0; transition: opacity .15s; }
.nds-it:hover .nds-it-acoes, .nds-it:focus-within .nds-it-acoes { opacity: 1; }
@media (hover: none) { .nds-it-acoes { opacity: 1; } }
.nds-mini { width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(28, 28, 30, .72); color: #fff; display: grid; place-items: center; cursor: pointer; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.nds-mini svg { width: 17px; height: 17px; }
.nds-rod { display: flex; justify-content: center; padding: 20px 0; }
.nds-vazio { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 56px 16px; text-align: center; color: #6e6e73; }
.nds-vazio b { color: #1d1d1f; font-size: 17px; }
.nds-vazio p { margin: 0 0 10px; max-width: 340px; font-size: 14.5px; }
.nds-vz-ic { width: 64px; height: 64px; border-radius: 50%; border: 2px solid #1d1d1f; display: grid; place-items: center; color: #1d1d1f; margin-bottom: 8px; }
.nds-vz-ic svg { width: 28px; height: 28px; }
.nds-gira { width: 28px; height: 28px; border-radius: 50%; border: 3px solid #e5e5ea; border-top-color: #8e8e93; animation: nds-gira .8s linear infinite; }
@keyframes nds-gira { to { transform: rotate(360deg); } }

/* caixas centralizadas */
.nds-fundo { position: fixed; inset: 0; z-index: 100080; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .36); opacity: 0; transition: opacity .16s ease; }
.nds-fundo.on { opacity: 1; }
.nds-caixa { width: min(400px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 22px; border-radius: 20px; background: #fff; color: #1d1d1f; box-shadow: 0 24px 70px rgba(0, 0, 0, .25); font-family: var(--nd-fonte, system-ui, sans-serif); transform: scale(.97); transition: transform .16s cubic-bezier(.22, 1, .36, 1); }
.nds-fundo.on .nds-caixa { transform: none; }
.nds-caixa h2 { margin: 0 0 6px; font-size: 19px; text-align: center; }
.nds-caixa p { margin: 0 0 14px; color: #6e6e73; font-size: 14.5px; text-align: center; }
.nds-caixa form input { width: 100%; box-sizing: border-box; margin-top: 8px; }
.nds-erro { min-height: 18px; margin: 6px 0 0 !important; color: #ff3b30 !important; font-size: 13px !important; text-align: left !important; }
.nds-acoes { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.nds-escolha { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-height: 50dvh; overflow-y: auto; }
.nds-escolha button { position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: #f2f2f7; cursor: pointer; color: #1d1d1f; }
.nds-escolha img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nds-escolha button[aria-pressed="true"] { box-shadow: 0 0 0 3px #0a84ff inset; }
.nds-escolha .nds-marca { position: absolute; top: 6px; right: 6px; background: rgba(0, 0, 0, .25); border-color: #fff; }
.nds-escolha button[aria-pressed="true"] .nds-marca { background: #0a84ff; border-color: #0a84ff; }
.nds-escolha .nds-it-txt { font-size: 12px; padding: 8px; -webkit-line-clamp: 5; }
.nds-menu { position: fixed; z-index: 100075; min-width: 210px; padding: 6px; border-radius: 14px; background: #fff; box-shadow: 0 16px 40px rgba(0, 0, 0, .16), 0 0 0 1px rgba(0, 0, 0, .06); font-family: var(--nd-fonte, system-ui, sans-serif); }
.nds-menu button { display: block; width: 100%; min-height: 40px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: #1d1d1f; font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.nds-menu button:hover, .nds-menu button:focus-visible { background: #f2f2f7; outline: none; }
.nds-menu button.perigo { color: #ff3b30; }

@media (max-width: 600px) {
  .nds { padding: 4px 12px 28px; }
  .nds-cab h1 { font-size: 24px; }
  .nds-cab .nds-bt span { display: none; }
  .nds-cab .nds-bt { width: 42px; padding: 0; border-radius: 50%; }
  .nds-grade { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .nds-itens { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
  .nds-it { border-radius: 6px; }
  .nds-mini { width: 32px; height: 32px; }
  .nds-it-acoes { left: 4px; right: 4px; bottom: 4px; gap: 4px; }
}

/* modo escuro */
html.nd-escuro .nds, html.nd-escuro .nds-vazio b, html.nd-escuro .nds-vz-ic { color: #f5f5f7; }
html.nd-escuro .nds-vz-ic { border-color: #f5f5f7; }
html.nd-escuro .nds-janela, html.nd-escuro .nds-caixa, html.nd-escuro .nds-menu { background: #1c1c1e; color: #f5f5f7; box-shadow: 0 18px 50px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .08); }
html.nd-escuro .nds-menu button { color: #f5f5f7; }
html.nd-escuro .nds-lin:hover, html.nd-escuro .nds-j-mais:hover, html.nd-escuro .nds-j-tirar:hover, html.nd-escuro .nds-menu button:hover, html.nd-escuro .nds-bt.sec { background: #2c2c2e; color: #f5f5f7; }
html.nd-escuro .nds-capa, html.nd-escuro .nds-it, html.nd-escuro .nds-j-cab img, html.nd-escuro .nds-j-sem, html.nd-escuro .nds-escolha button { background: #2c2c2e; }
html.nd-escuro .nds-it-abrir { color: #f5f5f7; }
html.nd-escuro .nds-j-cab, html.nd-escuro .nds-j-tirar { border-color: rgba(255, 255, 255, .08); }
html.nd-escuro .nds-j-nova input, html.nd-escuro .nds-caixa input { background: #2c2c2e; border-color: rgba(255, 255, 255, .12); }
html.nd-escuro .nds-ic:hover { background: rgba(255, 255, 255, .08); }
@media (prefers-reduced-motion: reduce) { .nds-aviso.on, .nds-aviso.on.sai { animation-duration: .01s; } .nds-janela, .nds-fundo, .nds-caixa, .nds-capa, .nds-it { transition: none; } .nds-gira { animation-duration: 2s; } }
