/* Modo Ativação · componentes compartilhados (vendas + plataforma) */

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); }
.logo-mark { display: inline-flex; flex-shrink: 0; }
/* MODO ATIVAÇÃO numa linha só: "ação" muda só a cor, no mesmo tamanho */
.logo-word {
  display: inline-flex; align-items: baseline; gap: 5px;
  font-family: var(--font-display); font-weight: 900; text-transform: uppercase;
  font-size: 26px; line-height: 1; letter-spacing: -0.01em; white-space: nowrap;
}
.logo-word .k { color: var(--lime-primary); }

/* ---------- Botões ---------- */
.btn {
  --btn-h: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--btn-h); padding: 0 22px;
  border: 1px solid transparent; border-radius: var(--radius-btn);
  font-family: var(--font-ui); font-weight: 700; font-size: 15px;
  letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap;
  transition: transform var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease), box-shadow var(--t-base) var(--ease), color var(--t-fast) var(--ease);
}
/* o ícone nunca encolhe no flex (em 360px o olho e a seta chegavam a 0px) */
.btn svg { flex-shrink: 0; transition: transform var(--t-fast) var(--ease); }

.btn-primary { background: var(--lime-primary); color: var(--lime-ink); font-weight: 800; }
.btn-secondary { background: transparent; color: var(--text-primary); border-color: var(--border-default); }
.btn-ghost { background: transparent; color: var(--text-secondary); padding: 0 12px; }

.btn-lg { --btn-h: 58px; padding: 0 30px; font-size: 16px; }
.btn-sm { --btn-h: 40px; padding: 0 14px; font-size: 13px; }
/* bloco pode quebrar linha: um rótulo longo não alarga a trilha do grid */
.btn-block { width: 100%; white-space: normal; text-wrap: balance; text-align: center; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: var(--tap); height: var(--tap); flex-shrink: 0;
  border-radius: var(--radius-btn); border: 1px solid var(--border-default);
  background: rgba(9,9,9,.6); color: var(--text-primary);
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
    background-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.icon-btn[aria-pressed="true"] { color: var(--pink-signal); border-color: rgba(255,53,110,.45); }
.icon-btn[aria-pressed="true"] svg { fill: currentColor; }

/* hover só com mouse: no toque, o estado "levantado" ficava preso depois do toque */
@media (hover: hover) and (pointer: fine) {
  .btn:hover svg.arrow { transform: translateX(3px); }
  .btn-primary:hover { background: var(--lime-bright); transform: translateY(-1px); box-shadow: var(--glow-sm); }
  .btn-secondary:hover { border-color: var(--border-hover); color: var(--lime-primary); transform: translateY(-1px); }
  .btn-ghost:hover { color: var(--text-primary); background: rgba(255,255,255,.04); }
  .icon-btn:hover { border-color: var(--border-hover); color: var(--lime-primary); }
}

/* estado de toque (e de clique): resposta imediata ao dedo */
.btn:active { transform: scale(.98); transition-duration: 120ms; }
.btn-primary:active { background: var(--lime-dark); box-shadow: none; }
.icon-btn:active { transform: scale(.94); transition-duration: 120ms; }
.btn[disabled], .icon-btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- Chips e badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-default); background: rgba(255,255,255,.03);
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-secondary);
}
.chip-dot::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--lime-primary); box-shadow: 0 0 10px rgba(199,255,56,.7);
}
.chip-lime { color: var(--lime-primary); border-color: var(--border-strong); background: var(--lime-soft); }

/* sem vidro: dezenas de selos com blur pesam na rolagem do celular */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.4;
  background: rgba(9,9,9,.85); color: var(--text-primary); border: 1px solid var(--border-default);
}
.badge-new { background: var(--lime-primary); color: var(--lime-ink); border-color: transparent; }
.badge-pink { background: var(--pink-signal); color: var(--lime-ink); border-color: transparent; }
.badge-yellow { background: var(--yellow-alert); color: var(--lime-ink); border-color: transparent; }
.badge-outline { background: transparent; color: var(--text-secondary); }

/* botões de filtro (chips interativos) */
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 14px; flex-shrink: 0;
  border-radius: var(--radius-pill); border: 1px solid var(--border-default);
  background: var(--bg-secondary); color: var(--text-secondary);
  font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: all var(--t-fast) var(--ease);
}
.filter-chip[aria-pressed="true"] { background: var(--lime-primary); color: var(--lime-ink); border-color: var(--lime-primary); }
.filter-chip[aria-pressed="true"]::before { content: "✓"; font-weight: 800; }
.filter-chip[data-kind="all"][aria-pressed="true"]::before { content: none; }
@media (hover: hover) and (pointer: fine) {
  .filter-chip:hover { border-color: var(--border-hover); color: var(--text-primary); }
}
.filter-chip:active { transform: scale(.94); transition-duration: 120ms; }

/* ---------- Cards ---------- */
.card {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-card);
  transition: border-color var(--t-base) var(--ease), transform var(--t-base) var(--ease), background-color var(--t-base) var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .card-hover:hover { border-color: var(--border-hover); transform: translateY(-3px); }
}
.card-hover:active, .category-card:active { transform: scale(.985); transition-duration: 120ms; }

/* ---------- Thumbnail gerada (usada quando o conteúdo ainda não tem imagem) ---------- */
.thumb {
  position: relative; overflow: hidden;
  aspect-ratio: 9 / 16;
  background:
    radial-gradient(120% 80% at 80% 0%, var(--t2, #2a2a2a) 0%, transparent 60%),
    radial-gradient(100% 70% at 0% 100%, var(--t1, #1c1c1c) 0%, transparent 70%),
    #121212;
}
.thumb::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px) 0 0 / 22px 22px;
  mask-image: linear-gradient(180deg, transparent, #000 60%);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 60%);
}
.thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(9,9,9,0) 45%, rgba(9,9,9,.92) 100%);
}
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb-art {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%);
  color: rgba(255,255,255,.9); opacity: .92; z-index: 1;
}
.thumb-art svg { width: 38%; min-width: 34px; max-width: 64px; height: auto; margin-inline: auto; stroke-width: 1.6; }
.thumb-label {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 2;
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  font-size: 20px; line-height: .95;
}
.thumb-square { aspect-ratio: 4 / 3; }

/* ---------- Card de conteúdo (vídeo) ---------- */
.content-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 640px) { .content-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .content-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; } }
@media (min-width: 1440px) { .content-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.video-card { display: flex; flex-direction: column; overflow: hidden; }
.video-card .thumb { border-radius: var(--radius-card) var(--radius-card) 0 0; }
.video-card .thumb-open {
  position: absolute; inset: 0; z-index: 3; width: 100%;
  background: transparent; border: 0; border-radius: 0;
}
/* o card corta o que vaza; o anel de foco fica por dentro */
.video-card .thumb-open:focus-visible { outline: 2px solid var(--lime-primary); outline-offset: -4px; border-radius: var(--radius-card) var(--radius-card) 0 0; }
.video-card .thumb-badges { position: absolute; top: 10px; left: 10px; right: 54px; z-index: 4; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.video-card .fav-slot { position: absolute; top: 6px; right: 6px; z-index: 4; }
.video-card .play-hint {
  position: absolute; left: 50%; top: 42%; z-index: 2; transform: translate(-50%, -50%) scale(.9);
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: var(--lime-primary); color: var(--lime-ink); opacity: 0;
  transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}
.video-card .play-hint svg { fill: currentColor; margin-left: 3px; }
@media (hover: hover) and (pointer: fine) {
  .video-card:hover .play-hint { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  .video-card:hover .thumb-art { opacity: .25; }
}
/* no toque não existe hover: o play fica sempre visível */
@media (hover: none) {
  .video-card .play-hint { opacity: .9; width: 40px; height: 40px; transform: translate(-50%, -50%); }
  .video-card .thumb-art { opacity: .25; }
}
.content-body { display: flex; flex-direction: column; gap: 10px; padding: 12px 12px 14px; flex: 1; }
.content-title { font-weight: 600; font-size: 14px; line-height: 1.3; }
.content-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 10px; align-items: center; }
.video-card .meta-extra { display: none; }
.content-actions { display: flex; gap: 8px; margin-top: auto; }
.content-actions .btn { flex: 1; --btn-h: 40px; padding: 0 10px; font-size: 12px; }
/* card da página de vendas: prévia aberta, download só na área de membros */
.video-card.is-sales .content-actions { flex-direction: column; align-items: stretch; }
.lock-note { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); }

/* ---------- Card de prompt ---------- */
.prompt-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.prompt-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.prompt-card-kicker { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--lime-primary); display: inline-flex; gap: 8px; align-items: center; }
.prompt-card h3 { font-family: var(--font-display); font-weight: 800; font-size: 24px; line-height: 1; text-transform: uppercase; }
.prompt-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }
.prompt-snippet {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12px; line-height: 1.55;
  color: var(--text-muted); background: var(--bg-inset); border: 1px solid var(--border-subtle);
  border-radius: 10px; padding: 10px 12px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.prompt-card .content-actions { margin-top: auto; }

.prompt-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .prompt-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 1180px) { .prompt-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; } }

/* ---------- Card de categoria ---------- */
.category-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (min-width: 640px) { .category-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (min-width: 1024px) { .category-grid { grid-template-columns: repeat(5, minmax(0,1fr)); gap: 16px; } }
.category-card { display: block; overflow: hidden; }
.category-card .thumb { aspect-ratio: 4 / 5; }
/* rótulo acompanha a largura e quebra em vez de cortar ("Relacionamento" em 3 colunas) */
.category-card .thumb-label { font-size: clamp(17px, 5vw, 22px); overflow-wrap: anywhere; }
.category-card .count, .category-card .soon { position: absolute; top: 10px; left: 10px; z-index: 2; }
.category-card.is-soon { opacity: .6; }
.category-card .go {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--border-default); background: rgba(9,9,9,.6); color: var(--text-primary);
  transition: all var(--t-base) var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .category-card:hover .go { background: var(--lime-primary); color: var(--lime-ink); border-color: transparent; }
}

/* ---------- Cards compactos no celular ---------- */
@media (max-width: 639px) {
  .content-grid { gap: 10px; }
  .content-grid .video-card .thumb { aspect-ratio: 3 / 4; }
  /* a miniatura inteira já é o botão de ver; nicho e formato descem para a linha de texto */
  .video-card .badge-extra, .video-card .btn-view { display: none; }
  .video-card .meta-extra { display: inline; }
  .video-card:not(.is-sales) .content-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: start; align-items: start; gap: 4px 8px; padding: 10px; }
  .video-card:not(.is-sales) .content-actions { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
  .video-card:not(.is-sales) .content-actions .btn { flex: 0 0 auto; width: var(--tap); padding: 0; }
  .video-card .btn-label {
    position: absolute; width: 1px; height: 1px; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .video-card .content-title { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .video-card .content-meta { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .video-card .content-meta span + span::before { content: " · "; }
}

@media (max-width: 719px) {
  /* o card inteiro abre o prompt; copiar e favoritar ficam no canto, ao alcance do polegar */
  .prompt-card { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: start; gap: 6px 8px; padding: 14px 14px 16px 16px; }
  .prompt-card-top, .prompt-card .content-actions { display: contents; }
  .prompt-card-kicker { grid-column: 1; grid-row: 1; }
  .prompt-card .fav-btn { grid-column: 2; grid-row: 1 / span 2; }
  .prompt-card .content-actions [data-copy-prompt] { grid-column: 3; grid-row: 1 / span 2; width: var(--tap); padding: 0; }
  .prompt-card .content-actions .label {
    position: absolute; width: 1px; height: 1px; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .prompt-card h3 { grid-column: 1; grid-row: 2; font-size: 21px; }
  .prompt-card p { grid-column: 1 / -1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .prompt-card .prompt-snippet, .prompt-card .chip-row, .prompt-card .content-actions a { display: none; }
  /* a caixa do próprio link também chega a 44px, sem mexer no layout (a margem negativa devolve o espaço) */
  .prompt-card .stretched { display: block; padding-block: 12px; margin-block: -12px; }
  .prompt-card .stretched::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
  .prompt-card .stretched:focus-visible { outline: none; }
  .prompt-card .stretched:focus-visible::after { outline: 2px solid var(--lime-primary); outline-offset: -2px; }
  .prompt-card .fav-btn, .prompt-card [data-copy-prompt] { position: relative; z-index: 2; }
}

/* alvos de toque de 44px em telas de toque e abaixo do desktop (o mouse a partir de 1024px segue com 40px) */
@media (pointer: coarse), (max-width: 1023px) {
  .btn-sm, .content-actions .btn { --btn-h: var(--tap); }
  .filter-chip { min-height: var(--tap); }
}

/* ---------- Toggle ON/OFF ---------- */
.mode-toggle {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 8px 10px 8px 16px; min-height: var(--tap);
  border-radius: var(--radius-pill); border: 1px solid var(--border-default);
  background: var(--bg-secondary);
  font-family: var(--font-ui); font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-secondary);
  transition: border-color var(--t-slow) var(--ease), box-shadow var(--t-slow) var(--ease);
}
.mode-toggle .state { min-width: 2.6em; color: var(--text-muted); transition: color var(--t-slow) var(--ease); }
.mode-toggle .track {
  position: relative; width: 58px; height: 30px; border-radius: var(--radius-pill);
  background: #232323; border: 1px solid var(--border-default);
  transition: background-color var(--t-slow) var(--ease), border-color var(--t-slow) var(--ease);
}
.mode-toggle .knob {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #6b6b66; transition: transform var(--t-slow) var(--ease), background-color var(--t-slow) var(--ease);
}
.mode-toggle[aria-checked="true"] { border-color: var(--border-strong); box-shadow: var(--glow-sm); }
.mode-toggle[aria-checked="true"] .state { color: var(--lime-primary); }
.mode-toggle[aria-checked="true"] .track { background: var(--lime-soft); border-color: var(--border-strong); }
.mode-toggle[aria-checked="true"] .knob { transform: translateX(28px); background: var(--lime-primary); }

/* ---------- Controle segmentado (abas ou filtro de escolha única) ---------- */
.segmented {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
  padding: 4px; border-radius: 14px;
  background: var(--bg-secondary); border: 1px solid var(--border-subtle);
}
.segmented-btn {
  min-height: var(--tap); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 10px; border: 0; border-radius: 10px; background: none;
  font-size: 14px; font-weight: 700; color: var(--text-secondary);
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.segmented-btn svg { flex-shrink: 0; }
/* selecionado = estado ON da marca */
.segmented-btn[aria-selected="true"], .segmented-btn[aria-pressed="true"] { background: var(--lime-primary); color: var(--lime-ink); }
.segmented-btn:focus-visible { outline-offset: -2px; }
.segmented-btn:active { transform: scale(.94); transition-duration: 120ms; }
.seg-badge {
  display: inline-flex; align-items: center; padding: 2px 6px; border-radius: 6px;
  background: var(--pink-signal); color: var(--lime-ink);
  font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; line-height: 1.3;
}

/* ---------- Trilho com snap ----------
   .rail vale em todas as larguras; .rail-m só abaixo de 768px (no desktop o elemento mantém o próprio layout).
   O padding vertical de 6px evita o anel de foco cortado. Sem JS o trilho continua deslizável. */
.rail {
  --rail-col: 158px; --rail-gap: 12px;
  position: relative; display: grid; grid-auto-flow: column; grid-template-columns: none;
  grid-auto-columns: var(--rail-col); gap: var(--rail-gap);
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  margin-inline: calc(var(--gutter) * -1); padding: 6px var(--gutter) 10px; scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}
.rail > * { scroll-snap-align: start; min-width: 0; }
@media (max-width: 767px) {
  .rail-m {
    --rail-col: 158px; --rail-gap: 12px;
    position: relative; display: grid; grid-auto-flow: column; grid-template-columns: none;
    grid-auto-columns: var(--rail-col); gap: var(--rail-gap);
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
    margin-inline: calc(var(--gutter) * -1); padding: 6px var(--gutter) 10px; scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .rail-m > * { scroll-snap-align: start; min-width: 0; }
}
@media (pointer: fine) {
  .rail, .rail-m { scrollbar-width: thin; scrollbar-color: #333 transparent; }
}
/* indicadores (gerados por ui.rail, sempre aria-hidden): passos OFF → ON rumo ao último, ou barra */
.rail-steps { display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.rail-steps b { margin-right: 6px; font-family: var(--font-display); font-weight: 900; font-size: 16px; line-height: 1; font-variant-numeric: tabular-nums; }
.rail-steps i { flex: 1; height: 3px; border-radius: 3px; background: #2a2a2a; transition: background-color var(--t-base) var(--ease); }
.rail-steps i.on { background: var(--lime-primary); }
.rail-bar { height: 3px; margin-top: 12px; border-radius: 3px; background: #2a2a2a; overflow: hidden; }
.rail-bar i { display: block; height: 100%; background: var(--lime-primary); transform-origin: left; transform: scaleX(0); }
@media (min-width: 768px) { .rail-ind-m { display: none; } }

/* ---------- Busca ---------- */
.search-bar { position: relative; display: flex; align-items: center; }
.search-bar svg.lead { position: absolute; left: 16px; color: var(--text-muted); pointer-events: none; }
.search-bar input {
  width: 100%; min-height: 54px; padding: 0 48px 0 48px;
  border-radius: var(--radius-input); border: 1px solid var(--border-field);
  background: var(--bg-secondary); color: var(--text-primary); font-size: 16px;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar input:focus { outline: none; border-color: var(--lime-primary); box-shadow: 0 0 0 4px rgba(199,255,56,.08); }
.search-bar input::-webkit-search-cancel-button { display: none; }
.search-bar .clear { position: absolute; right: 6px; }
.search-bar .clear[hidden] { display: none; }

/* ---------- Campos ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.input, .select {
  width: 100%; min-height: 50px; padding: 0 14px;
  border-radius: var(--radius-input); border: 1px solid var(--border-field);
  background: var(--bg-secondary); color: var(--text-primary); font-size: 16px;
}
.select {
  appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23B7B7B2' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.select option { background: var(--bg-elevated); }
.input:focus, .select:focus { outline: none; border-color: var(--lime-primary); box-shadow: 0 0 0 4px rgba(199,255,56,.08); }

/* ---------- Toast (acima da barra fixa da página: --dock; no modal de vídeo, abaixo do cabeçalho) ---------- */
.toast-region {
  position: fixed; left: 50%; bottom: calc(var(--dock) + 12px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 300;
  display: flex; flex-direction: column; gap: 10px; align-items: center;
  width: calc(100% - 32px); max-width: 420px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 16px; border-radius: 14px;
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  box-shadow: 0 16px 40px rgba(0,0,0,.5);
  font-size: 14px; font-weight: 600;
  animation: toast-in 280ms var(--ease) both;
}
.toast .toast-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--lime-primary); color: var(--lime-ink); flex-shrink: 0; }
.toast.is-info .toast-icon { background: #2a2a2a; color: var(--text-primary); }
.toast.is-leaving { animation: toast-out 220ms var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Modal ---------- */
.modal {
  width: min(560px, calc(100% - 24px)); max-width: calc(100% - 24px); max-height: calc(100dvh - 32px);
  padding: 0; border: 1px solid var(--border-default); border-radius: var(--radius-card-lg);
  background: var(--bg-secondary); color: var(--text-primary);
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  overflow: hidden; display: flex; flex-direction: column;
}
.modal:not([open]) { display: none; }
.modal::backdrop { background: rgba(5,5,5,.86); }
.modal[open] { animation: modal-in 280ms var(--ease) both; }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 0 20px; }
.modal-head h2 { min-width: 0; font-family: var(--font-display); font-weight: 800; font-size: 24px; text-transform: uppercase; line-height: 1; }
.modal-body { padding: 16px 20px 20px; overflow: auto; overscroll-behavior: contain; min-height: 0; }
.modal-foot { display: grid; gap: 12px; padding: 16px 20px 20px; border-top: 1px solid var(--border-subtle); }
.modal-video .modal-body { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.modal-video .close-down { display: none; }
/* o rodapé do vídeo é de ações (coração, Baixar, prompt): o toast fica logo abaixo do cabeçalho, sobre o topo do vídeo */
.modal-video .toast-region { position: absolute; top: 66px; bottom: auto; }
.player {
  position: relative; width: min(100%, calc(52svh * 9 / 16)); max-width: 320px; margin-inline: auto;
  aspect-ratio: 9/16; border-radius: var(--radius-card); overflow: hidden; background: #000;
}
.player video { width: 100%; height: 100%; object-fit: cover; }
.player .thumb { position: absolute; inset: 0; aspect-ratio: auto; height: 100%; }
.player-note {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 3;
  font-size: 12px; color: var(--text-secondary); text-align: center;
  background: rgba(9,9,9,.8); border: 1px solid var(--border-default); border-radius: 10px; padding: 8px 10px;
}

/* vídeo em tela cheia no celular: cabeçalho e ações fixos, só o meio rola */
@media (max-width: 639px) {
  .modal-video { width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; }
  .modal-video[open] { animation: sheet-in 280ms var(--ease); }
  .modal-video .modal-head { padding: calc(6px + env(safe-area-inset-top)) 8px 6px 16px; border-bottom: 1px solid var(--border-subtle); }
  .modal-video .modal-head h2 { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .modal-video .toast-region { top: calc(64px + env(safe-area-inset-top)); }
  .modal-video .close-x { display: none; }
  .modal-video .close-down { display: block; }
  .modal-video .modal-body { flex: 1; align-content: start; gap: 14px; padding: 16px; }
  .modal-video .player { width: auto; max-width: none; height: min(calc(100dvh - 240px), calc((100vw - 32px) * 16 / 9)); }
  .modal-video .modal-foot { gap: 6px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .modal-video .modal-foot .content-actions .btn { --btn-h: 52px; font-size: 14px; }
  .modal-video .modal-foot .fav-btn { width: 52px; height: 52px; }
  .modal-video .modal-foot > .btn-secondary { border-color: transparent; color: var(--text-secondary); }
}

/* ---------- Folha inferior (dialog.sheet) ---------- */
dialog.sheet {
  padding: 0; border: 1px solid var(--border-default);
  background: var(--bg-secondary); color: var(--text-primary);
  display: flex; flex-direction: column; overflow: hidden; overscroll-behavior: contain;
}
dialog.sheet:not([open]) { display: none; }
.sheet::backdrop { background: rgba(5,5,5,.8); }
.sheet-grip { flex-shrink: 0; height: 24px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.sheet-grip::before { content: ""; width: 42px; height: 4px; border-radius: 4px; background: #333; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px 8px 20px; }
.sheet-head h2 { min-width: 0; font-family: var(--font-display); font-weight: 800; font-size: 24px; line-height: 1; text-transform: uppercase; }
.sheet-body { overflow: auto; overscroll-behavior: contain; min-height: 0; padding: 8px 20px 16px; }
.sheet-foot { display: flex; gap: 10px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border-subtle); }
.sheet-foot .btn { flex: 1; }
@media (max-width: 1023px) {
  dialog.sheet {
    margin: auto 0 0; width: 100%; max-width: none; max-height: 92dvh;
    border: 0; border-top: 1px solid var(--border-default); border-radius: 22px 22px 0 0;
  }
  dialog.sheet[open] { animation: sheet-in 280ms var(--ease); }
}
/* no desktop vira diálogo centralizado, como o .modal */
@media (min-width: 1024px) {
  dialog.sheet {
    width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 32px);
    border-radius: var(--radius-card-lg); box-shadow: 0 30px 80px rgba(0,0,0,.6);
  }
  dialog.sheet[open] { animation: modal-in 280ms var(--ease) both; }
  .sheet-grip { display: none; }
  .sheet-head { padding-top: 14px; }
}
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
/* folha de copiar à mão (quando a área de transferência falha) */
.copy-area {
  display: block; min-height: 220px; margin-top: 12px; padding: 12px 14px; resize: vertical;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 16px; line-height: 1.6;
}

/* ---------- Estado vazio ---------- */
.empty-state {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px;
  padding: 56px 20px; border: 1px dashed var(--border-default); border-radius: var(--radius-card-lg);
  background: rgba(255,255,255,.015);
}
.empty-state .empty-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--bg-elevated); color: var(--lime-primary); margin-bottom: 4px; }
.empty-state h3 { font-family: var(--font-display); font-weight: 800; font-size: 28px; text-transform: uppercase; line-height: 1; }
.empty-state p { color: var(--text-secondary); max-width: 38ch; font-size: 15px; }
.empty-state .btn { margin-top: 8px; }

/* ---------- Abertura (OFF → ON) ---------- */
.boot {
  position: fixed; inset: 0; z-index: 400; display: grid; place-items: center;
  background: var(--bg-primary); transition: opacity 300ms var(--ease), visibility 300ms;
}
.boot.is-done { opacity: 0; visibility: hidden; }
/* sem JS ninguém tira a abertura. Não usa html:not(.js): no app.html a classe só chega com o ui.js, no fim do body */
@media (scripting: none) { .boot { display: none; } }
.boot .sym-pulse { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 700ms var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- Accordion (FAQ) ---------- */
.accordion { display: grid; gap: 10px; }
.acc-item { border: 1px solid var(--border-subtle); border-radius: var(--radius-card); background: var(--bg-secondary); transition: border-color var(--t-base) var(--ease); }
.acc-item.is-open { border-color: var(--border-strong); }
.acc-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 20px; min-height: 60px; text-align: left;
  background: none; border: 0; font-size: 16px; font-weight: 600;
}
.acc-trigger .acc-ico { flex-shrink: 0; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--bg-elevated); color: var(--lime-primary); transition: transform var(--t-base) var(--ease); }
.acc-item.is-open .acc-ico { transform: rotate(45deg); }
.acc-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--t-slow) var(--ease); }
.acc-item.is-open .acc-panel { grid-template-rows: 1fr; }
.acc-panel > div { overflow: hidden; }
.acc-panel p { padding: 0 20px 20px; color: var(--text-secondary); font-size: 15px; max-width: 68ch; }
.acc-more { margin-top: 10px; }
/* no celular: as dúvidas decisivas primeiro e o resto a um toque */
@media (max-width: 767px) {
  .accordion:not(.is-expanded) .acc-item.is-extra { display: none; }
  .acc-trigger { padding: 14px 16px; font-size: 15px; }
  .acc-panel p { padding: 0 16px 16px; }
}
@media (min-width: 768px) { .acc-more { display: none; } }

/* ---------- Painel de prompt ---------- */
.prompt-panel { border-radius: var(--radius-card-lg); background: var(--bg-inset); border: 1px solid var(--border-default); overflow: hidden; }
.prompt-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px 12px 18px; border-bottom: 1px solid var(--border-subtle); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); }
.prompt-panel pre { margin: 0; padding: 20px 18px; white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 14px; line-height: 1.75; color: var(--text-primary); }
mark.ph { background: rgba(199,255,56,.12); color: var(--lime-primary); border: 1px dashed rgba(199,255,56,.45); border-radius: 6px; padding: 1px 5px; font-weight: 600; }

/* ---------- Aviso de desenvolvimento ---------- */
.dev-note {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: 12px;
  border: 1px dashed rgba(255,213,31,.45); background: rgba(255,213,31,.06);
  color: #e9d58a; font-size: 13px; line-height: 1.5;
}
.dev-note strong { color: var(--yellow-alert); }
