/* ============================================================
   nickihub — central de vídeos
   Paleta: plum escuro + mel (produtos) + violeta (receitas)
   ============================================================ */

/* Estes valores são o padrão de fábrica.
   O admin sobrescreve tudo em Gerenciar site › Aparência — o PHP injeta
   um :root novo logo depois deste arquivo. Por isso nada aqui pra baixo
   usa cor fixa: tudo passa por variável. */
:root {
  --void:      #0E0B12;
  --void-deep: #0B080F;
  --void-blur: rgba(14, 11, 18, .82);
  --panel:     #16121D;
  --raise:     #1E1826;
  --raise-2:   #271F31;
  --raise-3:   #322942;
  --rail-1:    #161020;
  --rail-2:    #120E18;
  --scroll:       #2C2436;
  --scroll-hover: #3B3148;
  --line:      rgba(255, 255, 255, .075);
  --line-str:  rgba(255, 255, 255, .14);
  /* preenchimentos suaves; viram pretos translúcidos no tema claro */
  --fill:      var(--fill);
  --fill-2:    var(--fill-2);
  --fill-3:    var(--fill-3);

  --honey:      #FFB13B;
  --honey-2:    #FF8A3D;
  --honey-dim:  rgba(255, 177, 59, .14);
  --honey-wash: rgba(255, 177, 59, .07);
  --honey-glow: rgba(255, 177, 59, .28);
  --honey-soft: rgba(255, 177, 59, .45);
  --on-honey:   #17110A;

  --berry:      #B57BFF;
  --berry-dim:  rgba(181, 123, 255, .14);
  --berry-wash: rgba(181, 123, 255, .07);
  --berry-glow: rgba(181, 123, 255, .28);
  --berry-soft: rgba(181, 123, 255, .45);
  --on-berry:   #150F1D;

  --mint:      #3DDC84;
  --danger:    #FF6B6B;

  --text:      #F3EEE7;
  --mute:      #9E95AA;
  --faint:     #6C6478;

  --display: 'Bricolage Grotesque', 'Archivo', system-ui, sans-serif;
  --body:    'Inter', system-ui, -apple-system, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, monospace;

  --rail-w: 252px;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;

  --ease: cubic-bezier(.2, .8, .25, 1);
  --shadow: 0 18px 50px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.app {
  background-image:
    radial-gradient(900px 480px at 12% -8%, var(--honey-wash), transparent 62%),
    radial-gradient(760px 420px at 92% 4%, var(--berry-wash), transparent 60%);
  background-attachment: fixed;
}

h1, h2, h3, h4 { font-family: var(--display); margin: 0; letter-spacing: -.02em; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--honey); outline-offset: 3px; border-radius: 4px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 20px; border: 3px solid var(--void); }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-hover); }

/* ============================================================
   ESTRUTURA
   ============================================================ */
.app-shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- Barra lateral ---------- */
.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 16px 18px;
  background: linear-gradient(180deg, var(--rail-1) 0%, var(--rail-2) 100%);
  border-right: 1px solid var(--line);
  z-index: 40;
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 4px;
  animation: slide-in .5s var(--ease) both;
}

.brand-mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--honey), var(--honey-2));
  box-shadow: 0 6px 18px var(--honey-glow);
}
.brand-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--on-honey);
  animation: pulse-dot 2.6s var(--ease) infinite;
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(.6); opacity: .6; }
}

.brand-text {
  font-family: var(--display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -.035em;
}
.brand-text span { color: var(--honey); }

.rail-nav { position: relative; display: flex; flex-direction: column; gap: 3px; }

.rail-indicator {
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  height: 42px;
  border-radius: 11px;
  background: var(--raise);
  border: 1px solid var(--line-str);
  transition: transform .42s var(--ease), opacity .3s;
  opacity: 0;
  pointer-events: none;
}
.rail-indicator.is-ready { opacity: 1; }
.rail-indicator::before {
  content: '';
  position: absolute;
  left: -16px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  border-radius: 0 3px 3px 0;
  background: var(--honey);
}

.rail-item {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--mute);
  cursor: pointer;
  text-align: left;
  transition: color .2s;
  animation: slide-in .5s var(--ease) both;
}
.rail-item:nth-child(2) { animation-delay: .04s; }
.rail-item:nth-child(3) { animation-delay: .08s; }
.rail-item:nth-child(4) { animation-delay: .12s; }
.rail-item:nth-child(6) { animation-delay: .16s; }

.rail-item svg { width: 17px; height: 17px; fill: currentColor; flex: none; transition: transform .3s var(--ease); }
.rail-item:hover { color: var(--text); }
.rail-item:hover svg { transform: translateY(-1px) scale(1.06); }
.rail-item.is-active { color: var(--text); }
.rail-item.is-active svg { fill: var(--honey); }

.rail-label { flex: 1; font-weight: 500; font-size: 14.5px; }

.rail-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  background: var(--fill-2);
  padding: 1px 7px;
  border-radius: 20px;
}
.rail-item.is-active .rail-count { color: var(--honey); background: var(--honey-dim); }

.rail-divider { height: 1px; background: var(--line); margin: 9px 12px; }

.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }

.rail-action {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--fill);
  color: var(--mute);
  font-size: 13.5px;
  cursor: pointer;
  transition: all .22s var(--ease);
}
.rail-action svg { width: 15px; height: 15px; fill: currentColor; transition: transform .5s var(--ease); }
.rail-action:hover { color: var(--text); border-color: var(--line-str); background: var(--fill-2); }
.rail-action:hover svg { transform: rotate(90deg); }

.rail-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: var(--fill);
  border: 1px solid var(--line);
}
.user-avatar {
  width: 30px; height: 30px; flex: none;
  border-radius: 9px;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 13px;
  background: var(--honey-dim); color: var(--honey);
}
body[data-role="colaborador"] .user-avatar { background: var(--berry-dim); color: var(--berry); }
.user-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.user-meta strong { font-size: 13px; font-weight: 600; }
.user-meta span { font-size: 11px; color: var(--faint); font-family: var(--mono); }
.user-exit {
  width: 28px; height: 28px; flex: none;
  display: grid; place-items: center;
  border-radius: 8px; color: var(--faint);
  transition: all .2s;
}
.user-exit svg { width: 15px; height: 15px; fill: currentColor; }
.user-exit:hover { color: var(--danger); background: rgba(255, 107, 107, .1); }

/* ---------- Área principal ---------- */
.app-main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 30px;
  background: var(--void-blur);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}
.topbar-sub {
  display: block;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
  letter-spacing: .04em;
}

.topbar-tools { display: flex; align-items: center; gap: 10px; }

.search {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  height: 38px;
  padding: 0 12px;
  border-radius: 11px;
  background: var(--raise);
  border: 1px solid var(--line);
  transition: border-color .2s, box-shadow .2s, width .3s var(--ease);
  width: 210px;
}
.search:focus-within { border-color: var(--honey-soft); box-shadow: 0 0 0 3px var(--honey-dim); width: 260px; }
.search svg { width: 15px; height: 15px; fill: var(--faint); flex: none; }
.search input { border: 0; background: none; outline: none; width: 100%; font-size: 14px; }
.search input::placeholder { color: var(--faint); }
.search-clear { border: 0; background: none; color: var(--faint); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 2px; }
.search-clear:hover { color: var(--text); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: transform .18s var(--ease), background .2s, border-color .2s, box-shadow .2s;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; fill: currentColor; }
.btn:active { transform: scale(.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--honey), var(--honey-2));
  color: var(--on-honey);
  box-shadow: 0 8px 22px var(--honey-glow);
}
.btn-primary:hover { box-shadow: 0 12px 30px var(--honey-soft); transform: translateY(-1px); }

.btn-soft { background: var(--raise-2); color: var(--text); border-color: var(--line-str); }
.btn-soft:hover { background: var(--raise-3); }

.btn-ghost { background: var(--fill-2); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--fill-3); }

.rail-toggle { display: none; }

/* ============================================================
   VIEWS
   ============================================================ */
.viewport { padding: 26px 30px 70px; }

.view { display: none; }
.view.is-active { display: block; animation: view-in .38s var(--ease) both; }

@keyframes view-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@keyframes slide-in {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Chips (produtos / ingredientes) ---------- */
.chips-bar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 24px;
  padding-bottom: 4px;
}
.chips {
  display: flex; gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px;
  padding: 0 15px;
  border-radius: 30px;
  border: 1px solid var(--line);
  background: var(--fill);
  color: var(--mute);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all .24s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--line-str); transform: translateY(-1px); }
.chip .chip-num { font-family: var(--mono); font-size: 11px; color: var(--faint); }

.chip.is-active {
  background: var(--honey); border-color: var(--honey); color: var(--on-honey); font-weight: 600;
  box-shadow: 0 8px 20px var(--honey-glow);
}
.chip.is-active .chip-num { color: currentColor; opacity: .6; }

#receitaChips .chip.is-active,
.chips[data-accent="berry"] .chip.is-active {
  background: var(--berry); border-color: var(--berry); color: var(--on-berry);
  box-shadow: 0 8px 20px var(--berry-glow);
}

.chip-add {
  flex: none;
  width: 36px; padding: 0;
  justify-content: center;
  font-size: 19px; color: var(--faint);
  border-style: dashed;
}
.chip-add:hover { color: var(--honey); border-color: var(--honey); }

/* ---------- Containers de categoria ---------- */
.stack { display: flex; flex-direction: column; gap: 22px; }

.panel {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--fill);
  padding: 20px 22px 24px;
  animation: panel-in .45s var(--ease) both;
}
.panel:nth-child(1) { animation-delay: .02s; }
.panel:nth-child(2) { animation-delay: .09s; }
.panel:nth-child(3) { animation-delay: .16s; }
.panel:nth-child(4) { animation-delay: .23s; }

@keyframes panel-in {
  from { opacity: 0; transform: translateY(16px) scale(.995); }
  to   { opacity: 1; transform: none; }
}

.panel-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px;
}
.panel-head h2 {
  font-size: 16.5px; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
}
.panel-head h2::before {
  content: '';
  width: 7px; height: 7px; border-radius: 2px;
  background: var(--honey);
  box-shadow: 0 0 12px var(--honey-soft);
}
.panel[data-accent="berry"] .panel-head h2::before { background: var(--berry); box-shadow: 0 0 12px var(--berry-soft); }

.panel-count {
  font-family: var(--mono); font-size: 11px;
  color: var(--faint);
  border: 1px solid var(--line);
  padding: 2px 8px; border-radius: 20px;
}
.panel-actions { margin-left: auto; display: flex; gap: 8px; }

.panel-upload {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 12px;
  border-radius: 9px;
  border: 1px dashed var(--line-str);
  background: transparent; color: var(--mute);
  font-size: 12.5px; cursor: pointer;
  transition: all .22s var(--ease);
}
.panel-upload svg { width: 13px; height: 13px; fill: currentColor; }
.panel-upload:hover { color: var(--honey); border-color: var(--honey); background: var(--honey-dim); }

/* ---------- Grade de vídeos ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--raise);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
  animation: card-in .45s var(--ease) both;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--honey-soft);
  box-shadow: 0 16px 34px rgba(0, 0, 0, .5);
}

.card-media {
  position: relative;
  aspect-ratio: 9 / 16;
  background: var(--void-deep);
  overflow: hidden;
}

/* A capa é uma imagem: aparece instantânea, sem baixar vídeo nenhum. */
.card-thumb {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s var(--ease), opacity .35s var(--ease);
  animation: thumb-in .4s var(--ease) both;
}
@keyframes thumb-in { from { opacity: 0; } to { opacity: 1; } }
.card:hover .card-thumb { transform: scale(1.05); }

/* O vídeo da prévia só é criado quando o mouse para em cima. */
.card-preview {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.card-media.is-previa .card-preview { opacity: 1; }
.card-media.is-previa .card-thumb { opacity: 0; }

/* Enquanto não há capa (ou enquanto a prévia carrega), um brilho suave. */
.card-skeleton {
  width: 100%; height: 100%;
  background: linear-gradient(100deg, var(--fill) 30%, var(--fill-3) 50%, var(--fill) 70%);
  background-size: 300% 100%;
  animation: skeleton 1.4s ease-in-out infinite;
}
@keyframes skeleton {
  from { background-position: 130% 0; }
  to   { background-position: -30% 0; }
}

/* Capa impossível de gerar: para de brilhar e mostra um ícone parado. */
.card-skeleton.is-vazia {
  animation: none;
  background: var(--fill);
  display: grid; place-items: center;
}
.card-skeleton.is-vazia svg { width: 30px; height: 30px; fill: var(--faint); opacity: .5; }

.card-media.is-carregando::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--honey), transparent);
  background-size: 45% 100%;
  background-repeat: no-repeat;
  animation: carregando 1s linear infinite;
  z-index: 2;
}
@keyframes carregando {
  from { background-position: -45% 0; }
  to   { background-position: 145% 0; }
}

/* ---------- Card de áudio ---------- */
.card-onda {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background:
    radial-gradient(120% 90% at 50% 12%, var(--berry-wash), transparent 62%),
    var(--void-deep);
  overflow: hidden;
}
.onda-barras {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  gap: 3px;
  padding: 0 12px;
}
.onda-barras span {
  flex: 1;
  min-width: 2px; max-width: 5px;
  border-radius: 3px;
  background: var(--berry);
  opacity: .32;
  transform-origin: center;
}
.card:hover .onda-barras span { animation: onda 1.15s ease-in-out infinite alternate; }
@keyframes onda {
  from { transform: scaleY(.55); opacity: .28; }
  to   { transform: scaleY(1.25); opacity: .7; }
}
.onda-nota {
  position: relative;
  width: 40px; height: 40px;
  fill: var(--berry);
  filter: drop-shadow(0 4px 14px var(--berry-glow));
}
.card.eh-audio .card-play { background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .35)); }
.card.eh-audio:hover { border-color: var(--berry-soft); }
.card.eh-audio:hover .card-play span { background: var(--berry); }
.card.eh-audio:hover .card-play svg { fill: var(--on-berry); }
.card.eh-audio .card-media { aspect-ratio: 1 / 1; }

/* ---------- Card de imagem ---------- */
/* A foto aparece inteira, sem cortar — enquadramento importa mais que
   uniformidade quando o acervo é de arte e referência. */
.card.eh-imagem .card-media { aspect-ratio: 4 / 5; background: var(--fill); }
.card.eh-imagem .card-thumb { object-fit: contain; }
.card.eh-imagem:hover { border-color: var(--mint); }
.card.eh-imagem .card-play { background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, .45)); }
.card.eh-imagem:hover .card-play span { background: var(--mint); }
.card.eh-imagem:hover .card-play svg { fill: #0B1F13; }
.card.eh-imagem .card-badge { background: rgba(11, 8, 15, .6); }

/* ---------- Visualizador de imagem ---------- */
.player-imagem {
  display: grid; place-items: center;
  background: var(--void-deep);
  min-height: 240px;
  max-height: 78vh;
  overflow: hidden;
}
.player-imagem[hidden] { display: none; }
.player-imagem img {
  max-width: 100%; max-height: 78vh;
  display: block;
  object-fit: contain;
  animation: thumb-in .35s var(--ease) both;
}

/* ---------- Player de áudio ---------- */
.player-audio {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  padding: 40px 24px 26px;
  background:
    radial-gradient(90% 70% at 50% 0%, var(--berry-wash), transparent 65%),
    var(--void-deep);
}
.player-audio[hidden] { display: none; }
.audio-arte {
  position: relative;
  width: 118px; height: 118px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--berry-dim);
}
.audio-arte svg { width: 46px; height: 46px; fill: var(--berry); position: relative; }
.audio-anel {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1px solid var(--berry-soft);
  animation: audio-pulso 2.6s var(--ease) infinite;
}
@keyframes audio-pulso {
  0%   { transform: scale(1); opacity: .85; }
  70%  { transform: scale(1.32); opacity: 0; }
  100% { transform: scale(1.32); opacity: 0; }
}
.player-audio audio { width: 100%; max-width: 340px; }

/* Duração, no canto de baixo */
.card-time {
  position: absolute; right: 8px; bottom: 8px;
  font-family: var(--mono); font-size: 10.5px;
  padding: 2px 6px; border-radius: 6px;
  background: rgba(11, 8, 15, .78);
  backdrop-filter: blur(6px);
  color: #EDE6F2;
  letter-spacing: .02em;
  transition: opacity .25s;
  z-index: 2;
}
.card:hover .card-time { opacity: 0; }

.card-play {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(0, 0, 0, .05), rgba(0, 0, 0, .55));
  transition: opacity .3s;
  z-index: 1;
}
.card-play span {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(20, 15, 25, .6);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .22);
  transition: transform .3s var(--ease), background .3s;
}
.card-play svg { width: 15px; height: 15px; fill: #fff; margin-left: 2px; }
.card:hover .card-play span { transform: scale(1.12); background: var(--honey); }
.card:hover .card-play svg { fill: var(--on-honey); }

.card-badge {
  position: absolute; top: 9px; left: 9px;
  font-family: var(--mono); font-size: 10px;
  padding: 3px 7px; border-radius: 6px;
  background: rgba(11, 8, 15, .72);
  backdrop-filter: blur(6px);
  color: #EDE6F2;
  letter-spacing: .04em;
}

.card-tools {
  position: absolute; top: 8px; right: 8px;
  display: flex; gap: 5px;
  opacity: 0; transform: translateY(-5px);
  transition: all .25s var(--ease);
  z-index: 3;
}
.card:hover .card-tools, .card:focus-within .card-tools { opacity: 1; transform: none; }

.card-tool {
  width: 28px; height: 28px;
  border: 0; border-radius: 8px;
  display: grid; place-items: center;
  background: rgba(11, 8, 15, .78);
  backdrop-filter: blur(6px);
  color: #EDE6F2;
  cursor: pointer;
  transition: background .2s, color .2s, transform .2s;
}
.card-tool svg { width: 14px; height: 14px; fill: currentColor; }
.card-tool:hover { background: var(--honey); color: var(--on-honey); transform: scale(1.08); }
.card-tool.is-danger:hover { background: var(--danger); color: #fff; }
.card-tool.is-ok { background: var(--mint); color: #0B1F13; }

/* Baixar é a ação mais usada: já nasce na cor de destaque e um pouco maior. */
.card-tool.is-baixar {
  width: 32px; height: 32px;
  background: var(--honey);
  color: var(--on-honey);
  box-shadow: 0 4px 14px var(--honey-glow);
}
.card-tool.is-baixar svg { width: 16px; height: 16px; }
.card-tool.is-baixar:hover {
  background: var(--honey);
  transform: scale(1.12) translateY(1px);
  box-shadow: 0 6px 18px var(--honey-soft);
}

.card-badge { z-index: 2; }

.card-body { padding: 10px 11px 12px; }
.card-title {
  font-size: 13px; font-weight: 500;
  line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  margin-top: 5px;
  font-family: var(--mono); font-size: 10.5px;
  color: var(--faint);
  display: flex; gap: 8px;
}

/* ---------- Estados vazios ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 34px 20px;
  border: 1px dashed var(--line-str);
  border-radius: var(--r-md);
  color: var(--faint);
  text-align: center;
}
.empty strong { font-family: var(--display); font-size: 14.5px; color: var(--mute); font-weight: 600; }
.empty p { margin: 0; font-size: 13px; max-width: 320px; }

/* ============================================================
   SOBRE
   ============================================================ */
.about-panel { max-width: 760px; }
.about-text { color: var(--mute); font-size: 15px; margin: 0 0 22px; white-space: pre-line; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.contact-card {
  display: flex; flex-direction: column; gap: 3px;
  padding: 15px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--fill);
  transition: all .25s var(--ease);
}
.contact-card:hover { border-color: var(--honey-soft); transform: translateY(-2px); background: var(--honey-dim); }
.contact-label { font-family: var(--mono); font-size: 10.5px; color: var(--faint); letter-spacing: .08em; text-transform: uppercase; }
.contact-value { font-size: 15px; font-weight: 500; }
.about-foot { margin: 22px 0 0; font-size: 12px; color: var(--faint); font-family: var(--mono); }

/* ============================================================
   MODAIS
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(8, 6, 11, .78);
  backdrop-filter: blur(8px);
  animation: fade-in .25s var(--ease);
}
.modal-backdrop[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal-close {
  position: absolute; top: 12px; right: 14px;
  width: 34px; height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--fill-2);
  color: var(--text);
  font-size: 22px; line-height: 1;
  cursor: pointer; z-index: 3;
  transition: all .2s;
}
.modal-close:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ---------- Player ---------- */
.modal-player {
  position: relative;
  width: min(430px, 92vw);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--void-deep);
  border: 1px solid var(--line-str);
  box-shadow: var(--shadow);
  animation: pop-in .32s var(--ease);
}
@keyframes pop-in {
  from { opacity: 0; transform: translateY(18px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
.modal-player video {
  width: 100%;
  max-height: 74vh;
  display: block;
  background: #000;
}
.player-meta {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}
.player-meta > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.player-meta strong { font-size: 14px; font-weight: 600; }
.player-meta span { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.btn-icon { padding: 0; width: 38px; justify-content: center; }
.btn-icon svg { margin: 0; }

.player-pos {
  position: absolute; top: 12px; left: 14px;
  font-family: var(--mono); font-size: 11px;
  padding: 3px 9px; border-radius: 20px;
  background: rgba(11, 8, 15, .7);
  backdrop-filter: blur(6px);
  color: #EDE6F2;
  z-index: 3;
}
.player-pos:empty { display: none; }

.player-nav button {
  position: absolute; top: 42%;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(11, 8, 15, .6);
  backdrop-filter: blur(6px);
  color: #fff; font-size: 24px; line-height: 1;
  cursor: pointer; opacity: 0;
  transition: opacity .25s, background .2s, transform .2s;
}
.modal-player:hover .player-nav button { opacity: .9; }
.player-nav button:hover { background: var(--honey); color: var(--on-honey); transform: scale(1.06); }
#playerPrev { left: 12px; }
#playerNext { right: 12px; }

/* ---------- Sheets (upload / gerenciar) ---------- */
.sheet {
  position: relative;
  width: min(560px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
  padding: 26px 26px 24px;
  border-radius: var(--r-lg);
  background: var(--panel);
  border: 1px solid var(--line-str);
  box-shadow: var(--shadow);
  animation: pop-in .32s var(--ease);
}
.sheet-wide { width: min(720px, 94vw); }
.sheet h3 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.sheet-hint { color: var(--faint); font-size: 13px; margin: 0 0 18px; }

.form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.field input, .field select, .field textarea {
  height: 42px;
  padding: 0 13px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--raise);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { height: auto; padding: 11px 13px; resize: vertical; line-height: 1.5; font-family: var(--body); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--honey-soft);
  box-shadow: 0 0 0 3px var(--honey-dim);
}
.field select { appearance: none; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%); background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }

.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.form-msg { font-size: 13px; margin: 8px 0 0; min-height: 18px; }
.form-msg.is-error { color: var(--danger); }
.form-msg.is-ok { color: var(--mint); }

/* ---------- Dropzone ---------- */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 30px 20px;
  border: 1.5px dashed var(--line-str);
  border-radius: var(--r-md);
  color: var(--faint);
  text-align: center;
  transition: all .25s var(--ease);
}
.dropzone svg { width: 26px; height: 26px; fill: var(--faint); transition: transform .3s var(--ease), fill .25s; }
.dropzone strong { font-family: var(--display); color: var(--mute); font-size: 15px; }
.dropzone button { border: 0; background: none; color: var(--honey); cursor: pointer; text-decoration: underline; padding: 0; }
.dropzone.is-over { border-color: var(--honey); background: var(--honey-dim); color: var(--honey); }
.dropzone.is-over svg { transform: translateY(-4px); fill: var(--honey); }

.upload-queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.upload-queue:empty { display: none; }
.queue-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--raise);
  border: 1px solid var(--line);
  overflow: hidden;
  animation: card-in .3s var(--ease) both;
}
.queue-name { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-status { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.queue-item.is-done .queue-status { color: var(--mint); }
.queue-item.is-error .queue-status { color: var(--danger); }
.queue-bar {
  position: absolute; left: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--honey), var(--honey-2));
  width: 0; transition: width .25s var(--ease);
}
.queue-remove { border: 0; background: none; color: var(--faint); cursor: pointer; font-size: 17px; line-height: 1; }
.queue-remove:hover { color: var(--danger); }

/* ---------- Gerenciar ---------- */
.seg {
  display: flex; gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--raise);
  border: 1px solid var(--line);
  margin: 16px 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg-item {
  flex: 1;
  height: 34px; padding: 0 14px;
  border: 0; border-radius: 9px;
  background: transparent; color: var(--mute);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: all .22s var(--ease);
}
.seg-item:hover { color: var(--text); }
.seg-item.is-active { background: var(--raise-2); color: var(--text); box-shadow: 0 2px 10px rgba(0, 0, 0, .3); }

.manage-panel { display: none; }
.manage-panel.is-active { display: block; animation: view-in .3s var(--ease) both; }

.sortable { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }

.row-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px;
  border-radius: 11px;
  background: var(--raise);
  border: 1px solid var(--line);
  transition: border-color .2s, transform .2s var(--ease), opacity .2s;
}
.row-item.is-dragging { opacity: .45; border-color: var(--honey); }
.row-item.is-over { transform: translateY(2px); border-color: var(--honey); }
.row-grip { cursor: grab; color: var(--faint); display: grid; place-items: center; width: 18px; }
.row-grip svg { width: 14px; height: 14px; fill: currentColor; }
.row-grip:active { cursor: grabbing; }
.row-input {
  flex: 1; min-width: 0;
  height: 32px; padding: 0 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 14px;
  transition: all .2s;
}
.row-input:hover { border-color: var(--line); }
.row-input:focus { border-color: var(--honey-soft); background: rgba(0, 0, 0, .25); outline: none; }
.row-id { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.row-del {
  width: 30px; height: 30px;
  border: 1px solid var(--line); border-radius: 8px;
  background: transparent; color: var(--faint);
  cursor: pointer; display: grid; place-items: center;
  transition: all .2s;
}
.row-del svg { width: 14px; height: 14px; fill: currentColor; }
.row-del:hover { color: var(--danger); border-color: var(--danger); background: rgba(255, 107, 107, .1); }

.add-form { display: flex; gap: 8px; }
.add-form input {
  flex: 1;
  height: 40px; padding: 0 13px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--raise);
  outline: none;
  transition: border-color .2s;
}
.add-form input:focus { border-color: var(--honey-soft); }

/* ---------- Abas personalizadas (painel de admin) ---------- */
.row-item.row-aba { flex-wrap: wrap; }
.row-aba .row-tipo {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--faint);
  border: 1px solid var(--line); border-radius: 20px;
  padding: 2px 8px;
}
.row-aba .row-open {
  width: 30px; height: 30px;
  border: 1px solid var(--line); border-radius: 8px;
  background: transparent; color: var(--faint);
  cursor: pointer; display: grid; place-items: center;
  transition: all .2s;
}
.row-aba .row-open svg { width: 14px; height: 14px; fill: currentColor; transition: transform .25s var(--ease); }
.row-aba .row-open:hover { color: var(--honey); border-color: var(--honey); }
.row-aba.is-open .row-open svg { transform: rotate(180deg); }

.aba-detalhe {
  flex-basis: 100%;
  margin-top: 10px; padding-top: 12px;
  border-top: 1px dashed var(--line);
  display: none;
  flex-direction: column; gap: 12px;
}
.row-aba.is-open .aba-detalhe { display: flex; }

/* ---------- Lista e formulário de avisos ---------- */
.row-aviso { --av-cor: var(--berry); }
.row-aviso[data-tipo="atencao"] { --av-cor: var(--honey); }
.row-aviso[data-tipo="critico"] { --av-cor: var(--danger); }

.aviso-ponto {
  flex: none;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--av-cor);
  box-shadow: 0 0 10px var(--av-cor);
}
.row-aviso-corpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-aviso-corpo strong { font-size: 13px; font-weight: 600; }
.row-aviso-corpo span {
  font-size: 12px; color: var(--mute);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.aviso-alvo-fixo {
  margin: 0;
  padding: 10px 13px;
  border-radius: 11px;
  border: 1px dashed var(--line-str);
  background: var(--fill);
  font-size: 13px;
  color: var(--mute);
}
.aviso-alvo-fixo[hidden] { display: none; }

.tipo-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.tipo-opt {
  height: 34px; padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--mute);
  font-size: 13px;
  cursor: pointer;
  transition: all .2s var(--ease);
}
.tipo-opt:hover { color: var(--text); border-color: var(--line-str); }
.tipo-opt[data-tipo="info"].is-active    { background: var(--berry); border-color: var(--berry); color: var(--on-berry); }
.tipo-opt[data-tipo="atencao"].is-active { background: var(--honey); border-color: var(--honey); color: var(--on-honey); }
.tipo-opt[data-tipo="critico"].is-active { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ---------- Escolha de ícone ---------- */
.icon-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-opt {
  width: 34px; height: 34px;
  border: 1px solid var(--line); border-radius: 9px;
  background: transparent; color: var(--mute);
  cursor: pointer; display: grid; place-items: center;
  transition: all .2s var(--ease);
}
.icon-opt svg { width: 16px; height: 16px; fill: currentColor; }
.icon-opt:hover { color: var(--text); border-color: var(--line-str); transform: translateY(-1px); }
.icon-opt.is-active { color: var(--on-honey); background: var(--honey); border-color: var(--honey); }

/* ---------- Aparência ---------- */
.cores-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }

.cor-campo {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--fill);
}
.cor-campo input[type="color"] {
  width: 38px; height: 38px; flex: none;
  padding: 0; border: 1px solid var(--line-str); border-radius: 10px;
  background: none; cursor: pointer;
}
.cor-campo input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
.cor-campo input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 7px; }
.cor-campo > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cor-campo strong { font-size: 13px; font-weight: 600; }
.cor-campo small { font-size: 11px; color: var(--faint); line-height: 1.35; }
.cor-campo input[type="text"] {
  width: 84px; flex: none;
  height: 32px; padding: 0 9px;
  font-family: var(--mono); font-size: 11.5px; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--raise); outline: none;
}
.cor-campo input[type="text"]:focus { border-color: var(--honey-soft); }

.tema-preview {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 16px 0 4px; padding: 15px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--void);
}
.tema-preview .btn { pointer-events: none; }
.tema-preview .chip { pointer-events: none; }

/* ---------- Ícone do site ---------- */
.brand-upload { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand-preview {
  width: 58px; height: 58px; flex: none;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: var(--raise);
  display: grid; place-items: center;
  overflow: hidden;
}
.brand-preview img { width: 100%; height: 100%; object-fit: contain; }
.brand-upload-info { flex: 1; min-width: 170px; display: flex; flex-direction: column; gap: 3px; }
.brand-upload-info small { font-size: 11.5px; color: var(--faint); line-height: 1.45; }

/* ============================================================
   AVISOS DO ADMIN
   Três níveis. A cor sai do tipo, então tudo aqui usa a mesma base.
   ============================================================ */
.aviso-faixa,
.aviso-pop,
.aviso-player {
  --av-cor: var(--berry);
  --av-fundo: var(--berry-dim);
}
[data-tipo="atencao"] { --av-cor: var(--honey); --av-fundo: var(--honey-dim); }
[data-tipo="critico"] { --av-cor: var(--danger); --av-fundo: rgba(255, 107, 107, .14); }

.aviso-icone { flex: none; display: grid; place-items: center; }
.aviso-icone svg { width: 17px; height: 17px; fill: var(--av-cor); display: block; }

.aviso-fechar {
  flex: none;
  width: 28px; height: 28px;
  border: 0; border-radius: 8px;
  background: transparent; color: var(--faint);
  font-size: 19px; line-height: 1;
  cursor: pointer;
  transition: color .2s, background .2s;
}
.aviso-fechar:hover { color: var(--text); background: var(--fill-2); }

/* ---------- Faixa fixa no topo ---------- */
/* Fica no fluxo normal, acima de tudo. Se fosse fixa, brigaria com a
   lateral e a topbar, que já são sticky. */
.aviso-faixa {
  position: relative; z-index: 60;
  display: flex; align-items: center; gap: 11px;
  padding: 10px 18px;
  background: var(--av-fundo);
  border-bottom: 1px solid var(--av-cor);
  backdrop-filter: blur(10px);
  animation: faixa-desce .4s var(--ease) both;
}
.aviso-faixa[hidden] { display: none; }
.aviso-faixa .aviso-texto {
  flex: 1; margin: 0;
  font-size: 13.5px; line-height: 1.45;
}
@keyframes faixa-desce {
  from { opacity: 0; transform: translateY(-100%); }
  to   { opacity: 1; transform: none; }
}
/* com a faixa aberta, a coluna toda encurta pra não sobrar rolagem */
body.tem-faixa .app-shell { min-height: calc(100vh - 44px); }
body.tem-faixa .rail { height: calc(100vh - 44px); }

/* ---------- Pop-up de aba e de chip ---------- */
.aviso-pop {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 110;
  display: flex; align-items: flex-start; gap: 11px;
  width: min(360px, calc(100vw - 32px));
  padding: 14px 14px 14px 16px;
  border-radius: var(--r-md);
  background: var(--raise);
  border: 1px solid var(--line-str);
  border-left: 3px solid var(--av-cor);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(14px) scale(.97);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.aviso-pop[hidden] { display: none; }
.aviso-pop.is-visible { opacity: 1; transform: none; }
.aviso-pop .aviso-icone { margin-top: 1px; }
.aviso-corpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.aviso-titulo {
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--av-cor); font-weight: 500;
}
.aviso-pop .aviso-texto {
  margin: 0; font-size: 13.5px; line-height: 1.5;
  white-space: pre-line;
}

/* ---------- Faixa dentro do player ---------- */
.aviso-player {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 15px;
  background: var(--av-fundo);
  border-top: 1px solid var(--line);
}
.aviso-player[hidden] { display: none; }
.aviso-player .aviso-texto {
  margin: 0; flex: 1;
  font-size: 13px; line-height: 1.45;
  white-space: pre-line;
}

/* ---------- Selo na miniatura ---------- */
.card-aviso {
  position: absolute; left: 8px; bottom: 8px;
  z-index: 3;
  width: 26px; height: 26px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: rgba(11, 8, 15, .8);
  backdrop-filter: blur(6px);
  border: 1px solid var(--av-cor);
  --av-cor: var(--berry);
}
.card-aviso[data-tipo="atencao"] { --av-cor: var(--honey); }
.card-aviso[data-tipo="critico"] { --av-cor: var(--danger); animation: selo-pulso 2.2s var(--ease) infinite; }
.card-aviso svg { width: 14px; height: 14px; fill: var(--av-cor); }
@keyframes selo-pulso {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, .5); }
  60%      { box-shadow: 0 0 0 7px rgba(255, 107, 107, 0); }
}
.card.tem-aviso { border-color: var(--line-str); }
.card-tool.is-marcado { color: var(--honey); }

@media (max-width: 640px) {
  .aviso-pop { right: 12px; left: 12px; bottom: 12px; width: auto; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: 26px;
  transform: translateX(-50%) translateY(12px);
  z-index: 120;
  padding: 11px 18px;
  border-radius: 12px;
  background: var(--raise-2);
  border: 1px solid var(--line-str);
  box-shadow: var(--shadow);
  font-size: 14px;
  opacity: 0;
  transition: opacity .28s var(--ease), transform .28s var(--ease);
}
.toast[hidden] { display: none; }
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.is-error { border-color: rgba(255, 107, 107, .5); }
.toast.is-ok { border-color: rgba(61, 220, 132, .45); }

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 1080px) {
  .search { width: 170px; }
  .search:focus-within { width: 200px; }
}

/* ============================================================
   CELULAR — o que pesa e foi desligado

   1. background-attachment: fixed  -> repinta o fundo a cada rolagem
   2. backdrop-filter: blur()       -> caro em GPU de celular
   3. animações de entrada em massa -> travam a primeira rolagem
   4. content-visibility            -> o navegador pula o que está fora da tela
   ============================================================ */
@media (max-width: 900px) {
  body.app { background-attachment: scroll; background-image: none; }

  .topbar,
  .card-badge, .card-tool, .card-time, .card-aviso,
  .player-pos, .modal-backdrop, .rail-scrim,
  .aviso-faixa, .card-play span, .player-nav button {
    backdrop-filter: none;
  }
  .topbar { background: var(--void); }

  /* o navegador não gasta layout nem pintura com card fora da tela */
  .card {
    content-visibility: auto;
    contain-intrinsic-size: auto 260px;
  }

  /* entrada só do painel; card a card multiplicava por dezenas */
  .card, .panel, .rail-item, .rail-brand { animation: none; }
  .view.is-active { animation-duration: .2s; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }

  .rail {
    position: fixed;
    left: 0; top: 0;
    width: 268px;
    transform: translateX(-102%);
    transition: transform .34s var(--ease);
    box-shadow: 24px 0 60px rgba(0, 0, 0, .5);
  }
  .rail.is-open { transform: none; }

  .rail-scrim {
    position: fixed; inset: 0; z-index: 35;
    background: rgba(8, 6, 11, .6);
    backdrop-filter: blur(3px);
    animation: fade-in .25s var(--ease);
  }
  .rail-scrim[hidden] { display: none; }

  .rail-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 4px;
    width: 38px; height: 38px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--raise);
    cursor: pointer;
  }
  .rail-toggle span { display: block; height: 1.6px; background: var(--text); border-radius: 2px; transition: transform .3s var(--ease), opacity .2s; }
  .rail-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.6px) rotate(45deg); }
  .rail-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .rail-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.6px) rotate(-45deg); }

  .topbar { padding: 13px 18px; gap: 12px; flex-wrap: wrap; }
  .topbar-title h1 { font-size: 18px; }
  .topbar-tools { width: 100%; }
  .search { flex: 1; width: auto; }
  .search:focus-within { width: auto; }
  .btn-upload span { display: none; }
  .btn-upload { padding: 0 13px; }

  .viewport { padding: 20px 18px 60px; }
  .panel { padding: 17px 15px 20px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
}

@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .sheet { padding: 22px 18px 20px; }
  .modal-backdrop { padding: 12px; }
}

/* ---------- Telas sem mouse ----------
   Sem hover não dá pra revelar nada: os botões ficam sempre à vista
   e a prévia em vídeo nem é criada (economiza dados do celular). */
@media (hover: none) {
  .card-tools { opacity: 1; transform: none; }
  .card:hover .card-time { opacity: 1; }
  .card-tool { background: rgba(11, 8, 15, .85); }
}

/* ---------- Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
