:root {
  /* Paleta da marca Locus360 (extraída de logo.jpg): teal + navy. */
  --color-bg: #2b2b2b;
  --color-surface: #101d2c;
  --color-surface-alt: #16283b;
  --color-primary: #18c0cc;
  --color-primary-dark: #129aa4;
  --color-navy: #003c6c;
  --color-text: #f2f6f8;
  --color-text-muted: #8ea2b3;
  --color-border: rgba(255, 255, 255, 0.08);

  --color-danger: #e0554a;
  --color-danger-pulse: rgba(224, 85, 74, 0.45);

  /* Cor por tipo de marcador */
  --color-marker-product: #18c0cc;
  --color-marker-product-pulse: rgba(24, 192, 204, 0.45);
  --color-marker-navigation: #2f7fd1;
  --color-marker-navigation-pulse: rgba(47, 127, 209, 0.45);
  --color-marker-info: #a78bfa;
  --color-marker-info-pulse: rgba(167, 139, 250, 0.45);
  --color-marker-photo: #f5a623;
  --color-marker-photo-pulse: rgba(245, 166, 35, 0.45);
  /* Vídeo do YouTube usa a cor fixa da marca (não editável pela empresa,
     ao contrário de product/navigation/info) — é um selo reconhecível de
     "isso é um vídeo", igual o próprio ícone de play do YouTube. */
  --color-marker-youtube: #ff0000;
  --color-marker-youtube-pulse: rgba(255, 0, 0, 0.45);
  --shadow-elevated: 0 16px 40px rgba(0, 0, 0, 0.45);
  --radius-md: 12px;
  --radius-lg: 20px;
  font-family: 'Stem', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--color-bg);
  color: var(--color-text);
}

.viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Topbar */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: linear-gradient(to bottom, rgba(11, 13, 18, 0.85), transparent);
  pointer-events: none;
}

/* pointer-events:auto no container (não em cada botão) — mesmo padrão do
   .scene-switcher logo abaixo: o .topbar em volta é pointer-events:none de
   propósito (não atrapalha o arraste do panorama), então qualquer coisa
   clicável dentro dele precisa reativar isso explicitamente. Carrinho/som
   do tour público não usam mais esta classe (ver .viewer-actions) — quem
   ainda usa é o topbar do editor admin (ajuda/definir entrada etc, ver
   admin/index.html). */
.topbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  pointer-events: auto;
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex: 1 1 auto;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Só quando é o link de verdade (tour público) — #editor-scene-name no
   admin reaproveita esta classe só pelo layout, não é um link. .topbar
   inteiro tem pointer-events:none (pra não atrapalhar o arraste do
   panorama por baixo), igual já é feito pro scene-switcher e o carrinho —
   sem isso o clique atravessa direto pro canvas do visualizador. */
a.topbar__brand {
  color: inherit;
  text-decoration: none;
  pointer-events: auto;
}

.topbar__logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

/* Seletor de ambientes */
.scene-switcher {
  position: relative;
  pointer-events: auto;
}

.scenes-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(20, 23, 31, 0.85);
  color: var(--color-text);
  font-size: 0.95rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.scenes-button span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scenes-button__chevron {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

.scenes-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  max-width: min(320px, calc(100vw - 32px));
  max-height: 320px;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
}

.scenes-list[hidden] {
  display: none;
}

/* Ancorada no botão, a lista vaza pra fora da tela em telas estreitas
   (o botão já pode estar deslocado à direita, e min-width:220px não cede).
   Abaixo de 480px vira um painel fixo, largura previsível, desacoplado da
   posição do botão. */
@media (max-width: 480px) {
  .scenes-list {
    position: fixed;
    top: 72px;
    left: 16px;
    right: 16px;
    min-width: 0;
    max-width: none;
  }
}

.scenes-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

.scenes-list__item:hover {
  background: var(--color-surface-alt);
}

.scenes-list__item.is-active {
  color: var(--color-marker-navigation);
  font-weight: 600;
}

.scenes-list__badge {
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  font-size: 0.7rem;
}

/* Carrinho + som — canto inferior direito, colado acima da navbar do PSV
   (zoom/fullscreen etc, sempre 40px de altura no rodapé) pra não sobrepor.
   Não precisa do truque pointer-events:none/auto do .topbar: ao contrário
   dele, esta caixa não cobre a tela inteira, então não atrapalha o arraste
   do panorama por baixo mesmo com pointer-events padrão (auto). */
.viewer-actions {
  position: fixed;
  right: 24px;
  bottom: 52px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-button {
  pointer-events: auto;
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(20, 23, 31, 0.85);
  color: var(--color-text);
  font-size: 1.1rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-count[hidden] {
  display: none;
}

/* Botão redondo verde (cor de marca do WhatsApp, mesma do .whatsapp-button
   do carrinho) — chamada direta, sem precisar passar pelo carrinho. */
.whatsapp-contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #25d366;
  color: #06341f;
  cursor: pointer;
}

.whatsapp-contact-button svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.whatsapp-contact-button:hover {
  background: #1ebe5a;
}

.whatsapp-contact-button[hidden] {
  display: none;
}

/* Marcador de produto (hotspot) */
.locus360-marker {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-marker-product);
  color: #fff;
  box-shadow: 0 4px 14px var(--color-marker-product-pulse);
  cursor: pointer;
}

/* Seta de chão, não pino: sem fundo circular nem sombra de bolha — só o
   ícone (maior, 30px) flutuando com um brilho suave por baixo. O alvo de
   clique continua 36x36 (definido onde o marcador é criado no PSV), só a
   aparência muda. */
.locus360-marker--navigation {
  width: auto;
  height: auto;
  background: transparent;
  box-shadow: none;
  color: var(--color-marker-navigation);
  filter: drop-shadow(0 2px 8px var(--color-marker-navigation-pulse));
}

.locus360-marker--navigation .locus360-marker__pulse {
  display: none;
}

.locus360-marker--info {
  background: var(--color-marker-info);
  box-shadow: 0 4px 14px var(--color-marker-info-pulse);
}

.locus360-marker--youtube {
  background: var(--color-marker-youtube);
  box-shadow: 0 4px 14px var(--color-marker-youtube-pulse);
}

.locus360-marker--photo {
  background: var(--color-marker-photo);
  box-shadow: 0 4px 14px var(--color-marker-photo-pulse);
}

.locus360-marker__pulse {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: var(--color-marker-product-pulse);
  animation: locus360-pulse 2s ease-out infinite;
}

.locus360-marker--navigation .locus360-marker__pulse {
  background: var(--color-marker-navigation-pulse);
}

.locus360-marker--info .locus360-marker__pulse {
  background: var(--color-marker-info-pulse);
}

.locus360-marker--youtube .locus360-marker__pulse {
  background: var(--color-marker-youtube-pulse);
}

.locus360-marker--photo .locus360-marker__pulse {
  background: var(--color-marker-photo-pulse);
}

@keyframes locus360-pulse {
  0% {
    transform: scale(0.7);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* Modal de produto */
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal.is-open {
  visibility: visible;
  opacity: 1;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 9, 0.7);
  backdrop-filter: blur(2px);
}

.modal__card {
  position: relative;
  width: min(420px, 90vw);
  max-height: 85vh;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
  transform: translateY(12px);
  transition: transform 0.2s ease;
}

.modal.is-open .modal__card {
  transform: translateY(0);
}

.modal__image {
  width: 100%;
  height: 220px;
  /* "cover": aqui a imagem é só um cabeçalho acima do texto (nome, preço,
     descrição...) — preencher a faixa toda fica melhor que sobrar folga
     dos lados. O tipo "Foto" não tem esse texto embaixo disputando espaço,
     então usa .modal__image--full (imagem inteira, sem cortar) em vez
     desta regra — ver openItemModal em main.js. */
  object-fit: cover;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--color-surface-alt);
}

/* Marcador tipo "Foto": card bem mais largo/alto que o padrão (ver
   .modal__card--photo) — sem corpo de texto disputando espaço, a imagem
   aproveita quase a tela toda em vez de ficar num cabeçalho pequeno. */
.modal__card--photo {
  width: min(90vw, 720px);
}

.modal__image--full {
  height: 75vh;
  max-height: 700px;
  object-fit: contain;
  border-radius: var(--radius-lg);
}

/* Proporção 16:9 fixa via padding-top (truque clássico) — o iframe some
   preenchendo esse espaço reservado, então não há "pulo" de layout
   enquanto o player do YouTube carrega. */
.modal__video {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
}

.modal__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.modal__body {
  padding: 20px 24px 24px;
}

.modal__name {
  margin: 0 0 6px;
  font-size: 1.3rem;
}

.modal__price {
  margin: 0 0 12px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary);
}

.modal__description {
  margin: 0 0 16px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.modal__description[hidden],
.modal__image[hidden],
.modal__price[hidden] {
  display: none;
}

.modal__attributes {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  margin: 0 0 20px;
  font-size: 0.85rem;
}

.modal__attributes[hidden] {
  display: none;
}

.modal__attributes dt {
  color: var(--color-text-muted);
  text-transform: capitalize;
}

.modal__attributes dd {
  margin: 0;
  color: var(--color-text);
  text-align: right;
}

/* Variações de produto (sabores, tamanhos...) — lista com nome, preço e um
   campo de quantidade por variação. Quando presente, .modal__price some
   (não existe mais "o preço do produto", só o de cada variação) e o botão
   único "Adicionar ao Carrinho" leva todas as quantidades marcadas de uma
   vez (ver renderVariants/openItemModal em main.js). */
.modal__variants {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.modal__variants[hidden] {
  display: none;
}

.modal__variant-row {
  display: grid;
  grid-template-columns: 1fr auto 64px;
  align-items: center;
  gap: 10px;
}

.modal__variant-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal__variant-price {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.modal__variant-qty {
  width: 64px;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  /* 16px, não um rem menor: abaixo disso o Safari/Chrome mobile dá zoom
     automático ao focar o campo, e quem digita precisa dar zoom out na mão
     depois pra tela voltar ao normal. */
  font-size: 16px;
  text-align: center;
}

.modal__add-button {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.modal__add-button:hover {
  background: var(--color-primary-dark);
}

.icon-button {
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
}

/* Painel do carrinho */
.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  width: min(340px, 88vw);
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  box-shadow: var(--shadow-elevated);
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.cart-panel.is-open {
  transform: translateX(0);
}

.cart-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--color-border);
}

.cart-panel__header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.cart-panel__tabs {
  display: flex;
  gap: 4px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--color-border);
}

.cart-panel__tabs[hidden] {
  display: none;
}

.cart-panel__tab {
  flex: 1;
  padding: 8px 4px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.cart-panel__tab.is-active {
  background: var(--color-primary);
  color: #fff;
}

/* Mesma estrutura visual do .cart-item (imagem + nome + preço), mas cada
   linha abre o modal do produto (ver renderCatalog em main.js) em vez de já
   estar no carrinho. */
.catalog-items {
  list-style: none;
  margin: 0;
  padding: 8px 12px;
  overflow-y: auto;
  flex: 1;
}

.catalog-items[hidden] {
  display: none;
}

.catalog-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.catalog-item:hover {
  background: var(--color-surface-alt);
}

.catalog-item img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--color-surface-alt);
}

.catalog-item img[hidden] {
  display: none;
}

.catalog-item__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.85rem;
}

.catalog-item__name {
  font-weight: 600;
}

.catalog-item__price {
  color: var(--color-text-muted);
}

.cart-items {
  list-style: none;
  margin: 0;
  padding: 8px 12px;
  overflow-y: auto;
  flex: 1;
}

.cart-empty {
  padding: 24px 8px;
  color: var(--color-text-muted);
  text-align: center;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: var(--radius-md);
}

.cart-item:hover {
  background: var(--color-surface-alt);
}

.cart-item img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--color-surface-alt);
}

.cart-item__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.85rem;
}

.cart-item__name {
  font-weight: 600;
}

.cart-item__meta {
  color: var(--color-text-muted);
}

.cart-item__remove {
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 1.1rem;
  cursor: pointer;
}

.cart-panel__footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--color-border);
  font-size: 1rem;
}

.cart-panel__total {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-total-note {
  margin: -4px 0 0;
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.cart-total-note[hidden] {
  display: none;
}

/* Verde do WhatsApp de propósito — é um sinal visual reconhecido pra "isso
   abre o WhatsApp", mais claro do que reusar a cor da marca aqui. */
.whatsapp-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-md);
  background: #25d366;
  color: #06341f;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.whatsapp-button:hover {
  background: #1ebe5a;
}

.whatsapp-button[hidden] {
  display: none;
}

/* Toast de feedback */
/* Empilha os chips de dica (áudio + gesto) um embaixo do outro — cada chip
   só cuida da própria forma, quem posiciona o grupo na tela é este
   container (evita os dois calcularem "top" na mão e um cobrir o outro
   quando os dois estão visíveis). */
.top-hints {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* Convite pra ativar a trilha sonora — o próprio botão já é a mensagem
   (curto de propósito: uma frase separada quebrava em duas linhas em
   telas estreitas e virava um bloco grande cobrindo o panorama). Chip
   dispensável, não é modal (não deve travar a exploração do tour).
   display:flex é regra de autor, então precisa do próprio [hidden]
   explícito (mesmo motivo de sempre nesse projeto: origem de cascata
   vence especificidade). */
.audio-prompt {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-elevated);
}

.audio-prompt[hidden] {
  display: none;
}

.audio-prompt__enable {
  flex-shrink: 0;
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.audio-prompt__enable:hover {
  background: var(--color-primary-dark);
}

.audio-prompt__enable:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.audio-prompt__dismiss {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.audio-prompt__dismiss:hover {
  background: var(--color-surface-alt);
}

/* Dica de como interagir com o panorama (arrastar pra olhar em volta) —
   aparece pra QUALQUER tour (ao contrário do áudio, que só existe se a
   empresa configurou uma trilha), some sozinha no primeiro toque/arraste no
   panorama ou depois de alguns segundos (ver showGestureHint em main.js).
   Mesma linguagem visual do .audio-prompt (chip, não modal), mas com texto
   próprio — por isso a cor de fundo mais neutra (var(--color-surface), não
   --color-primary): o chip do áudio é uma AÇÃO (botão pra clicar), este é
   só uma DICA (não faz nada ao clicar no texto, só o X dispensa). */
.gesture-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-elevated);
  color: var(--color-text);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.gesture-hint[hidden] {
  display: none;
}

.gesture-hint__dismiss {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.gesture-hint__dismiss:hover {
  background: var(--color-surface-alt);
}

/* Slider de linha do tempo (acompanhamento de obra) — só aparece quando a
   cena atual pertence a um TimelinePoint (ver updateTimelineBar em main.js).
   bottom:60px pra ficar acima da navbar padrão do PSV (~40px) sem colar. */
.timeline-bar {
  position: fixed;
  left: 50%;
  bottom: 60px;
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: calc(100vw - 32px);
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-elevated);
  color: var(--color-text);
}

.timeline-bar[hidden] {
  display: none;
}

.timeline-bar__track {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 0 6px;
}

.timeline-bar__point {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.timeline-bar__dates {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  max-width: min(60vw, 420px);
}

.timeline-bar__date {
  flex-shrink: 0;
  border: none;
  background: transparent;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.timeline-bar__date:hover {
  background: var(--color-surface-alt);
}

.timeline-bar__date.is-active {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  z-index: 50;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.fatal-error {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: var(--color-bg);
  color: var(--color-text-muted);
}

.fatal-error[hidden] {
  display: none;
}

.fatal-error p {
  max-width: 360px;
  font-size: 1rem;
  line-height: 1.5;
}

@media (max-width: 520px) {
  .modal__card {
    width: 92vw;
  }

  .cart-panel {
    width: 100vw;
  }
}

/* Telas bem estreitas (~320-380px, iPhone SE e afins): brand + seletor de
   ambientes + carrinho não cabem lado a lado nos tamanhos "normais" — o
   botão do carrinho chega a vazar pra fora da tela. Encolhe tudo. */
@media (max-width: 380px) {
  .topbar {
    padding: 12px 14px;
    gap: 8px;
  }

  .topbar__left {
    gap: 8px;
  }

  .scenes-button {
    max-width: 108px;
    padding: 8px 10px;
    font-size: 0.85rem;
  }

  .cart-button {
    padding: 8px 10px;
  }
}
