/* why: só o editor. O tour publicado e as páginas públicas não carregam este arquivo. */
/* why: evita FOUC da biblioteca enquanto o boot decide editor vs projetos */
body.is-booting #view-library,
body.is-booting #view-help,
body.is-booting #topbar-actions-library,
body.is-booting #topbar-actions-editor,
body.is-booting #topbar-nav-editor,
body.is-booting #topbar-title,
body.is-booting #ext-banner,
body.is-booting #account-slot,
body.is-booting #more-panel {
  visibility: hidden !important;
  pointer-events: none !important;
}

body.is-booting .boot-splash {
  display: grid;
}

.boot-splash {
  display: none;
  position: fixed;
  inset: 56px 0 0;
  z-index: 70;
  place-items: center;
  align-content: center;
  gap: 12px;
  background: var(--ns-surface);
  text-align: center;
  padding: 24px;
}

.boot-splash-brand {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ns-ink);
}

.boot-splash-brand span {
  color: var(--ns-accent);
}

.boot-splash-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ns-muted);
}

.boot-progress {
  width: min(200px, 56vw);
  height: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ns-border) 80%, transparent);
  overflow: hidden;
}

.boot-progress-bar {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: var(--ns-accent);
  transform: translateX(-120%);
  animation: boot-progress-slide 1.1s ease-in-out infinite;
}

.project-open-overlay {
  position: fixed;
  inset: 0;
  z-index: 190;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--ns-overlay) 40%, transparent);
  pointer-events: none;
}

.project-open-overlay[hidden] {
  display: none !important;
}

.project-open-overlay-card {
  display: grid;
  gap: 12px;
  justify-items: center;
  margin: 0;
  padding: 16px 20px;
  border-radius: 10px;
  background: var(--ns-panel);
  color: var(--ns-ink);
  border: 1px solid var(--ns-border);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  min-width: min(220px, 70vw);
}

.project-open-overlay-text {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.topbar-project {
  display: block;
  min-width: 0;
  max-width: 240px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ns-button-text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 4px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: text;
}

.topbar-project:hover {
  border-color: color-mix(in srgb, var(--ns-topbar-muted) 45%, transparent);
  background: color-mix(in srgb, var(--ns-topbar-muted) 16%, var(--ns-topbar));
}

.topbar-project[data-editing="1"] {
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  max-width: min(280px, 40vw);
}

.topbar-project .inline-edit {
  display: block;
  width: 100%;
  min-width: 120px;
  max-width: 100%;
  color: var(--ns-button-text);
  background: color-mix(in srgb, var(--ns-topbar-muted) 22%, var(--ns-topbar));
  border: 1px solid var(--ns-accent);
  border-radius: 8px;
  padding: 4px 8px;
  line-height: 1.3;
}

.boot-splash-brand img {
  display: block;
  height: 36px;
  width: auto;
  margin: 0 auto;
}

.boot-splash-brand .brand-on-dark,
html[data-appearance="social"] .boot-splash-brand .brand-on-light {
  display: none;
}

html[data-appearance="social"] .boot-splash-brand .brand-on-dark {
  display: block;
}

.dialog-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.dialog-mark {
  display: block;
  width: 28px;
  height: 28px;
  flex: none;
}

.topbar-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.btn-icon {
  width: calc(1.2em + 0.9em + 2px);
  height: calc(1.2em + 0.9em + 2px);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon .btn-ico {
  width: 1.15rem;
  height: 1.15rem;
}

#btn-help {
  flex-shrink: 0;
}

#btn-help.is-active {
  background: var(--ns-accent);
  color: var(--ns-button-text);
  border-color: transparent;
}

.topbar-modes {
  display: inline-flex;
  align-items: stretch;
  background: color-mix(in srgb, var(--ns-topbar-muted) 16%, var(--ns-topbar));
  border-radius: 7px;
  padding: 0;
}

.mode-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--ns-topbar-muted);
  padding: 0.45em 0.85em;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  line-height: 1.2;
}

.mode-btn.is-active {
  background: var(--ns-accent);
  color: var(--ns-button-text);
  font-weight: 600;
}

.type-toggle {
  display: flex;
  width: 100%;
}

.type-toggle .mode-btn {
  flex: 1;
  justify-content: center;
}

.choice-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.icon-choices {
  display: flex;
  gap: 6px;
}

.icon-choice {
  flex: 1;
  min-height: 36px;
  border: 1px solid var(--ns-border);
  background: var(--ns-input-bg);
  color: var(--ns-ink);
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-choice svg {
  width: 18px;
  height: 18px;
}

.icon-choice[hidden] {
  display: none;
}

.icon-choice:hover {
  border-color: var(--ns-accent);
  color: var(--ns-accent);
}

.icon-choice.is-active {
  background: var(--ns-accent);
  border-color: transparent;
  color: var(--ns-button-text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-panel {
  position: relative;
}

.theme-panel summary,
.export-panel summary,
.people-panel summary,
.more-panel > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.45em 0.85em;
  min-height: 32px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--ns-topbar-muted) 16%, var(--ns-topbar));
  color: var(--ns-button-text);
  border: 1px solid color-mix(in srgb, var(--ns-topbar-muted) 45%, transparent);
  font-size: 0.8125rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  line-height: 1.2;
}

.theme-panel summary::-webkit-details-marker,
.export-panel summary::-webkit-details-marker,
.people-panel summary::-webkit-details-marker,
.more-panel > summary::-webkit-details-marker {
  display: none;
}

.more-panel {
  position: relative;
  flex: none;
}

.more-panel > summary {
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
  border-radius: 8px;
}

.more-panel[open] > summary {
  background: color-mix(in srgb, var(--ns-accent) 32%, var(--ns-topbar));
  border-color: color-mix(in srgb, var(--ns-accent) 70%, transparent);
}

.more-panel-body {
  position: absolute;
  left: 0;
  right: auto;
  top: calc(100% + 8px);
  background: var(--ns-panel);
  color: var(--ns-ink);
  border: 1px solid var(--ns-border);
  border-radius: 10px;
  padding: 8px;
  display: grid;
  gap: 4px;
  min-width: min(260px, calc(100vw - 24px));
  width: min(280px, calc(100vw - 24px));
  max-width: min(280px, calc(100vw - 24px));
  max-height: min(85vh, 760px);
  /* why: flyouts Preferências/Temas abrem à direita — overflow clipped cortava o submenu */
  overflow: visible;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  z-index: 60;
}

.more-group {
  display: grid;
  gap: 2px;
}

.more-divider {
  border: 0;
  border-top: 1px solid var(--ns-border);
  margin: 6px 4px;
}

.more-pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  min-height: 40px;
  box-sizing: border-box;
}

.more-pref-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ns-ink);
  flex: none;
  line-height: 1.2;
}

.appearance-segment {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--ns-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--ns-surface);
  flex: none;
}

/* why: botões usam data-mode (não data-appearance) p/ não herdar tokens do tema escuro */
.more-panel-body .appearance-opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 30px;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--ns-border);
  border-radius: 0;
  background: transparent;
  color: var(--ns-ink);
  cursor: pointer;
}

.more-panel-body .appearance-opt:last-child {
  border-right: 0;
}

.more-panel-body .appearance-opt:hover {
  background: var(--ns-hover);
  color: var(--ns-ink);
}

.more-panel-body .appearance-opt[aria-pressed="true"] {
  background: color-mix(in srgb, var(--ns-accent) 22%, var(--ns-surface));
  color: var(--ns-accent-dark);
}

.more-panel-body .appearance-opt .btn-ico {
  width: 1.05rem;
  height: 1.05rem;
  color: inherit;
  opacity: 1;
}

.more-panel-body .appearance-opt[aria-pressed="true"] .btn-ico {
  color: var(--ns-accent-dark);
}

.more-locale {
  display: block;
  padding: 4px 12px 8px;
}

.more-locale select {
  width: 100%;
  min-height: 32px;
  font-size: 0.8125rem;
  border-radius: 6px;
  padding: 0.35em 1.75em 0.35em 0.6em;
}

/* why: --ns-input-bg é mais escuro que o painel do menu (esp. modo escuro) */
.more-panel-body .locale-select select {
  background-color: var(--ns-panel);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23666' stroke-width='1.6' stroke-linecap='round' d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
  color: var(--ns-ink);
  border-color: var(--ns-border);
  color-scheme: inherit;
}

.more-panel-body .locale-select select option {
  background: var(--ns-panel);
  color: var(--ns-ink);
}

.more-panel-body .btn-ghost {
  background: var(--ns-input-bg);
  color: var(--ns-ink);
  border-color: var(--ns-border);
}

.more-item {
  display: flex;
  align-items: center;
  gap: 0.4em;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ns-ink);
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.more-item:hover {
  background: var(--ns-hover);
}

.more-section {
  border: 0;
  border-radius: 0;
  background: transparent;
}

/* why: `.theme-panel summary` pinta a topbar; precisa vencer essa regra no menu Mais */
.more-panel-body .more-section > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4em;
  width: 100%;
  box-sizing: border-box;
  min-height: 0;
  background: transparent;
  color: var(--ns-ink);
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  justify-content: flex-start;
  text-align: left;
  line-height: 1.2;
}

.more-panel-body .more-section > summary::-webkit-details-marker {
  display: none;
}

.more-panel-body .more-section > summary::before {
  content: "";
  width: 0.45em;
  height: 0.45em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 150ms ease;
  flex: none;
  order: 2;
  margin-left: auto;
}

.more-panel-body .more-section[open] > summary::before {
  transform: rotate(45deg);
}

.more-panel-body .more-section > summary:hover {
  background: var(--ns-hover);
}

/* why: border-right+bottom em -45deg = chevron >; open do accordion não pode virar ▼ */
.more-panel-body .more-flyout > summary::before,
.more-panel-body .more-flyout[open] > summary::before {
  transform: rotate(-45deg);
}

.more-panel-body .more-flyout[open] > summary {
  background: var(--ns-hover);
}

.more-flyout {
  position: relative;
}

.more-section-body.theme-panel-body,
.more-flyout-body.theme-panel-body {
  position: static;
  right: auto;
  top: auto;
  min-width: 0;
  max-width: none;
  max-height: none;
  overflow: visible;
  box-shadow: none;
  border: 0;
  border-radius: 8px;
  margin: 0 4px 4px;
  padding: 10px 12px;
  background: var(--ns-input-bg);
}

/* why: .theme-panel-wide força max-height/overflow e gerava scroll duplo dentro de Mais */
.more-section-body.theme-panel-body.theme-panel-wide,
.more-flyout-body.theme-panel-body.theme-panel-wide {
  min-width: 0;
  max-width: none;
  max-height: none;
  overflow: visible;
}

/* why: Preferências/Temas — densidade alta, label+controle na mesma linha */
.more-flyout-body {
  display: grid;
  gap: 8px;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--ns-ink);
}

.more-flyout-body .theme-section-label {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ns-muted);
}

.more-flyout-body label,
.more-flyout-body .checkbox,
.more-flyout-body .theme-swatch-name,
.more-flyout-body .props-meta,
.more-flyout-body .theme-empty {
  font-size: 0.8125rem;
  line-height: 1.35;
}

.more-flyout-body .checkbox,
.theme-panel-body .checkbox {
  justify-content: flex-start !important;
  gap: 8px !important;
}

.more-flyout-body label:not(.checkbox) {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 500;
  min-height: 28px;
}

.more-flyout-body label:not(.checkbox) > span:first-child {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 40%;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ns-ink);
  line-height: 1.2;
}

.theme-panel .more-flyout-body .settings-fold {
  margin: 0;
  border: 1px solid var(--ns-border);
  border-radius: 7px;
  background: transparent;
}

/* why: `.theme-panel summary` pinta topbar + texto de botão; Cartesia/IA são folds do painel */
.theme-panel .more-flyout-body .settings-fold > summary {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  min-height: 0;
  padding: 7px 10px;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  line-height: 1.3;
  color: var(--ns-ink);
  background: transparent;
  border: 0;
  border-radius: 7px;
  justify-content: flex-start;
}

.theme-panel .more-flyout-body .settings-fold > summary:hover {
  background: var(--ns-hover);
  color: var(--ns-ink);
}

.theme-panel .more-flyout-body .settings-fold[open] > summary {
  border-radius: 7px 7px 0 0;
  color: var(--ns-ink);
  background: transparent;
}

.more-flyout-body .settings-fold-body {
  gap: 8px;
  padding: 8px 10px 10px;
}

.more-flyout-body .settings-fold-body > label:not(.checkbox) {
  gap: 10px;
  font-size: 0.8125rem;
}

.more-flyout-body .theme-presets,
.more-flyout-body .theme-customs {
  gap: 6px;
}

.more-flyout-body .theme-swatch {
  padding: 8px 10px;
  gap: 10px;
  border-radius: 8px;
}

.more-flyout-body .theme-custom-actions {
  gap: 8px;
}

.more-flyout-body .theme-custom-actions .btn {
  font-size: 0.75rem;
  min-height: 32px;
}

.more-flyout-body .theme-divider {
  margin: 2px 0;
}

.more-flyout-body .props-meta {
  margin: 0;
  color: var(--ns-muted);
}

.more-flyout-body input[type="range"],
.more-flyout-body input[type="number"],
.more-flyout-body input[type="text"],
.more-flyout-body input[type="url"],
.more-flyout-body select,
.more-flyout-body .settings-secret {
  width: auto;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 62%;
  min-height: 28px;
  font: inherit;
  font-size: 0.75rem;
  background: var(--ns-panel);
  color: var(--ns-ink);
  border: 1px solid var(--ns-border);
  border-radius: 6px;
  padding: 0.3em 0.55em;
  box-sizing: border-box;
}

.more-flyout-body label:not(.checkbox) > input[type="number"] {
  flex: 0 0 3.75rem;
  max-width: 3.75rem;
  width: 3.75rem;
  text-align: center;
}

.more-flyout-body label:has(> input[type="range"]) > input[type="range"] {
  flex: 1 1 auto;
  max-width: none;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.more-flyout-body label:has(> input[type="range"]) > span:last-child {
  flex: 0 0 2.4rem;
  max-width: none;
  text-align: right;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: var(--ns-muted);
  font-weight: 600;
}

.more-flyout-body .settings-key-row .settings-secret,
.more-flyout-body .settings-fold-body > .settings-key-row input,
.more-flyout-body .settings-fold-body .settings-secret {
  max-width: none;
  width: 100%;
  flex: 1 1 auto;
}

.more-flyout-body input[type="color"] {
  width: 2.25rem;
  height: 1.75rem;
  flex: none;
  max-width: none;
  padding: 2px;
  border-radius: 6px;
}

.more-flyout-body label:has(input[type="color"]) {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.more-flyout-body label:has(input[type="color"]) > span:first-child {
  max-width: none;
}

@media (hover: hover) and (min-width: 701px) {
/* why: fundo no próprio painel — ::before com z-index:-1 ficava transparente ao scrollar */
.more-flyout > .more-flyout-body.theme-panel-body,
  .more-flyout > .more-flyout-body.theme-panel-body.theme-panel-wide {
    position: absolute;
    left: calc(100% + 8px);
    top: 0;
    width: min(280px, calc(100vw - 48px));
    min-width: 0;
    max-width: min(280px, calc(100vw - 48px));
    max-height: min(70vh, 560px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: 0;
    padding: 12px;
    background: var(--ns-panel);
    border: 1px solid var(--ns-border);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    z-index: 70;
  
}
/* why: ponte de hover no gap — no summary, não no body (senão some no scroll) */
.more-flyout[open]::after {
    content: "";
    position: absolute;
    left: 100%;
    top: 0;
    width: 10px;
    height: 100%;
    z-index: 69;
  
}
}

@media (hover: none), (max-width: 700px) {
.more-panel-body {
    max-height: min(85vh, 760px);
    overflow-x: hidden;
    overflow-y: auto;
  
}
.more-flyout > .more-flyout-body {
    position: static;
    max-height: none;
    margin: 0 4px 4px;
    background: var(--ns-input-bg);
    border: 0;
    box-shadow: none;
    padding-left: 12px;
  
}
.more-panel-body .more-flyout[open] > summary::before {
    transform: rotate(45deg);
  
}
}

.settings-fold {
  border: 1px solid var(--ns-border);
  border-radius: 8px;
  background: var(--ns-input-bg);
}

.settings-fold > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ns-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-fold > summary::-webkit-details-marker {
  display: none;
}

.settings-fold > summary::before {
  content: "";
  width: 0.45em;
  height: 0.45em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 150ms ease;
  flex: none;
}

.settings-fold[open] > summary::before {
  transform: rotate(45deg);
}

.settings-fold-body {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
  border-top: 1px solid var(--ns-border);
}

.settings-fold-body > label:not(.checkbox) {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
}

.theme-panel-body {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--ns-panel);
  color: var(--ns-ink);
  border: 1px solid var(--ns-border);
  border-radius: 10px;
  padding: 12px;
  display: grid;
  gap: 8px;
  min-width: 200px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  z-index: 50;
}

.more-flyout-body.theme-panel-body {
  gap: 8px;
  font-size: 0.8125rem;
}

.theme-panel-body.theme-panel-wide {
  min-width: 260px;
  max-width: 280px;
  max-height: min(70vh, 560px);
  overflow: auto;
}

.theme-panel-body label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--ns-ink);
}

.theme-panel-body input[type="color"] {
  border: 1px solid var(--ns-border);
  background: var(--ns-panel);
  border-radius: 4px;
}

/* why: type=password dispara o Password Manager do Chrome ao salvar a chave */
.settings-secret {
  -webkit-text-security: disc;
  text-security: disc;
}

.export-panel {
  position: relative;
}

.export-panel > summary {
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
}

.export-panel-body {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--ns-panel);
  color: var(--ns-ink);
  border: 1px solid var(--ns-border);
  border-radius: 10px;
  padding: 8px;
  min-width: min(340px, 86vw);
  max-height: min(70vh, 640px);
  overflow: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  z-index: 80;
  display: grid;
  gap: 4px;
}

.share-expiry-note {
  margin: 0 0 4px;
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--ns-accent) 14%, var(--ns-panel));
  color: var(--ns-ink);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
}

.export-option {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.export-option:hover {
  background: var(--ns-hover);
}

.export-option[hidden] {
  display: none;
}

/* Pro: marca GuiaFlow no link permanente (ligado = sem marca; desligado = crédito discreto) */
.share-brand-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.share-brand-toggle:hover {
  background: var(--ns-hover);
}

.share-brand-toggle[hidden] {
  display: none;
}

.share-brand-toggle input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  flex: 0 0 auto;
  accent-color: var(--ns-accent);
}

.share-brand-toggle input:focus-visible {
  outline: 2px solid var(--ns-accent);
  outline-offset: 2px;
}

.share-brand-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.share-brand-text strong {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--ns-ink);
  font-size: 0.85rem;
}

.share-brand-text .pro-badge {
  font-size: 0.62rem;
  font-weight: 750;
}

.share-brand-text small {
  color: var(--ns-muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.export-panel > summary.share-menu {
  position: relative;
  overflow: visible;
}

.share-stale-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 2px var(--ns-topbar);
  pointer-events: none;
}

.share-stale-dot[hidden] {
  display: none;
}

.share-link-actions {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--ns-border);
  margin-bottom: 4px;
}

.share-link-actions[hidden] {
  display: none;
}

.share-link-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.share-link-meta strong {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ns-ink);
}

.share-stale {
  color: #b45309;
  font-size: 0.68rem;
  letter-spacing: 0.01em;
}

.share-stale[hidden] {
  display: none;
}

.share-link-field {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.share-link-url {
  flex: 1;
  min-width: 0;
  width: auto;
  font-weight: 500;
  font-size: 0.75rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--ns-border);
  border-radius: 8px;
  background: var(--ns-panel);
  color: var(--ns-ink);
}

.share-link-field .btn-icon {
  flex: none;
  width: 32px;
  height: 32px;
}

.share-cover {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.share-cover[hidden] {
  display: none;
}

.share-cover-img {
  width: 120px;
  height: 63px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--ns-border);
  background: var(--ns-panel);
}

.share-cover-text {
  display: grid;
  gap: 2px;
  justify-items: start;
  min-width: 0;
}

.share-cover-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ns-ink);
}

.share-cover-change {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ns-accent-dark);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.share-cover-note {
  color: var(--ns-muted);
  font-size: 0.66rem;
  line-height: 1.35;
}

.share-link-extra {
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-link-extra[hidden] {
  display: none;
}

.share-pro-upsell {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 8px 12px 10px;
  border: 0;
  background: transparent;
  color: var(--ns-muted);
  font-size: 0.75rem;
  text-align: left;
  cursor: pointer;
}

.share-pro-upsell[hidden] {
  display: none;
}

.share-pro-upsell:hover {
  color: var(--ns-ink);
}

.share-link-meta span {
  font-size: 0.75rem;
  color: var(--ns-muted);
}

.share-link-row .btn-icon {
  width: 32px;
  height: 32px;
}

.cloud-share-block {
  display: grid;
  gap: 4px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--ns-border);
}

.cloud-share-block[hidden] {
  display: none;
}

.cloud-share-guest .btn {
  justify-self: start;
}

.cloud-share-result .btn {
  justify-self: start;
}

.account-slot {
  position: relative;
  display: flex;
  align-items: center;
}

.account-chip {
  position: relative;
}

.account-chip-toggle {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
}

.account-chip-toggle::-webkit-details-marker {
  display: none;
}

.account-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--ns-accent) 78%, white);
  color: #102027;
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
}

.account-chip-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: var(--ns-panel);
  color: var(--ns-ink);
  border: 1px solid var(--ns-border);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  z-index: 80;
  display: grid;
}

.account-chip-email {
  margin: 0;
  padding: 8px 12px 4px;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--ns-muted);
  word-break: break-all;
}

.account-chip-signout,
.account-chip-action {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ns-ink);
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
}

.account-chip-signout:hover,
.account-chip-action:hover {
  background: var(--ns-hover);
}

.account-chip-plan {
  margin: 0;
  padding: 0 12px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ns-ink);
}

.account-chip-plan.is-pending {
  color: var(--ns-muted);
  font-weight: 650;
}

.account-chip-usage {
  margin: 0;
  padding: 0 12px 8px;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--ns-muted);
  white-space: pre-line;
}

.pro-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  padding: 0 6px 0 4px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.03em;
  line-height: 1.65;
  vertical-align: 1px;
  color: var(--ns-ink);
  background: color-mix(in srgb, var(--ns-accent) 24%, var(--ns-panel));
  border: 1px solid color-mix(in srgb, var(--ns-accent) 48%, var(--ns-border));
}

.pro-badge-crown {
  width: 0.9em;
  height: 0.9em;
  display: block;
  flex: 0 0 auto;
}

dialog.upgrade-modal[open] {
  display: flex;
}

dialog.upgrade-modal {
  flex-direction: column;
  width: min(440px, calc(100vw - 24px));
  max-width: 440px;
  height: fit-content;
  max-height: min(720px, calc(100dvh - 16px));
  margin: auto;
  overflow: hidden;
  overscroll-behavior: contain;
  border: 0;
  padding: 0;
}

.upgrade-dialog.studio-modal-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 0;
  min-height: 0;
  max-height: 100%;
  padding: 0;
  overflow: hidden;
}

.upgrade-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  display: grid;
  align-content: start;
  gap: 14px;
  padding-bottom: 12px;
}

#upgrade-status {
  margin-inline: 18px;
}

.upgrade-footer {
  position: sticky;
  bottom: 0;
  z-index: 1;
  display: grid;
  gap: 8px;
  flex: 0 0 auto;
  padding: 10px 18px 14px;
  background: var(--ns-panel);
  border-top: 1px solid var(--ns-border);
}

.paywall-hero {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 16px 18px 14px;
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--ns-accent) 28%, transparent), transparent 58%),
    var(--ns-panel);
  border-bottom: 1px solid var(--ns-border);
}

.paywall-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.paywall-hero-badge {
  margin-left: 0;
}

.paywall-hero h3 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.paywall-lead,
.paywall-email-note {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--ns-muted);
}

.paywall-email-note {
  color: var(--ns-ink);
  font-weight: 650;
}

.paywall-benefits {
  list-style: none;
  display: grid;
  gap: 6px;
  margin: 0 18px;
  padding: 0;
}

.paywall-benefits li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.35;
}

.paywall-benefits li.is-highlight {
  border-color: transparent;
  background: transparent;
  font-weight: inherit;
}

.paywall-benefits li.is-highlight .paywall-check {
  background: var(--ns-accent);
  box-shadow: none;
}

.paywall-benefits li.is-highlight .paywall-check::after {
  border-color: var(--ns-panel);
}

.paywall-check {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ns-accent) 22%, var(--ns-panel));
  box-shadow: inset 0 0 0 1.5px var(--ns-accent);
}

.paywall-check::after {
  content: "";
  display: block;
  width: 7px;
  height: 4px;
  margin: 5px auto 0;
  border-left: 1.5px solid var(--ns-accent);
  border-bottom: 1.5px solid var(--ns-accent);
  transform: rotate(-45deg);
}

.upgrade-intervals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 18px;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}

.upgrade-interval {
  position: relative;
  display: grid;
  gap: 2px;
  justify-items: start;
  align-content: center;
  min-height: 96px;
  padding: 12px;
  border: 2px solid var(--ns-border);
  border-radius: 12px;
  background: var(--ns-input-bg);
  box-shadow: none;
  cursor: pointer;
  color: var(--ns-ink);
}

.upgrade-interval input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.upgrade-interval:has(input:checked) {
  border-color: var(--ns-accent);
  background: color-mix(in srgb, var(--ns-accent) 14%, var(--ns-panel));
  box-shadow: none;
}

.upgrade-interval:focus-within {
  outline: none;
}

.upgrade-interval:has(input:focus-visible) {
  outline: 2px solid color-mix(in srgb, var(--ns-accent) 45%, transparent);
  outline-offset: 3px;
}

.paywall-interval-name {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--ns-muted);
}

.paywall-price {
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.paywall-cadence {
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--ns-muted);
  line-height: 1.3;
}

.paywall-free {
  position: absolute;
  top: 8px;
  right: 8px;
  max-width: calc(100% - 16px);
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ns-accent) 16%, var(--ns-panel));
  color: var(--ns-accent);
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.35;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.paywall-pay-note {
  margin: 0;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.35;
  color: var(--ns-muted);
}

.paywall-pay-note[hidden] {
  display: none;
}

.paywall-cta {
  width: 100%;
  min-height: 46px;
  font-size: 1rem;
}

.paywall-legal {
  margin: 0;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--ns-muted);
}

.paywall-legal a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.paywall-legal a:hover,
.paywall-legal a:focus-visible {
  color: var(--ns-ink);
}

.more-legal {
  display: flex;
  gap: 6px;
  margin: 4px 0 2px;
  padding: 0 10px;
  font-size: 0.75rem;
  color: var(--ns-muted);
}

.more-legal a {
  color: inherit;
  text-decoration: none;
}

.more-legal a:hover,
.more-legal a:focus-visible {
  color: var(--ns-ink);
  text-decoration: underline;
}

.paywall-login {
  justify-self: center;
  border: 0;
  background: transparent;
  color: var(--ns-muted);
  font: inherit;
  font-size: 0.82rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 4px 8px 8px;
  margin-bottom: 2px;
  scroll-margin-bottom: 12px;
}

.paywall-login:hover,
.paywall-login:focus-visible {
  color: var(--ns-ink);
}

.local-save {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  max-width: 100%;
}

.local-save-chip,
.local-save-dismiss {
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.local-save-chip {
  color: var(--ns-muted);
  font-size: 0.78rem;
  line-height: 1.3;
  padding: 2px 0;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--ns-muted) 45%, transparent);
  text-underline-offset: 2px;
}

.local-save-chip:hover,
.local-save-chip:focus-visible {
  color: var(--ns-ink);
}

.local-save-dismiss {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: var(--ns-muted);
  font-size: 0.95rem;
  line-height: 1;
}

.local-save-dismiss:hover,
.local-save-dismiss:focus-visible {
  background: var(--ns-hover);
  color: var(--ns-ink);
}

.local-save-tip {
  position: absolute;
  z-index: 5;
  left: 0;
  top: calc(100% + 6px);
  width: min(260px, 70vw);
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--ns-border);
  background: var(--ns-panel);
  color: var(--ns-ink);
  font-size: 0.75rem;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgba(15, 50, 72, 0.12);
  opacity: 0;
  pointer-events: none;
}

.local-save:hover .local-save-tip,
.local-save:focus-within .local-save-tip {
  opacity: 1;
}

body.is-presenting .local-save {
  display: none !important;
}

/* Sincronização do Pro: substitui o aviso «Salvo só neste navegador» */
.sync-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin: 8px 0 0;
  max-width: 100%;
}

.sync-status[hidden] {
  display: none;
}

.sync-chip,
.sync-restore {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.3;
  padding: 2px 0;
  color: var(--ns-muted);
  cursor: pointer;
}

.sync-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sync-chip:hover,
.sync-chip:focus-visible,
.sync-restore:hover,
.sync-restore:focus-visible {
  color: var(--ns-ink);
}

.sync-restore {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--ns-muted) 45%, transparent);
  text-underline-offset: 2px;
}

.sync-cloud {
  display: inline-flex;
  width: 14px;
  height: 14px;
  color: var(--ns-accent, #2a9d8f);
}

.sync-cloud[hidden] { display: none; 
}

.sync-cloud svg { width: 14px; height: 14px; 
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22a06b;
  flex: none;
}

.sync-status[data-phase="syncing"] .sync-dot {
  background: #2f80ed;
  animation: sync-pulse 1s ease-in-out infinite;
}

.sync-status[data-phase="offline"] .sync-dot,
.sync-status[data-phase="error"] .sync-dot {
  background: #d97706;
}

@media (prefers-reduced-motion: reduce) {
.sync-status[data-phase="syncing"] .sync-dot {
    animation: none;
  
}
}

body.is-presenting .sync-status {
  display: none !important;
}

@media (max-width: 720px) {
dialog.upgrade-modal {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 12px);
  
}
.upgrade-scroll {
    gap: 8px;
    padding-bottom: 8px;
  
}
.paywall-hero {
    gap: 4px;
    padding: 10px 14px 8px;
  
}
.paywall-hero h3 {
    font-size: 1.12rem;
  
}
.paywall-lead {
    font-size: 0.82rem;
    line-height: 1.35;
  
}
.paywall-benefits,
  .upgrade-intervals,
  #upgrade-status {
    margin-inline: 14px;
  
}
.paywall-benefits {
    gap: 1px;
  
}
.paywall-benefits li {
    padding: 3px 2px;
    font-size: 0.82rem;
    line-height: 1.3;
  
}
.upgrade-intervals {
    grid-template-columns: 1fr;
    gap: 6px;
    margin-inline: 14px;
  
}
.upgrade-interval {
    min-height: 0;
    padding: 8px 10px;
    gap: 1px;
  
}
.paywall-price {
    font-size: 1.12rem;
  
}
.upgrade-footer {
    gap: 4px;
    padding: 8px 14px 10px;
  
}
.paywall-cta {
    min-height: 40px;
    font-size: 0.95rem;
  
}
.paywall-login {
    padding: 2px 8px 0;
    margin-bottom: 0;
  
}
#local-save-editor .local-save-tip {
    display: none;
  
}
}

dialog.subscription-modal {
  width: min(440px, calc(100vw - 24px));
  max-width: 440px;
  height: fit-content;
  max-height: min(720px, calc(100dvh - 16px));
  margin: auto;
  overflow: auto;
  overscroll-behavior: contain;
}

.subscription-dialog {
  gap: 14px;
}

.subscription-loading,
.subscription-when {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--ns-muted);
}

.subscription-kicker {
  margin: 10px 0 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ns-muted);
}

.subscription-kicker:first-child {
  margin-top: 0;
}

.subscription-plan,
.subscription-state {
  margin: 2px 0 0;
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.subscription-price {
  margin: 2px 0 0;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--ns-ink);
}

.subscription-state.is-pending,
.subscription-state.is-scheduled {
  color: var(--ns-danger);
}

.subscription-actions {
  display: grid;
  gap: 8px;
}

.subscription-actions .btn {
  width: 100%;
  min-height: 42px;
}

.subscription-portal {
  justify-self: center;
  border: 0;
  background: transparent;
  color: var(--ns-muted);
  font: inherit;
  font-size: 0.82rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 4px 8px 2px;
}

.subscription-portal:hover,
.subscription-portal:focus-visible {
  color: var(--ns-ink);
}

@media (max-width: 720px) {
dialog.subscription-modal {
    width: calc(100vw - 16px);
    max-height: 100dvh;
  
}
}

.account-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.account-dialog-head h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

#modal-account.account-modal {
  max-width: 400px;
}

.cloud-login {
  display: grid;
  gap: 12px;
}

.cloud-login p,
.cloud-login-status {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--ns-muted);
}

#modal-account .cloud-login-lead {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--ns-muted);
}

.cloud-login a {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ns-accent);
}

#modal-account .cloud-login label {
  display: grid;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--ns-ink);
}

#modal-account .cloud-login input {
  width: 100%;
  font: inherit;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--ns-border);
  border-radius: 8px;
  background: var(--ns-input-bg);
  color: var(--ns-ink);
}

#modal-account .cloud-login input:focus-visible {
  outline: 2px solid var(--ns-accent);
  outline-offset: 1px;
}

#modal-account .cloud-login input:-webkit-autofill {
  -webkit-text-fill-color: var(--ns-ink);
  box-shadow: 0 0 0 1000px var(--ns-input-bg) inset;
}

.cloud-login .btn {
  justify-self: start;
}

#modal-account .cloud-login .btn-primary,
#modal-account #btn-cloud-magic {
  width: 100%;
  justify-self: stretch;
  min-height: 36px;
}

#modal-account #btn-cloud-magic {
  background: transparent;
  color: var(--ns-ink);
  border-color: var(--ns-border);
}

#modal-account #btn-cloud-magic:hover {
  background: var(--ns-hover);
}

.cloud-login form {
  display: grid;
  gap: 10px;
}

.cloud-login-or {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--ns-muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.cloud-login-or::before,
.cloud-login-or::after {
  content: "";
  height: 1px;
  background: var(--ns-border);
}

.cloud-login-hint {
  margin: 0;
  text-align: center;
}

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

.cloud-login-upsell {
  margin: 4px 0 0;
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--ns-muted);
}

.cloud-login-upsell-btn {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ns-accent);
  font: inherit;
  font-size: inherit;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.cloud-login-upsell-btn:hover,
.cloud-login-upsell-btn:focus-visible {
  color: var(--ns-ink);
  outline: none;
}

.cloud-login-status:empty {
  display: none;
}

.cloud-login-status.is-error {
  color: var(--ns-danger);
}

.cloud-login-status.is-ok {
  color: var(--ns-ink);
  background: color-mix(in srgb, var(--ns-accent) 16%, var(--ns-panel));
  border: 1px solid color-mix(in srgb, var(--ns-accent) 42%, var(--ns-border));
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.82rem;
}

.cloud-login-extra {
  font-size: 0.72rem;
}

#modal-account .cloud-login-extra summary {
  display: inline-flex;
  padding: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: color-mix(in srgb, var(--ns-muted) 78%, transparent);
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.35;
  list-style: none;
}

#modal-account .cloud-login-extra summary::-webkit-details-marker {
  display: none;
}

.cloud-login-extra[open] {
  display: grid;
  gap: 8px;
}

.cloud-login-extra form {
  display: grid;
  gap: 8px;
}

.export-option strong {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--ns-ink);
  font-size: 0.85rem;
}

.export-option span {
  display: block;
  color: var(--ns-muted);
  font-size: 0.72rem;
  margin-top: 2px;
  font-weight: 400;
  line-height: 1.35;
}

.export-option strong > span:not(.pro-badge) {
  display: inline;
  width: auto;
  margin-top: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

.export-option .pro-badge {
  display: inline-flex;
  width: auto;
  flex: 0 0 auto;
  margin-top: 0;
  margin-left: 0;
  color: var(--ns-ink);
  font-size: 0.62rem;
  font-weight: 750;
}

.export-option .pro-badge span {
  display: inline;
  width: auto;
  margin-top: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

.export-quality {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px 10px;
}

.export-quality-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--ns-ink);
}

.export-quality-head .pro-badge {
  font-size: 0.62rem;
}

.export-quality-row {
  display: flex;
  gap: 6px;
}

.export-quality-row select {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  font-size: 0.78rem;
  padding: 5px 6px;
  border: 1px solid var(--ns-border);
  border-radius: 8px;
  background: var(--ns-surface, #fff);
  color: var(--ns-ink);
}

.export-quality-row select#export-video-fps {
  flex: 0 0 auto;
}

.export-quality small {
  color: var(--ns-muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.export-overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--ns-overlay) 62%, transparent);
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
}

.export-overlay-card {
  background: var(--ns-panel);
  color: var(--ns-ink);
  border: 1px solid var(--ns-border);
  border-radius: 12px;
  padding: 20px 22px;
  width: min(720px, 94vw);
  display: grid;
  gap: 10px;
}

.export-overlay-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ns-ink);
}

.export-overlay-status {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ns-muted);
  min-height: 1.2em;
}

.export-preview {
  width: 100%;
  height: auto;
  background: var(--ns-canvas);
  border-radius: 8px;
  display: block;
}

.export-overlay-actions:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.export-overlay-card.is-error .export-overlay-status {
  color: var(--ns-ink);
  font-size: 0.92rem;
}

.export-overlay-card .btn-ghost {
  justify-self: start;
  background: var(--ns-input-bg);
  color: var(--ns-ink);
  border-color: var(--ns-border);
}

.theme-panel summary:focus-visible,
.export-panel summary:focus-visible,
.more-panel > summary:focus-visible,
.account-chip-toggle:focus-visible,
.account-chip-signout:focus-visible,
.account-chip-action:focus-visible,
.more-item:focus-visible,
.more-panel-body .more-section > summary:focus-visible {
  outline: 2px solid var(--ns-accent);
  outline-offset: 2px;
}

.btn-ico {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  display: block;
}

.btn-sm {
  padding: 0.35em 0.7em;
  min-height: 32px;
  font-size: 0.75rem;
}

.btn-danger {
  color: var(--ns-danger);
  border-color: color-mix(in srgb, var(--ns-danger) 35%, var(--ns-border));
  background: var(--ns-danger-bg);
}

.ext-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: none;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--ns-accent) 14%, var(--ns-panel));
  border-bottom: 1px solid color-mix(in srgb, var(--ns-accent) 32%, var(--ns-border));
  color: var(--ns-ink);
  font-size: 0.9rem;
  line-height: 1.4;
}

.ext-banner p {
  margin: 0;
  min-width: 0;
}

.ext-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex: none;
}

body.is-presenting .ext-banner {
  display: none;
}

@media (max-width: 720px) {
.ext-banner {
    flex-direction: column;
    align-items: stretch;
  
}
}

.view-help iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--ns-surface);
}

.view-editor.is-presenting #filmstrip-panel,
.view-editor.is-presenting #props-panel,
.view-editor.is-presenting .canvas-toolbar {
  display: none;
}

body.is-presenting #topbar-actions-editor {
  display: none;
}

.filmstrip-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--ns-panel);
  border-right: 1px solid var(--ns-border);
}

.filmstrip-header {
  flex: 0 0 auto;
  padding: 12px 10px 8px;
  border-bottom: 1px solid var(--ns-border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filmstrip-metrics {
  margin: 0;
  padding: 0 8px;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ns-ink);
  font-variant-numeric: tabular-nums;
}

.filmstrip-multi-hint {
  font-size: 0.68rem;
  line-height: 1.25;
  color: var(--ns-muted);
  padding: 0 8px;
}

.filmstrip-project .inline-edit {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  color: var(--ns-ink);
  background: var(--ns-input-bg);
  border: 1px solid var(--ns-accent);
  border-radius: 8px;
  padding: 6px 8px;
  line-height: 1.3;
}

.filmstrip {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px;
}

.film-hint {
  margin: 0 0 10px;
  font-size: 0.72rem;
  color: var(--ns-muted);
}

.film-item {
  display: grid;
  grid-template-columns: 14px 56px 1fr;
  gap: 6px 8px;
  align-items: center;
  padding: 8px 32px 8px 8px;
  border: 1px solid var(--ns-border);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: grab;
  background: var(--ns-panel);
  position: relative;
  user-select: none;
}

.film-actions {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.film-actions button {
  position: absolute;
  pointer-events: auto;
  border: 0;
  background: transparent;
  color: var(--ns-ink);
  border-radius: 4px;
  width: 22px;
  height: 22px;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}

.film-action-close {
  top: 4px;
  right: 4px;
}

.film-action-move {
  display: none;
}

/* Só o celular usa o ⋯ do cartão; no desktop o menu abre com o botão direito. */
.film-actions .film-action-menu {
  display: none;
}

.film-scene.is-drop-target .film-scene-label {
  background: var(--ns-hover);
  color: var(--ns-ink);
}

.film-actions button:hover:not(:disabled) {
  color: var(--ns-accent);
}

.film-action-close:hover {
  color: var(--ns-danger);
}

.film-actions button:disabled {
  opacity: 0.35;
  cursor: default;
}

.film-actions button.is-danger:hover:not(:disabled) {
  border-color: var(--ns-danger);
  color: var(--ns-danger);
}

.player-filmstrip .film-hint,
.player-filmstrip .film-scene {
  color: var(--ns-muted);
}

.player-filmstrip .film-item {
  background: var(--ns-input-bg);
  border-color: var(--ns-border);
  color: var(--ns-ink);
  cursor: pointer;
  text-align: left;
  width: 100%;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.player-filmstrip .film-item.is-active {
  border-color: var(--ns-accent);
}

.player-filmstrip .film-meta strong {
  color: var(--ns-ink);
}

.film-item:active {
  cursor: grabbing;
}

.film-item.is-active {
  border-color: var(--ns-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ns-accent) 35%, transparent);
}

.film-item.is-selected:not(.is-active) {
  border-color: color-mix(in srgb, var(--ns-accent) 55%, var(--ns-border));
  background: color-mix(in srgb, var(--ns-accent) 10%, var(--ns-panel));
}

.film-item.is-selected.is-active {
  background: color-mix(in srgb, var(--ns-accent) 14%, var(--ns-panel));
}

.film-item.is-dragging {
  opacity: 0.45;
}

.film-item.drop-before::before,
.film-item.drop-after::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  height: 3px;
  border-radius: 2px;
  background: var(--ns-accent);
}

.film-item.drop-before::before {
  top: -5px;
}

.film-item.drop-after::after {
  bottom: -5px;
}

.film-grip {
  color: var(--ns-muted);
  font-size: 0.7rem;
  letter-spacing: -2px;
  line-height: 1;
  text-align: center;
}

.film-item img,
.film-thumb-slide {
  width: 56px;
  height: 36px;
  object-fit: contain;
  border-radius: 4px;
  background: var(--ns-canvas);
}

.film-item img:not([src]),
.image-tile img:not([src]),
.image-pick-btn img:not([src]) {
  visibility: hidden;
}

.film-thumb-slide {
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--ns-accent);
}

.film-thumb-slide {
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--ns-accent);
}

.film-meta {
  min-width: 0;
}

.film-meta strong {
  display: block;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.film-meta span {
  font-size: 0.7rem;
  color: var(--ns-muted);
}

.film-context-menu {
  position: fixed;
  z-index: 80;
  min-width: 220px;
  max-width: min(320px, calc(100vw - 16px));
  padding: 4px;
  background: var(--ns-panel);
  color: var(--ns-ink);
  border: 1px solid var(--ns-border);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.film-context-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
  padding: 9px 11px;
  border-radius: 8px;
  cursor: pointer;
}

.film-context-menu button:hover:not(:disabled),
.film-context-menu button:focus-visible {
  background: var(--ns-hover);
  outline: none;
}

.film-context-menu button:disabled {
  opacity: 0.4;
  cursor: default;
}

.film-context-menu button.is-danger {
  color: var(--ns-danger);
}

.film-context-menu button .film-context-kbd {
  margin-left: auto;
  padding-left: 12px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--ns-muted);
  background: transparent;
  border: 0;
}

.film-context-sep {
  height: 1px;
  margin: 4px 6px;
  background: var(--ns-border);
}

.film-context-menu button[role="menuitemcheckbox"]::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 1px solid var(--ns-border);
  border-radius: 3px;
  flex: 0 0 auto;
  background: transparent;
}

.film-context-menu button[aria-checked="true"]::before {
  background: var(--ns-accent);
  border-color: var(--ns-accent);
  box-shadow: inset 0 0 0 2px var(--ns-panel);
}

.film-context-menu button[aria-checked="mixed"]::before {
  background: color-mix(in srgb, var(--ns-accent) 55%, var(--ns-panel));
  border-color: var(--ns-accent);
}

.film-scene {
  position: relative;
  margin: 12px 4px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ns-muted);
  cursor: grab;
}

.film-scene.is-dragging {
  opacity: 0.45;
}

.film-scene.drop-before::before,
.film-scene.drop-after::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  height: 3px;
  border-radius: 2px;
  background: var(--ns-accent);
}

.film-scene.drop-before::before {
  top: -4px;
}

.film-scene.drop-after::after {
  bottom: -4px;
}

.film-scene-label {
  flex: 1;
  min-width: 0;
  cursor: text;
  border-radius: 4px;
  padding: 2px 4px;
}

.film-scene-label:hover {
  background: var(--ns-hover);
  color: var(--ns-ink);
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  background: var(--ns-panel);
  border-bottom: 1px solid var(--ns-border);
}

.toolbar-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar-divider {
  width: 1px;
  align-self: stretch;
  min-height: 24px;
  background: color-mix(in srgb, var(--ns-muted) 55%, var(--ns-border));
  margin: 0 4px;
}

.canvas-toolbar .btn-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
}

.canvas-toolbar .btn:disabled {
  opacity: 0.38;
  cursor: default;
}

.hotspot-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--ns-button-text);
  border: 2px solid var(--demo-hotspot);
  border-radius: 2px;
}

.hotspot-handle.nw { top: -5px; left: -5px; cursor: nwse-resize; 
}

.hotspot-handle.ne { top: -5px; right: -5px; cursor: nesw-resize; 
}

.hotspot-handle.sw { bottom: -5px; left: -5px; cursor: nesw-resize; 
}

.hotspot-handle.se { bottom: -5px; right: -5px; cursor: nwse-resize; 
}

.props {
  overflow: auto;
  background: var(--ns-panel);
  border-left: 1px solid var(--ns-border);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.props h2 {
  margin: 0;
  font-size: 1rem;
}

.props-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.btn-generate-copy {
  align-self: stretch;
  justify-content: center;
  gap: 6px;
  color: var(--ns-ink);
  position: relative;
  overflow: hidden;
}

.btn-generate-caption {
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.btn-generate-copy[aria-busy="true"],
.btn-generate-caption[aria-busy="true"] {
  opacity: 1;
  color: var(--ns-accent);
  border-color: color-mix(in srgb, var(--ns-accent) 55%, var(--ns-border));
  background: color-mix(in srgb, var(--ns-accent) 12%, var(--ns-input-bg));
  pointer-events: none;
}

.btn-generate-copy[aria-busy="true"]::after,
.btn-generate-caption[aria-busy="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--ns-accent) 35%,
    color-mix(in srgb, var(--ns-accent) 40%, white) 50%,
    var(--ns-accent) 65%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: ai-progress 1.1s linear infinite;
}

.btn-ai-spark {
  flex-shrink: 0;
}

.btn-generate-copy[aria-busy="true"] .btn-ai-spark,
.btn-generate-caption[aria-busy="true"] .btn-ai-spark {
  animation: ai-sparkle 1.1s ease-in-out infinite;
  transform-origin: center;
}

#props-panel.is-generating-copy #prop-title,
#props-panel.is-generating-copy #prop-description,
#props-panel.is-generating-copy #prop-caption {
  pointer-events: none;
  border-color: color-mix(in srgb, var(--ns-accent) 45%, var(--ns-border));
  background:
    linear-gradient(
      110deg,
      transparent 30%,
      color-mix(in srgb, var(--ns-accent) 18%, transparent) 48%,
      transparent 66%
    )
    var(--ns-input-bg);
  background-size: 220% 100%;
  animation: ai-field-shimmer 1.35s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
.btn-generate-copy[aria-busy="true"]::after,
  .btn-generate-caption[aria-busy="true"]::after,
  .btn-generate-copy[aria-busy="true"] .btn-ai-spark,
  .btn-generate-caption[aria-busy="true"] .btn-ai-spark,
  #props-panel.is-generating-copy #prop-title,
  #props-panel.is-generating-copy #prop-description,
  #props-panel.is-generating-copy #prop-caption {
    animation: none;
  
}
.btn-generate-copy[aria-busy="true"] .btn-ai-spark,
  .btn-generate-caption[aria-busy="true"] .btn-ai-spark {
    opacity: 0.85;
  
}
.boot-progress-bar {
    animation: none;
    width: 55%;
    transform: none;
    margin-inline: auto;
    opacity: 0.85;
  
}
}

.props label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ns-muted);
}

/*
 * Campos do painel do passo — um só padrão (design system: --ns-font, raio 7px igual a .btn/.mode-btn,
 * texto 0.8125rem igual a .btn, altura 34px, foco com o acento).
 * why: o input[type=url] do vídeo ficava fora da regra (borda/fonte do navegador, placeholder cortado).
 */
.props {
  --props-field-h: 34px;
  --props-field-radius: 7px;
  --props-field-font: 0.8125rem;
}

.props input[type="text"],
.props input[type="number"],
.props input[type="url"],
.props select,
.props textarea {
  box-sizing: border-box;
  min-height: var(--props-field-h);
  border: 1px solid var(--ns-border);
  border-radius: var(--props-field-radius);
  padding: 7px 10px;
  color: var(--ns-ink);
  font-family: var(--ns-font);
  font-size: var(--props-field-font);
  font-weight: 400;
  line-height: 1.4;
  background: var(--ns-input-bg);
}

.props textarea {
  line-height: 1.45;
  resize: vertical;
}

.props :is(input, textarea)::placeholder {
  color: var(--ns-muted);
  opacity: 1;
}

.props :is(input[type="text"], input[type="number"], input[type="url"], select, textarea):focus-visible {
  outline: 2px solid var(--ns-accent);
  outline-offset: 1px;
  border-color: var(--ns-accent);
}

.caption-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.caption-audio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.caption-player {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 2px;
  padding: 10px 12px 8px;
  border-radius: 18px;
  background: var(--ns-input-bg);
  border: 1px solid var(--ns-border);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--ns-ink) 8%, transparent);
}

.caption-player-toggle {
  grid-column: 1;
  grid-row: 1;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ns-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.caption-player-toggle:disabled {
  opacity: 0.45;
  cursor: default;
}

.caption-player-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.caption-player-toggle .caption-player-icon-pause {
  display: none;
}

.caption-player-toggle.is-playing .caption-player-icon-play {
  display: none;
}

.caption-player-toggle.is-playing .caption-player-icon-pause {
  display: block;
}

.caption-seek {
  grid-column: 2;
  grid-row: 1;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.caption-seek:disabled {
  cursor: default;
}

.caption-seek::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ns-accent) var(--pct, 0%), var(--ns-thumb) var(--pct, 0%));
}

.caption-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: var(--ns-accent);
  box-shadow: 0 0 0 2px var(--ns-input-bg);
}

.caption-seek::-moz-range-track {
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: var(--ns-thumb);
}

.caption-seek::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: var(--ns-accent);
}

.caption-seek::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: var(--ns-accent);
}

.caption-player-times {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ns-muted);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.caption-player-rate {
  grid-column: 3;
  grid-row: 1;
  flex: 0 0 auto;
  min-width: 46px;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: var(--ns-button);
  color: var(--ns-button-text);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hold-field {
  margin-top: 18px;
  max-width: 140px;
}

.hold-field input[type="number"] {
  width: 76px;
}

.settings-key-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.settings-key-form {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.settings-key-form input {
  width: 100%;
  box-sizing: border-box;
}

.settings-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
}

.settings-actions .btn-icon {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
}

.inline-slot {
  position: relative;
  min-width: 0;
}

.inline-placeholder {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  pointer-events: none;
  opacity: 0.45;
  white-space: pre-wrap;
}

.inline-placeholder[hidden] {
  display: none !important;
}

#canvas-popover-body {
  white-space: pre-wrap;
}

.editor-popover {
  position: absolute;
  z-index: 7;
  box-sizing: border-box;
  width: min(280px, calc(100% - 8px));
  padding: 10px 14px 12px;
  background: var(--demo-popover-bg);
  color: var(--demo-popover-text);
  border-radius: 5px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  line-height: 1.45;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.editor-popover.is-dragging {
  cursor: grabbing;
}

.editor-popover [data-inline] {
  cursor: text;
  user-select: text;
  touch-action: auto;
}

.view-editor.is-presenting .editor-popover,
body.is-presenting .editor-popover {
  display: none !important;
}

.editor-popover-grip {
  height: 12px;
  margin: 0 0 8px;
  border-radius: 4px;
  cursor: grab;
  background: radial-gradient(circle, color-mix(in srgb, var(--demo-popover-text) 45%, transparent) 1.15px, transparent 1.3px) center / 10px 6px;
}

.editor-popover-title {
  margin: 0;
  color: var(--demo-popover-title);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.editor-popover-body {
  margin: 8px 0 0;
  font-size: 13.5px;
  line-height: 1.45;
}

.editor-popover-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  min-height: 28px;
}

.editor-popover-progress {
  flex: 1;
  text-align: center;
  color: var(--ns-muted);
  font-size: 13px;
  font-weight: 500;
}

.editor-popover-next {
  background: var(--demo-button);
  color: var(--ns-button-text);
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.editor-popover-arrow {
  position: absolute;
  width: 0;
  height: 0;
  border: 8px solid transparent;
}

.editor-popover[data-side="bottom"] .editor-popover-arrow {
  top: -16px;
  border-bottom-color: var(--demo-popover-bg);
}

.editor-popover[data-side="top"] .editor-popover-arrow {
  bottom: -16px;
  border-top-color: var(--demo-popover-bg);
}

.editor-popover[data-side="left"] .editor-popover-arrow {
  right: -16px;
  border-left-color: var(--demo-popover-bg);
}

.editor-popover[data-side="right"] .editor-popover-arrow {
  left: -16px;
  border-right-color: var(--demo-popover-bg);
}

.editor-popover[data-side="top"][data-align="start"] .editor-popover-arrow,
.editor-popover[data-side="bottom"][data-align="start"] .editor-popover-arrow {
  left: 22px;
}

.editor-popover[data-side="top"][data-align="center"] .editor-popover-arrow,
.editor-popover[data-side="bottom"][data-align="center"] .editor-popover-arrow {
  left: calc(50% - 8px);
}

.editor-popover[data-side="top"][data-align="end"] .editor-popover-arrow,
.editor-popover[data-side="bottom"][data-align="end"] .editor-popover-arrow {
  right: 22px;
}

.editor-popover[data-side="left"][data-align="start"] .editor-popover-arrow,
.editor-popover[data-side="right"][data-align="start"] .editor-popover-arrow {
  top: 18px;
}

.editor-popover[data-side="left"][data-align="center"] .editor-popover-arrow,
.editor-popover[data-side="right"][data-align="center"] .editor-popover-arrow {
  top: calc(50% - 8px);
}

.editor-popover[data-side="left"][data-align="end"] .editor-popover-arrow,
.editor-popover[data-side="right"][data-align="end"] .editor-popover-arrow {
  bottom: 18px;
}

.caption-placeholder {
  left: auto;
  right: auto;
  top: auto;
  z-index: 5;
  opacity: 0.75;
  color: var(--ns-button-text);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
}

.view-editor:not(.is-presenting) .caption-bar.is-caption-off {
  opacity: 0.72;
  outline: 1px dashed color-mix(in srgb, var(--ns-button-text) 55%, transparent);
  outline-offset: -1px;
}

.props-meta {
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--ns-muted);
  margin: 0;
}

.hotspot.is-previewing .hotspot-handle {
  display: none !important;
}

.image-picker-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ns-muted);
}

.image-pick-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 1px dashed var(--ns-border);
  border-radius: var(--props-field-radius, 7px);
  background: var(--ns-input-bg);
  color: var(--ns-ink);
  cursor: pointer;
  text-align: left;
}

.image-pick-btn:focus-visible {
  outline: 2px solid var(--ns-accent);
  outline-offset: 1px;
}

.image-pick-btn:hover {
  border-color: var(--ns-accent);
  background: var(--ns-hover);
}

.image-pick-btn img {
  width: 56px;
  height: 36px;
  object-fit: contain;
  border-radius: 4px;
  background: var(--ns-canvas);
  flex-shrink: 0;
}

.image-pick-btn span {
  font-size: 0.8rem;
  color: var(--ns-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-modal {
  border: none;
  border-radius: 12px;
  padding: 0;
  width: min(860px, 94vw);
  max-height: 85vh;
  background: var(--ns-panel);
  color: var(--ns-ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.image-modal::backdrop {
  background: color-mix(in srgb, var(--ns-overlay) 55%, transparent);
}

.image-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ns-border);
}

.image-modal-header h3 {
  margin: 0;
  font-size: 1rem;
}

.image-modal-actions {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ns-border);
}

.image-modal-actions input[type="search"] {
  flex: 1;
  border: 1px solid var(--ns-border);
  border-radius: 7px;
  padding: 8px 10px;
  background: var(--ns-input-bg);
  color: var(--ns-ink);
}

.image-drop-hint {
  margin: 0;
  padding: 8px 16px 0;
  font-size: 0.75rem;
  color: var(--ns-muted);
}

.image-modal.is-drop .image-grid {
  outline: 2px dashed var(--ns-accent);
  outline-offset: -10px;
  background: color-mix(in srgb, var(--ns-accent) 10%, transparent);
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  padding: 16px;
  overflow: auto;
  max-height: calc(85vh - 130px);
}

.image-grid-group {
  grid-column: 1 / -1;
  margin-top: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ns-muted);
}

.image-tile-wrap {
  position: relative;
  min-width: 0;
}

.image-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--ns-border);
  border-radius: 8px;
  background: var(--ns-input-bg);
  cursor: pointer;
  text-align: left;
}

.image-tile-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 1;
  width: 22px;
  height: 22px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ns-panel) 88%, transparent);
  color: var(--ns-ink);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
}

.image-tile-remove:hover {
  color: var(--ns-danger);
  background: var(--ns-danger-bg);
}

.image-tile:hover,
.image-tile.is-selected {
  border-color: var(--ns-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ns-accent) 28%, transparent);
}

.image-tile img {
  width: 100%;
  height: 88px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--ns-thumb);
}

.image-tile span {
  font-size: 0.72rem;
  color: var(--ns-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-grid-empty {
  grid-column: 1 / -1;
  color: var(--ns-muted);
  text-align: center;
}

.view-library {
  overflow: auto;
  padding: 28px 32px 48px;
  background: var(--ns-surface);
}

.library-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.library-header h1 {
  margin: 0 0 6px;
  font-size: 1.6rem;
}

.library-header p {
  margin: 0;
  color: var(--ns-muted);
  font-size: 0.92rem;
}

.release-notes {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 22px;
  padding: 14px 16px;
  border: 1px solid var(--ns-border);
  border-radius: 12px;
  background: var(--ns-panel);
  color: var(--ns-ink);
}

.release-notes[hidden] {
  display: none !important;
}

.release-notes-body {
  min-width: 0;
  flex: 1;
}

.release-notes-title {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 700;
}

.release-notes-list {
  margin: 0;
  padding-left: 1.15em;
  color: var(--ns-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.release-notes-list li + li {
  margin-top: 4px;
}

.release-notes > .btn {
  flex: none;
  align-self: flex-start;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.library-grid-items {
  display: contents;
}

.library-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  justify-self: stretch;
  width: 100%;
  height: 100%;
  min-height: 100%;
  gap: 10px;
  padding: 16px 12px;
  border-radius: 10px;
  border: 1.5px dashed color-mix(in srgb, var(--ns-accent) 55%, var(--ns-border));
  background: color-mix(in srgb, var(--ns-accent) 7%, var(--ns-panel));
  color: var(--ns-ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
}

.library-action-card:hover {
  border-color: var(--ns-accent);
}

.library-action-card:focus-visible {
  outline: 2px solid var(--ns-accent);
  outline-offset: 2px;
}

.library-action-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: none;
  background: color-mix(in srgb, var(--ns-accent) 18%, var(--ns-panel));
  color: var(--ns-ink);
}

.library-action-icon .btn-ico {
  width: 1.4rem;
  height: 1.4rem;
}

.library-empty {
  color: var(--ns-muted);
  text-align: center;
  margin-top: 28px;
}

.library-import-hint {
  grid-column: 1 / -1;
  justify-self: start;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ns-muted);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.library-import-hint:hover {
  color: var(--ns-ink);
}

.project-card {
  position: relative;
  background: var(--ns-panel);
  border: 1px solid var(--ns-border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  box-shadow: 0 3px 12px color-mix(in srgb, var(--ns-overlay) 7%, transparent);
  cursor: pointer;
}

.project-card:hover {
  border-color: var(--ns-accent);
}

.project-card:focus-visible {
  outline: 2px solid var(--ns-accent);
  outline-offset: 2px;
}

.project-card-close {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 22px;
  height: 22px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ns-panel) 88%, transparent);
  color: var(--ns-muted);
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.project-card-close:hover {
  color: var(--ns-danger);
  border-color: color-mix(in srgb, var(--ns-danger) 35%, var(--ns-border));
  background: var(--ns-danger-bg);
}

.project-card-close .btn-ico {
  width: 12px;
  height: 12px;
}

.project-card-thumb {
  height: 104px;
  flex: none;
  background: var(--ns-thumb);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.project-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card-placeholder {
  color: var(--ns-muted);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.project-card-body {
  padding: 10px 10px 12px;
  display: grid;
  gap: 6px;
  align-content: start;
  flex: 1;
}

.project-card-body h3,
.project-card-title {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.25;
}

.project-card-title {
  cursor: text;
  border-radius: 4px;
  padding: 0;
  min-height: calc(1.25em * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card-title[data-editing="1"] {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  min-height: 0;
}

.project-card-title:hover {
  background: var(--ns-hover);
}

.inline-edit {
  width: 100%;
  min-width: 8ch;
  max-width: 100%;
  font: inherit;
  font-weight: inherit;
  color: var(--ns-ink);
  background: var(--ns-input-bg);
  border: 1px solid var(--ns-accent);
  border-radius: 4px;
  padding: 4px 8px;
  outline: none;
}

.project-card-body p {
  margin: 0;
  color: var(--ns-muted);
  font-size: 0.72rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-card-dots,
.theme-swatch-dots {
  display: flex;
  gap: 4px;
}

.project-card-dots i {
  width: 10px;
  height: 10px;
}

.theme-swatch-dots i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.project-card-dots i {
  border-radius: 50%;
  display: inline-block;
}

.project-card-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  margin-top: 2px;
}

.project-card-actions .btn {
  min-height: 26px;
  padding: 0.2em 0.5em;
  font-size: 0.68rem;
  gap: 4px;
}

.project-card-actions .btn-ico {
  width: 0.9rem;
  height: 0.9rem;
}

.theme-section-label {
  margin: 4px 0 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ns-muted);
}

.theme-presets,
.theme-customs {
  display: grid;
  gap: 6px;
}

.theme-swatch {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--ns-border);
  background: var(--ns-input-bg);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
}

.theme-swatch:hover,
.theme-swatch.is-active {
  border-color: var(--ns-accent);
  background: var(--ns-hover);
}

.theme-swatch-name {
  font-size: 0.82rem;
  color: var(--ns-ink);
}

.theme-custom-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.theme-divider {
  border: 0;
  border-top: 1px solid var(--ns-border);
  margin: 4px 0;
}

.theme-empty {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ns-muted);
}

.canvas-empty {
  margin: auto;
  max-width: 420px;
  text-align: center;
  padding: 32px 24px;
  background: var(--ns-panel);
  border: 1px dashed var(--ns-border);
  border-radius: 14px;
  color: var(--ns-ink);
}

.canvas-empty h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.canvas-empty p {
  margin: 0 0 16px;
  color: var(--ns-muted);
  font-size: 0.9rem;
}

.canvas-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.props.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.studio-modal {
  border: none;
  border-radius: 12px;
  padding: 0;
  max-width: 440px;
  width: calc(100% - 32px);
  background: var(--ns-panel);
  color: var(--ns-ink);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.shortcuts-modal {
  max-width: 560px;
}

.shortcuts-lead {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--ns-muted);
  line-height: 1.4;
}

.shortcuts-table {
  display: grid;
  gap: 2px;
  max-height: min(60vh, 420px);
  overflow: auto;
}

.shortcuts-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 0.82rem;
}

.shortcuts-row:nth-child(even):not(.shortcuts-head) {
  background: color-mix(in srgb, var(--ns-hover) 70%, transparent);
}

.shortcuts-head {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ns-muted);
  position: sticky;
  top: 0;
  background: var(--ns-panel);
}

.shortcuts-row kbd {
  width: fit-content;
  max-width: 100%;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1.3;
  color: var(--ns-ink);
  background: var(--ns-input-bg);
  border: 1px solid var(--ns-border);
  border-radius: 6px;
  padding: 3px 6px;
}

.studio-modal::backdrop {
  background: color-mix(in srgb, var(--ns-overlay) 55%, transparent);
}

.studio-modal-body {
  padding: 18px 18px 16px;
  display: grid;
  gap: 12px;
}

.studio-modal-body h3 {
  margin: 0;
}

.studio-modal-body label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ns-muted);
}

.studio-modal-body :is(
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="url"],
  input[type="tel"],
  input[type="search"],
  input[type="number"]
) {
  box-sizing: border-box;
  border: 1px solid var(--ns-border);
  border-radius: 8px;
  padding: 10px;
  color: var(--ns-ink);
  font-weight: 400;
  background: var(--ns-input-bg);
}

.studio-modal-body :is(
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="url"],
  input[type="tel"],
  input[type="search"],
  input[type="number"]
)::placeholder {
  color: var(--ns-muted);
  opacity: 1;
}

.studio-modal-body :is(
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="url"],
  input[type="tel"],
  input[type="search"],
  input[type="number"]
):focus-visible {
  outline: 2px solid var(--ns-accent);
  outline-offset: 1px;
  border-color: var(--ns-accent);
}

.studio-modal-body .delete-project-lead {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--ns-muted);
  line-height: 1.4;
}

.studio-modal-body .delete-project-lead strong {
  color: var(--ns-ink);
  font-weight: 700;
}

.studio-modal-body .delete-project-backup {
  margin: 0;
}

.studio-modal-body .delete-project-hint {
  color: var(--ns-danger);
}

.studio-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.studio-modal-actions .btn-danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.present-close {
  display: none;
  position: fixed;
  top: calc(8px + env(safe-area-inset-top, 0px));
  right: calc(8px + env(safe-area-inset-right, 0px));
  z-index: 1000000004;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--ns-button-text) 22%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ns-overlay) 78%, transparent);
  color: var(--ns-button-text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.present-close .btn-ico {
  width: 20px;
  height: 20px;
}

.present-close[hidden] {
  display: none !important;
}

.rotate-hint {
  display: none;
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 1000000003;
  margin: 0;
  max-width: min(320px, calc(100vw - 32px));
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--ns-button-text) 18%, transparent);
  background: color-mix(in srgb, var(--ns-overlay) 88%, transparent);
  color: var(--ns-button-text);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.35;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.rotate-hint[hidden] {
  display: none !important;
}

/* ===== Layout do editor: Arquivo, Preview, painel recolhível, título, barra flutuante, narração ===== */
/* Header: menu Arquivo, Preview dividido, Compartilhar com texto */
.topbar-nav {
  gap: 4px;
}

.menu-panel {
  position: relative;
  flex: none;
}

.menu-panel > summary {
  list-style: none;
}

.menu-panel > summary::-webkit-details-marker {
  display: none;
}

.menu-summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  color: var(--ns-button-text);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}

.menu-summary:hover,
.menu-panel[open] > .menu-summary {
  background: color-mix(in srgb, var(--ns-topbar-muted) 16%, var(--ns-topbar));
  border-color: color-mix(in srgb, var(--ns-topbar-muted) 45%, transparent);
}

.menu-caret {
  width: 14px;
  height: 14px;
  opacity: 0.8;
}

.menu-panel-body {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 60;
  display: grid;
  gap: 2px;
  min-width: 228px;
  padding: 6px;
  background: var(--ns-panel);
  color: var(--ns-ink);
  border: 1px solid var(--ns-border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.menu-panel-body .more-divider {
  margin: 4px;
}

.menu-panel-body .more-item {
  padding: 8px 10px;
  gap: 8px;
}

.more-item-danger:hover {
  color: var(--ns-danger);
  background: var(--ns-danger-bg);
}

.menu-kbd {
  margin-left: auto;
  padding: 1px 6px;
  border: 1px solid var(--ns-border);
  border-radius: 4px;
  font-family: var(--ns-font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ns-muted);
}

.menu-summary:focus-visible,
.split-caret:focus-visible,
.export-panel > summary.share-menu:focus-visible {
  outline: 2px solid var(--ns-accent);
  outline-offset: 2px;
}

.prefs-panel > .more-panel-body {
  left: auto;
  right: 0;
}

@media (hover: hover) and (min-width: 701px) {
/* why: a engrenagem fica à direita — os submenus abrem para a esquerda */
.prefs-panel .more-flyout > .more-flyout-body.theme-panel-body,
  .prefs-panel .more-flyout > .more-flyout-body.theme-panel-body.theme-panel-wide {
    left: auto;
    right: calc(100% + 8px);
  
}
.prefs-panel .more-flyout[open]::after {
    left: auto;
    right: 100%;
  
}
}

.split-btn {
  display: inline-flex;
  align-items: stretch;
}

.split-btn .split-main {
  min-height: 32px;
  height: 32px;
  padding: 0 12px;
  gap: 6px;
  border-radius: 8px 0 0 8px;
  background: color-mix(in srgb, var(--ns-topbar-muted) 16%, var(--ns-topbar));
  color: var(--ns-button-text);
  border-color: color-mix(in srgb, var(--ns-topbar-muted) 45%, transparent);
}

.split-btn .split-main:hover,
.split-caret:hover,
.preview-panel[open] > .split-caret {
  background: color-mix(in srgb, var(--ns-topbar-muted) 28%, var(--ns-topbar));
}

.split-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 32px;
  border: 1px solid color-mix(in srgb, var(--ns-topbar-muted) 45%, transparent);
  border-left-width: 0;
  border-radius: 0 8px 8px 0;
  background: color-mix(in srgb, var(--ns-topbar-muted) 16%, var(--ns-topbar));
  color: var(--ns-button-text);
  cursor: pointer;
}

.split-caret .btn-ico {
  width: 14px;
  height: 14px;
}

.preview-panel > .menu-panel-body {
  left: auto;
  right: 0;
}

/* why: Compartilhar é a ação primária da tela — botão com texto, não só ícone */
.export-panel > summary.share-menu {
  width: auto;
  min-height: 32px;
  height: 32px;
  padding: 0 14px;
  gap: 6px;
  border-radius: 8px;
  border-color: transparent;
  background: var(--ns-accent);
  color: #06201c;
  font-weight: 700;
}

.export-panel > summary.share-menu:hover,
.export-panel[open] > summary.share-menu {
  background: color-mix(in srgb, var(--ns-accent) 86%, #ffffff);
}

/* Só no modo edição: no Preview (.is-presenting) a grade é uma coluna só.
   :where() mantém a especificidade, para a regra de 1 coluna do celular seguir valendo. */
.view-editor.is-props-collapsed:where(:not(.is-presenting)) {
  grid-template-columns: 168px minmax(0, 1fr) 48px;
}

/* Filmstrip só com miniaturas */
.filmstrip-header {
  padding: 12px 10px 10px;
}

.filmstrip-metrics {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 8px;
  padding: 0 2px;
}

.filmstrip-metrics .metrics-time {
  font-size: 1rem;
  font-weight: 800;
  color: var(--ns-ink);
}

.filmstrip-metrics {
  align-items: center;
  cursor: default;
}

.filmstrip-metrics .metrics-ico {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--ns-muted);
}

.filmstrip-metrics .metrics-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.75rem;
  font-weight: 600;
  /* why: o cinza "muted" sumia no painel escuro — o rótulo precisa ser lido, só um pouco mais suave que o tempo. */
  color: color-mix(in srgb, var(--ns-ink) 78%, var(--ns-panel));
}

.filmstrip-metrics .metrics-count {
  display: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ns-muted);
}

.filmstrip-multi-hint {
  display: none;
}

.filmstrip-header,
.canvas-toolbar {
  box-sizing: border-box;
  height: var(--editor-bar-h);
  min-height: var(--editor-bar-h);
  padding-block: 0;
  border-bottom: 1px solid var(--ns-border);
}

.filmstrip-header {
  justify-content: center;
  padding-inline: 10px;
}

.filmstrip-metrics {
  position: relative;
  flex-wrap: nowrap;
  white-space: nowrap;
  min-width: 0;
  line-height: 1.2;
}

.filmstrip-metrics {
  column-gap: 6px;
}

.filmstrip-metrics .metrics-time {
  flex: 0 0 auto;
}

/* why: o title nativo abria em cima do rótulo "Duração"; a dica agora aparece abaixo da barra. */
.filmstrip-metrics[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  z-index: 30;
  left: 0;
  top: calc(100% + (var(--editor-bar-h) - 100%) / 2 + 6px);
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--ns-ink);
  color: var(--ns-panel);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.filmstrip-metrics[data-tip]:hover::after {
  opacity: 1;
  transition-delay: 0.35s;
}

.canvas-toolbar .toolbar-divider {
  align-self: center;
  height: 32px;
}

/* why: com altura fixa a barra não pode quebrar linha — os grupos ficam numa fila só e,
   se faltar espaço, a barra rola na horizontal (sem trilho ocupando a altura). */
.canvas-toolbar {
  scrollbar-width: none;
}

.canvas-toolbar > .toolbar-group {
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

@media (max-width: 1000px) {
/* "Passo x de y" continua no topo do painel; aqui só ocuparia o espaço dos botões. */
.canvas-toolbar .toolbar-pos {
    display: none;
  
}
}

.filmstrip-notices {
  display: none;
}

.filmstrip-notices:has(> .local-save:not([hidden])),
.filmstrip-notices:has(> .sync-status:not([hidden])) {
  display: block;
  padding: 8px 12px;
  border-bottom: 1px solid var(--ns-border);
}

.filmstrip-notices .local-save,
.filmstrip-notices .sync-status {
  margin: 0;
}

.filmstrip {
  padding: 8px 10px;
}

.film-item {
  display: block;
  padding: 3px;
  margin-bottom: 8px;
  border-radius: 8px;
}

.film-item img,
.film-item .film-thumb-slide {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  border-radius: 5px;
}

.film-item .film-grip,
.film-item .film-meta,
.film-item .film-actions {
  display: none;
}

.film-thumb-is-slide svg {
  width: 22px;
  height: 22px;
  color: var(--ns-accent);
}

.film-thumb-is-slide span {
  display: none;
}

.film-scene {
  margin: 10px 2px 6px;
}

.film-scene .film-grip {
  display: none;
}

.film-scene-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filmstrip-footer {
  flex: 0 0 auto;
  padding: 8px 10px 10px;
  border-top: 1px solid var(--ns-border);
}

.filmstrip-add-images {
  width: 100%;
  white-space: nowrap;
}

/* Toolbar do canvas */
.canvas-toolbar {
  flex-wrap: nowrap;
  overflow-x: auto;
}

.toolbar-pos {
  margin-left: auto;
  padding-left: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ns-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* O passo atual aparece no topo do painel; na barra do canvas só quando o painel está recolhido. */
.view-editor:not(.is-props-collapsed) .canvas-toolbar .toolbar-pos {
  display: none;
}

.canvas-toolbar .btn-danger-hover:hover:not(:disabled) {
  color: var(--ns-danger);
  border-color: color-mix(in srgb, var(--ns-danger) 45%, var(--ns-border));
  background: var(--ns-danger-bg);
}

/* Rótulo da cena no slide: clicável para renomear */
.slide-kicker.is-renamable {
  margin: 0 0 4px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: inline-block;
  border-radius: 4px;
  cursor: text;
  outline: 1px dashed transparent;
  outline-offset: 2px;
  color: var(--demo-accent);
  font-family: var(--ns-font-mono);
  font-size: 0.8rem;
  align-self: flex-start;
}

.slide-card[data-align="center"] .slide-kicker.is-renamable {
  align-self: center;
}

.slide-card[data-align="end"] .slide-kicker.is-renamable {
  align-self: flex-end;
}

.slide-kicker.is-renamable:hover,
.slide-kicker.is-renamable:focus-visible {
  outline-color: color-mix(in srgb, var(--ns-accent) 60%, transparent);
}

/* why: o slide usa o tema do tour, não o do app; com --ns-input-bg o campo ficava preto no modo escuro,
   e o width:100% de .inline-edit jogava o campo para a linha de baixo de "CENA 1 ·" */
.slide-kicker .inline-edit {
  display: inline-block;
  box-sizing: border-box;
  width: auto;
  field-sizing: content;
  min-width: 12ch;
  max-width: 32ch;
  vertical-align: baseline;
  margin: 0;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-transform: none;
  color-scheme: var(--demo-color-scheme, light);
  color: var(--demo-field-ink, #18181b);
  -webkit-text-fill-color: var(--demo-field-ink, #18181b);
  caret-color: var(--demo-accent, var(--ns-accent));
  background: var(--demo-field-bg, #ffffff);
  border: 1px solid var(--demo-field-border, #8a8a94);
  border-radius: 4px;
  padding: 0 6px;
  outline: none;
}

.slide-kicker .inline-edit:focus,
.slide-kicker .inline-edit:focus-visible {
  border-color: var(--demo-form-focus, var(--ns-accent));
  outline: 2px solid color-mix(in srgb, var(--demo-form-focus, var(--ns-accent)) 65%, transparent);
  outline-offset: 1px;
}

.slide-kicker.is-renamable:has(.inline-edit) {
  white-space: nowrap;
  max-width: 100%;
}

/* Barra fixa do passo, acima do canvas */
.step-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin: 12px 24px 0;
  padding: 4px 6px;
  min-height: 44px;
  background: var(--ns-panel);
  color: var(--ns-ink);
  border: 1px solid var(--ns-border);
  border-radius: 12px;
  font-size: 0.75rem;
  line-height: 1;
}

.stb-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.stb-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

.stb-group-label,
.stb-group-label-inline {
  display: none;
}

.stb-seg {
  display: inline-flex;
  gap: 2px;
}

.stb-seg + .stb-seg {
  margin-left: 6px;
}

/* grupo escondido (ex.: posição do balão no passo com vídeo) leva junto o separador seguinte */
.stb-group[hidden] {
  display: none !important;
}

.stb-group[hidden] + .stb-sep {
  display: none;
}

.stb-sep {
  width: 1px;
  height: 22px;
  flex: 0 0 1px;
  background: var(--ns-border);
}

.stb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ns-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.stb-btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.stb-btn:hover:not(:disabled) {
  background: var(--ns-hover);
}

.stb-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.stb-btn.is-active {
  background: color-mix(in srgb, var(--ns-accent) 22%, var(--ns-panel));
  border-color: color-mix(in srgb, var(--ns-accent) 60%, transparent);
  color: var(--ns-accent);
}

.stb-btn.btn-danger-hover:hover:not(:disabled) {
  color: var(--ns-danger);
  background: var(--ns-danger-bg);
}

.stb-btn-text {
  font-size: 0.75rem;
}

.stb-btn-pro .pro-badge {
  margin-left: 2px;
}

.stb-btn:focus-visible,
.stb-hold input:focus-visible,
.stb-menu-item:focus-visible {
  outline: 2px solid var(--ns-accent);
  outline-offset: 1px;
}

.stb-hold {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px;
  color: var(--ns-muted);
  font-weight: 600;
}

.stb-hold svg {
  width: 15px;
  height: 15px;
}

.stb-hold input {
  width: 48px;
  height: 26px;
  padding: 2px 4px;
  border: 1px solid var(--ns-border);
  border-radius: 6px;
  background: var(--ns-input-bg);
  color: var(--ns-ink);
  font: inherit;
  font-size: 0.78rem;
}

.stb-more-wrap {
  position: relative;
  flex: 0 0 auto;
  margin-left: auto;
}

.stb-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 220px;
  padding: 6px;
  background: var(--ns-panel);
  border: 1px solid var(--ns-border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.stb-menu[hidden] {
  display: none;
}

.stb-menu-groups {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stb-menu-groups .stb-group {
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 4px 8px;
  border-bottom: 1px solid var(--ns-border);
}

.stb-menu-groups .stb-group-label {
  display: block;
  flex: 1 0 100%;
  margin-bottom: 2px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ns-muted);
}

.stb-menu-groups .stb-group-label-inline {
  display: inline;
}

.stb-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ns-ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.stb-menu-item:hover {
  background: var(--ns-hover);
}

.stb-menu-item svg {
  width: 16px;
  height: 16px;
}

.step-toolbar.is-generating-copy #btn-step-generate-copy .btn-ai-spark,
.step-toolbar.is-generating-audio #btn-generate-caption .btn-ai-spark {
  animation: ai-audio-pulse 1.4s ease-in-out infinite;
}

.view-editor.has-narration-bar:not(.is-presenting) .canvas-stage {
  --media-chrome: 292px;
}

.view-editor.is-presenting .step-toolbar,
.view-editor.is-presenting .narration-bar {
  display: none !important;
}

/* Player da narração: só quando o passo tem áudio */
.narration-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 24px 12px;
  padding: 6px 12px;
  min-height: 44px;
  background: var(--ns-panel);
  border: 1px solid var(--ns-border);
  border-radius: 12px;
}

.narration-bar-ico {
  width: 16px;
  height: 16px;
  color: var(--ns-muted);
  flex: 0 0 auto;
}

.narration-bar .caption-player {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.narration-bar .caption-player[hidden] {
  display: none;
}

.narration-bar .caption-seek {
  flex: 1 1 auto;
  min-width: 80px;
}

.narration-bar .caption-player-times {
  display: inline-flex;
  flex: 0 0 auto;
  justify-content: flex-start;
  min-width: 76px;
  font-size: 0.75rem;
}

.narration-bar .caption-time-sep {
  margin: 0 4px;
}

/* why: a trilha precisa aparecer sobre o fundo do painel para dar para clicar/arrastar */
.narration-bar .caption-seek::-webkit-slider-runnable-track {
  height: 6px;
  background: linear-gradient(
    90deg,
    var(--ns-accent) var(--pct, 0%),
    color-mix(in srgb, var(--ns-muted) 35%, var(--ns-panel)) var(--pct, 0%)
  );
}

.narration-bar .caption-seek::-webkit-slider-thumb {
  margin-top: -4px;
  box-shadow: 0 0 0 2px var(--ns-panel);
}

.narration-bar .caption-seek::-moz-range-track {
  height: 6px;
  background: color-mix(in srgb, var(--ns-muted) 35%, var(--ns-panel));
}

.narration-bar .caption-seek::-moz-range-progress {
  height: 6px;
}

/* Painel direito recolhível */
.props-header h2 {
  flex: 0 0 auto;
}

.props-pos {
  margin-right: auto;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ns-muted);
  font-variant-numeric: tabular-nums;
}

.props .props-toggle,
.props-rail .btn {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  background: transparent;
  color: var(--ns-ink);
  border-color: transparent;
}

.props .props-toggle:hover,
.props-rail .btn:hover {
  background: var(--ns-hover);
  border-color: var(--ns-border);
}

.props-toggle-ico-closed {
  display: none;
}

.props-rail {
  display: none;
}

.props-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.props-section {
  border-top: 1px solid var(--ns-border);
  padding-top: 8px;
}

.props-section-head {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ns-muted);
  cursor: pointer;
  border-radius: 6px;
}

.props-section-head::-webkit-details-marker {
  display: none;
}

.props-section-head::after {
  content: "";
  margin-left: auto;
  width: 0.45em;
  height: 0.45em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 150ms ease;
}

.props-section[open] > .props-section-head::after {
  transform: rotate(45deg);
}

.props-section-head:focus-visible {
  outline: 2px solid var(--ns-accent);
  outline-offset: 2px;
}

.props-section-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 0 4px;
}

.props-section-body .hold-field {
  margin-top: 4px;
}

.view-editor.is-props-collapsed #props-panel {
  padding: 8px;
  align-items: center;
  overflow: hidden;
}

.view-editor.is-props-collapsed .props-header {
  flex-direction: column;
  margin: 0;
}

.view-editor.is-props-collapsed .props-header h2,
.view-editor.is-props-collapsed .props-pos,
.view-editor.is-props-collapsed .props-body {
  display: none;
}

.view-editor.is-props-collapsed .props-toggle-ico-open {
  display: none;
}

.view-editor.is-props-collapsed .props-toggle-ico-closed {
  display: block;
}

.view-editor.is-props-collapsed .props-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--ns-border);
}

@media (prefers-reduced-motion: reduce) {
.step-toolbar .btn-ai-spark {
    animation: none !important;
  
}
.props-section-head::after {
    transition: none;
  
}
}

@media (max-width: 1100px) {
.view-editor.is-props-collapsed:where(:not(.is-presenting)) {
    grid-template-columns: 148px minmax(0, 1fr) 48px;
  
}
.stb-btn-text,
  .split-btn .split-label {
    display: none;
  
}
}

@media (hover: none) and (pointer: coarse) and (max-width: 900px),
  (hover: none) and (pointer: coarse) and (max-height: 500px) {
.topbar-actions .btn,
  .topbar-tools .btn {
    min-height: 44px;
  
}
.topbar-actions .btn-icon,
  .more-panel > summary,
  .canvas-toolbar .btn-icon {
    min-width: 44px;
    min-height: 44px;
  
}
/* Novo projeto fica oculto: a captura nasce no computador. Importar continua. */
#btn-new-project,
  #btn-menu-new,
  #btn-capture-desktop,
  #btn-capture-desktop-lib,
  .project-card-close,
  .project-card-actions {
    display: none !important;
  
}
.export-panel > summary {
    width: 44px;
    height: 44px;
  
}
.people-panel > summary.people-menu {
    min-width: 44px;
    min-height: 44px;
    height: 44px;
    justify-content: center;
  
}
.export-option {
    min-height: 44px;
  
}
.view-editor:not(.is-presenting) #filmstrip-panel {
    grid-row: 2;
    min-height: 0;
    border-right: 0;
    border-top: 1px solid var(--ns-border);
  
}
.view-editor:not(.is-presenting) #props-panel {
    display: none !important;
  
}
.filmstrip-multi-hint,
  .canvas-toolbar > .toolbar-group:first-child,
  .canvas-toolbar > .toolbar-group:first-child + .toolbar-divider,
  #btn-dup-step,
  #btn-copy-step,
  #btn-paste-step {
    display: none !important;
  
}
.film-item {
    grid-template-columns: 56px minmax(0, 1fr);
    padding: 8px;
    cursor: default;
  
}
.film-grip {
    display: none;
  
}
.film-actions {
    position: static;
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    grid-column: 1 / -1;
    pointer-events: auto;
    margin-top: 4px;
  
}
.film-actions button,
  .film-action-move {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border: 1px solid var(--ns-border);
    background: var(--ns-surface);
    font-size: 1.15rem;
  
}
.view-editor:not(.is-presenting) #canvas-popover-body {
    font-size: 16px;
  
}
.view-editor:not(.is-presenting) #canvas-popover-title {
    font-size: max(16px, 1rem);
  
}
.view-editor:not(.is-presenting) .editor-popover {
    touch-action: manipulation;
    cursor: default;
    user-select: text;
  
}
.view-editor:not(.is-presenting) .hotspot-handle,
  .view-editor:not(.is-presenting) .editor-popover-grip {
    display: none !important;
  
}
.project-card-title[data-action="rename-inline"] {
    pointer-events: none;
    cursor: default;
  
}
.project-card-title[data-action="rename-inline"]:hover {
    background: transparent;
  
}
.view-library {
    padding: 16px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  
}
.library-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  
}
.library-import-hint {
    min-height: 44px;
    font-size: 1rem;
  
}
.library-header {
    margin-bottom: 16px;
  
}
.library-header h1 {
    font-size: 1.35rem;
  
}
.release-notes {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 16px;
    gap: 12px;
  
}
.release-notes > .btn {
    align-self: stretch;
    min-height: 44px;
  
}
.btn-generate-copy {
    min-height: 44px;
  
}
body.is-presenting .present-close:not([hidden]) {
    display: inline-flex;
    left: calc(8px + env(safe-area-inset-left, 0px));
    right: auto;
  
}
body.is-presenting .rotate-hint:not([hidden]) {
    display: block;
  
}
.step-toolbar,
  .narration-bar,
  .filmstrip-footer,
  #btn-cut-step,
  #btn-delete-step,
  .toolbar-pos,
  .split-caret,
  .split-btn .split-label,
  .share-label,
  .people-label {
    display: none !important;
  
}
.split-btn .split-main {
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 8px;
  
}
.export-panel > summary.share-menu {
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
  
}
.film-item {
    display: grid;
    padding: 8px;
  
}
.film-item img,
  .film-item .film-thumb-slide {
    width: 56px;
    height: 36px;
    aspect-ratio: auto;
    border-radius: 4px;
  
}
.film-item .film-meta {
    display: block;
  
}
.film-item .film-actions {
    display: flex;
  
}
/* why: no celular a filmstrip fica embaixo e os botões têm 44px — as barras não ficam lado a lado. */
.filmstrip-header,
  .canvas-toolbar {
    height: auto;
    padding-block: 8px;
  
}
/* why: no celular não há "Passo x de y" — o total de passos volta ao lado da duração, como antes. */
.filmstrip-metrics .metrics-count {
    display: inline;
  
}
.filmstrip-metrics .metrics-ico,
  .filmstrip-metrics .metrics-label {
    display: none;
  
}
/* why: no celular só sobra o grupo desfazer/refazer — os separadores ficariam soltos. */
.canvas-toolbar .toolbar-divider {
    display: none;
  
}
}

.embed-needs-publish,
.embed-ready {
  display: grid;
  gap: 12px;
}

.embed-needs-publish[hidden],
.embed-ready[hidden] {
  display: none;
}

.embed-lead,
.embed-hint {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ns-muted);
}

.embed-stale {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--ns-ink);
  background: color-mix(in srgb, #f5a524 18%, transparent);
  border: 1px solid color-mix(in srgb, #f5a524 45%, transparent);
}

.embed-stale[hidden] {
  display: none;
}

.embed-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: var(--ns-input-bg);
  border: 1px solid var(--ns-border);
  width: fit-content;
  max-width: 100%;
}

.embed-tab {
  border: 0;
  background: transparent;
  color: var(--ns-muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
}

.embed-tab[aria-selected="true"] {
  background: var(--ns-panel);
  color: var(--ns-ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.embed-code {
  width: 100%;
  box-sizing: border-box;
  min-height: 150px;
  resize: vertical;
  border: 1px solid var(--ns-border);
  border-radius: 8px;
  padding: 10px;
  background: var(--ns-input-bg);
  color: var(--ns-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.45;
  white-space: pre;
}

.studio-modal-body label.embed-autoplay[hidden] {
  display: none;
}

.studio-modal-body label.embed-autoplay {
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
}

.embed-autoplay input {
  margin-top: 2px;
  flex: none;
}

.embed-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.embed-guide {
  font-size: 0.82rem;
  color: var(--ns-accent, inherit);
}

@media (max-width: 520px) {
.embed-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  
}
.embed-actions .btn {
    min-height: 44px;
  
}
.embed-guide {
    text-align: center;
  
}
}

/* Passos fixos (Início/Fim): cartões 📌 na filmstrip, cartão no player e diálogo no editor */
.film-fixed {
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  margin: 4px 0 8px;
  padding: 8px 26px 8px 8px;
  position: relative;
  border: 1px dashed var(--ns-border);
  border-radius: 8px;
  background: transparent;
  color: var(--ns-muted);
  cursor: pointer;
  user-select: none;
  font-size: 0.78rem;
  line-height: 1.2;
}

.film-fixed:hover,
.film-fixed:focus-visible {
  border-color: var(--ns-accent);
  color: var(--ns-ink);
  outline: none;
}

.film-fixed.is-on {
  border-style: solid;
  border-color: color-mix(in srgb, var(--ns-accent) 55%, var(--ns-border));
  background: color-mix(in srgb, var(--ns-accent) 8%, var(--ns-panel));
  color: var(--ns-ink);
}

.film-fixed-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--ns-input-bg);
  color: var(--ns-accent);
  font-size: 0.8rem;
}

.film-fixed-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.film-fixed-text strong {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
}

.film-fixed-text strong .pro-badge {
  margin-left: 4px;
}

.film-fixed-text small {
  font-size: 0.68rem;
  color: var(--ns-muted);
}

.film-fixed-pin {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 0.7rem;
  opacity: 0.7;
}

/* Diálogo do editor: cabeçalho e ações fixos, só o miolo rola (e só em telas baixas) */
dialog.fixed-modal {
  width: min(900px, calc(100vw - 24px));
  max-width: 900px;
  max-height: calc(100dvh - 16px);
  margin: auto;
  overflow: hidden;
}

dialog.fixed-modal[open] {
  display: flex;
  flex-direction: column;
}

.fixed-dialog {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 12px;
}

.fixed-dialog .account-dialog-head h3 {
  font-size: 1.02rem;
}

.fixed-dialog-scroll {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  margin: 0 -6px;
  padding: 2px 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.fixed-actions {
  flex: 0 0 auto;
  margin-top: 0;
  padding-top: 10px;
  border-top: 1px solid var(--ns-border);
}

.fixed-actions-aside {
  margin-right: auto;
}

.fixed-lead {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ns-muted);
  line-height: 1.4;
}

.fixed-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
  gap: 16px;
  align-items: start;
}

.fixed-fields,
.fixed-config,
.fixed-sub {
  display: grid;
  gap: 8px;
}

.fixed-config.is-off {
  opacity: 0.55;
}

.fixed-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px 10px;
  align-items: end;
}

.fixed-row-inline {
  grid-template-columns: auto minmax(120px, 1fr);
  align-items: center;
}

.fixed-row-seg {
  grid-template-columns: auto minmax(140px, 1fr);
}

.fixed-row-seg .fixed-seg {
  flex-wrap: nowrap;
}

.fixed-group {
  margin: 0;
  padding: 8px 10px;
  display: grid;
  gap: 8px;
  border: 1px solid var(--ns-border);
  border-radius: 10px;
  min-width: 0;
}

.fixed-sub[hidden],
.fixed-group [hidden],
.fixed-config [hidden] {
  display: none !important;
}

.studio-modal-body .fixed-config label {
  gap: 4px;
  font-size: 0.8rem;
}

.studio-modal-body .fixed-check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--ns-ink);
  font-size: 0.84rem;
  font-weight: 600;
}

.studio-modal-body .fixed-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--ns-accent);
}

/* why: campos do editor com cor e fundo próprios — nunca herdar do tema/rótulo */
.studio-modal-body .fixed-config :is(input[type="text"], input[type="tel"], input[type="email"], textarea) {
  box-sizing: border-box;
  width: 100%;
  min-height: 36px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--ns-ink) 42%, var(--ns-input-bg));
  border-radius: 8px;
  background: var(--ns-input-bg);
  color: var(--ns-ink);
  -webkit-text-fill-color: var(--ns-ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.35;
  resize: vertical;
}

/* botão fixo do WhatsApp durante o tour (playback.stickyWhatsAppFromStep) */
.studio-modal-body .fixed-sticky {
  display: grid;
  gap: 4px;
}

.studio-modal-body .fixed-sticky label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ns-ink);
}

.studio-modal-body .fixed-sticky select {
  box-sizing: border-box;
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--ns-ink) 42%, var(--ns-input-bg));
  border-radius: 8px;
  background: var(--ns-input-bg);
  color: var(--ns-ink);
  font: inherit;
  font-size: 14px;
}

.studio-modal-body .fixed-sticky select:focus-visible {
  outline: 2px solid var(--ns-accent);
  outline-offset: 1px;
  border-color: var(--ns-accent);
}

.studio-modal-body .fixed-sticky .fixed-hint {
  margin: 0;
}

.studio-modal-body .fixed-config :is(input, textarea)::placeholder {
  color: var(--ns-muted);
  -webkit-text-fill-color: var(--ns-muted);
  opacity: 1;
}

.studio-modal-body .fixed-config :is(input, textarea):focus-visible {
  outline: 2px solid var(--ns-accent);
  outline-offset: 1px;
  border-color: var(--ns-accent);
}

.fixed-more {
  display: grid;
  gap: 6px;
}

.fixed-more > summary {
  width: fit-content;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ns-ink);
  border-radius: 6px;
}

.fixed-more > summary:focus-visible {
  outline: 2px solid var(--ns-accent);
  outline-offset: 2px;
}

.fixed-more[open] > summary {
  margin-bottom: 2px;
}

.fixed-hint,
.fixed-error {
  margin: -2px 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--ns-muted);
}

.fixed-error {
  color: var(--ns-danger);
  font-weight: 600;
}

/* Telefone do WhatsApp: país (bandeira + DDI) + número nacional, com a lista de países no fluxo
   do diálogo (não flutuante) para não ser cortada pela rolagem. */
.wa-phone-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.studio-modal-body .wa-phone-field > label {
  display: block;
  font-size: 0.8rem;
}

.studio-modal-body .wa-cc {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  min-height: 36px;
  margin: 0;
  padding: 0 8px 0 10px;
  border: 1px solid color-mix(in srgb, var(--ns-ink) 42%, var(--ns-input-bg));
  border-radius: 8px;
  background: var(--ns-input-bg);
  color: var(--ns-ink);
  font: inherit;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.studio-modal-body .wa-cc:hover {
  border-color: color-mix(in srgb, var(--ns-ink) 62%, var(--ns-input-bg));
}

.studio-modal-body .wa-cc:focus-visible,
.studio-modal-body .wa-cc[aria-expanded="true"] {
  outline: 2px solid var(--ns-accent);
  outline-offset: 1px;
  border-color: var(--ns-accent);
}

.wa-cc-chevron {
  width: 12px;
  height: 12px;
  color: var(--ns-muted);
}

.studio-modal-body .fixed-config input[aria-invalid="true"] {
  border-color: var(--ns-danger);
}

.studio-modal-body .fixed-config .wa-cc-search {
  box-sizing: border-box;
  width: 100%;
  min-height: 34px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--ns-ink) 42%, var(--ns-input-bg));
  border-radius: 8px;
  background: var(--ns-input-bg);
  color: var(--ns-ink);
  -webkit-text-fill-color: var(--ns-ink);
  font: inherit;
  font-size: 14px;
}

.fixed-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.studio-modal-body .fixed-seg label {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  box-sizing: border-box;
  padding: 4px 10px;
  border: 1px solid var(--ns-border);
  border-radius: 999px;
  color: var(--ns-ink);
  white-space: nowrap;
  cursor: pointer;
}

.fixed-seg label:has(input:checked) {
  border-color: var(--ns-accent);
  background: color-mix(in srgb, var(--ns-accent) 10%, transparent);
}

.fixed-preview-wrap {
  position: sticky;
  top: 0;
  display: grid;
  gap: 6px;
}

.fixed-preview-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ns-muted);
}

.fixed-preview.is-off {
  opacity: 0.5;
}

@media (max-width: 720px) {
.fixed-grid {
    grid-template-columns: 1fr;
  
}
.fixed-preview-wrap {
    position: static;
  
}
.studio-modal-body .fixed-config :is(input[type="text"], input[type="tel"], input[type="email"], textarea),
  .studio-modal-body .fixed-config .wa-cc-search,
  .studio-modal-body .wa-cc {
    font-size: 16px;
  
}
.studio-modal-body .wa-cc {
    min-height: 40px;
  
}
}

@media (max-width: 480px) {
.fixed-row,
  .fixed-row-inline,
  .fixed-row-seg {
    grid-template-columns: 1fr;
  
}
.fixed-actions-aside {
    flex: 1 0 100%;
  
}
.fixed-actions {
    flex-wrap: wrap;
  
}
}

.fixed-legend {
  padding: 0 4px;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--ns-muted);
}

.fixed-fields-table {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 4px 16px;
  align-items: center;
  font-size: 0.84rem;
}

.fixed-fields-table input {
  width: 16px;
  height: 16px;
  margin: 0;
  justify-self: center;
  accent-color: var(--ns-accent);
}

.fixed-th {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ns-muted);
}

.fixed-dialog h3 .pro-badge {
  vertical-align: middle;
}

.capture-tablist {
  flex-wrap: wrap;
  position: static;
  margin: 0;
  background: var(--ns-panel);
}

.capture-tablist .share-tab {
  flex: 1 1 8.2rem;
}

.capture-tablist .pro-badge {
  flex: none;
}

.capture-pane[hidden] {
  display: none !important;
}

@media (max-height: 820px) {
dialog.capture-modal .fixed-dialog {
  gap: 6px;
  padding: 10px 14px 8px;
}
dialog.capture-modal .fixed-lead {
  font-size: 0.75rem;
}
dialog.capture-modal .fixed-group {
  padding: 6px 8px;
  gap: 6px;
}
dialog.capture-modal textarea {
  min-height: 48px;
  max-height: 72px;
}
}

.fixed-preview .fixed-card .fixed-form .fixed-input {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 14px;
}

@media (max-width: 720px), (pointer: coarse) {
/* why: no celular, 16px evita o zoom automático do iOS ao focar o campo (a regra do cartão mora no player.css) */
.fixed-preview .fixed-card .fixed-form .fixed-input {
    font-size: 16px;
  
}
}

/* Contatos recebidos */
dialog.leads-modal {
  width: min(720px, calc(100vw - 24px));
  max-width: 720px;
  max-height: min(820px, calc(100dvh - 16px));
  margin: auto;
  overflow: auto;
}

.leads-meta,
.leads-status {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ns-muted);
}

.leads-status:empty {
  display: none;
}

.leads-list {
  display: grid;
  gap: 8px;
  max-height: min(52vh, 480px);
  overflow: auto;
}

.leads-row {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--ns-border);
  border-radius: 10px;
  font-size: 0.85rem;
}

.leads-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.leads-name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.leads-source {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ns-accent) 14%, transparent);
  color: var(--ns-accent);
}

.leads-date {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--ns-muted);
}

.leads-delete {
  width: 28px;
  height: 28px;
  font-size: 1.1rem;
}

.leads-delete:hover {
  color: var(--ns-danger);
}

.leads-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.leads-contact a {
  color: var(--ns-accent);
  overflow-wrap: anywhere;
}

.leads-origin {
  margin: 0;
  font-size: 0.75rem;
  color: var(--ns-muted);
  overflow-wrap: anywhere;
}

.leads-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--ns-muted);
}

.leads-filter[hidden] {
  display: none;
}

.leads-filter select {
  min-width: 0;
  max-width: 100%;
}

.leads-message {
  margin: 2px 0 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.leads-consent,
.leads-undelivered {
  margin: 0;
  font-size: 0.72rem;
  color: var(--ns-muted);
}

.leads-undelivered {
  color: var(--ns-danger);
}

.leads-webhook {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--ns-border);
}

.leads-webhook h4 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  font-size: 0.95rem;
}

.leads-webhook h4 .pro-badge {
  margin-left: 0;
}

.leads-webhook-lead,
.leads-webhook-status,
.leads-webhook-delivery {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--ns-muted);
}

.leads-webhook-status:empty,
.leads-webhook-delivery:empty {
  display: none;
}

.leads-webhook-status.is-error {
  color: var(--ns-danger);
  font-weight: 650;
}

.leads-webhook-field {
  display: grid;
  gap: 4px;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 650;
}

.leads-webhook-field input {
  box-sizing: border-box;
  width: 100%;
  min-height: 36px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--ns-ink) 42%, var(--ns-input-bg));
  border-radius: 8px;
  background: var(--ns-input-bg);
  color: var(--ns-ink);
  -webkit-text-fill-color: var(--ns-ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.35;
}

.leads-webhook-field input::placeholder {
  color: var(--ns-muted);
  -webkit-text-fill-color: var(--ns-muted);
  opacity: 1;
}

.leads-webhook-field input:focus-visible {
  outline: 2px solid var(--ns-accent);
  outline-offset: 1px;
}

.leads-webhook-secret-row,
.leads-webhook-actions,
.leads-webhook-secret-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.leads-webhook-secret-row {
  align-items: end;
}

.leads-webhook-secret-row .leads-webhook-field {
  flex: 1 1 180px;
  min-width: 0;
}

.leads-lp-tours {
  display: grid;
  gap: 4px;
  max-height: 160px;
  overflow: auto;
  padding: 2px;
}

.leads-lp-tours .fixed-check span {
  overflow-wrap: anywhere;
}

.leads-hubspot-map {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.leads-hubspot-map legend {
  padding: 0;
  font-size: 0.82rem;
  font-weight: 650;
}

.leads-hubspot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.leads-hubspot-token-choice {
  align-self: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ns-accent, inherit);
  font: inherit;
  font-size: 0.82rem;
  text-decoration: underline;
  cursor: pointer;
}

.leads-hubspot-token-choice:disabled {
  opacity: 0.55;
  cursor: default;
}

@media (max-width: 720px), (pointer: coarse) {
  .leads-webhook-field input {
    font-size: 16px;
  }

  .leads-hubspot-grid {
    grid-template-columns: 1fr;
  }
}

/* Análise do tour (Pro) */
dialog.analytics-modal {
  width: min(760px, calc(100vw - 24px));
  max-width: 760px;
  max-height: min(880px, calc(100dvh - 16px));
  margin: auto;
  overflow: auto;
  overscroll-behavior: contain;
}

/* Resultados: um diálogo. O cabeçalho e as abas ficam fixos; a aba rola por dentro. */
dialog.results-modal[open] {
  display: flex;
  flex-direction: column;
  width: min(760px, calc(100vw - 24px));
  max-width: 760px;
  max-height: calc(100dvh - 32px);
  margin: auto;
  overflow: hidden;
}

dialog.results-modal[open] .results-dialog {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  flex: 1 1 auto;
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  box-sizing: border-box;
}

dialog.results-modal .account-dialog-head,
dialog.results-modal .results-tablist {
  flex: none;
}

.results-panes {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  flex: 1 1 auto;
}

.results-pane {
  display: grid;
  gap: 12px;
  align-content: start;
}

.results-pane[hidden] {
  display: none;
}

#results-pane-delivery .delivery-list {
  display: grid;
  gap: 8px;
  align-content: start;
}

/* Envio automático: um cartão por destino. O cartão inteiro é o botão que
   abre a sub-tela de detalhe; o Testar fica por cima dele (z-index). */
#results-pane-delivery .delivery-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 12px;
  padding: 9px 12px;
  border: 1px solid var(--ns-border);
  border-radius: 12px;
  background: var(--ns-panel);
}

#results-pane-delivery .delivery-card:hover {
  border-color: color-mix(in srgb, var(--ns-accent) 45%, var(--ns-border));
}

/* LeadPronto fica no topo mesmo desconectado. */
#results-pane-delivery .delivery-card.is-featured {
  border-color: color-mix(in srgb, var(--ns-accent) 60%, var(--ns-border));
  background: color-mix(in srgb, var(--ns-accent) 10%, var(--ns-panel));
}

#results-pane-delivery .delivery-card-open {
  display: grid;
  gap: 4px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

#results-pane-delivery .delivery-card-open::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 11px;
}

#results-pane-delivery .delivery-card-open:focus-visible {
  outline: 2px solid var(--ns-accent);
  outline-offset: 3px;
  border-radius: 8px;
}

#results-pane-delivery .delivery-card-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#results-pane-delivery .delivery-card-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  min-width: 0;
  flex: 1 1 auto;
}

#results-pane-delivery .delivery-card-name .pro-badge {
  margin-left: 0;
}

#results-pane-delivery .delivery-card-title {
  font-size: 0.92rem;
  font-weight: 700;
}

#results-pane-delivery .delivery-card-tag {
  padding: 1px 7px;
  border: 1px solid color-mix(in srgb, var(--ns-accent) 45%, var(--ns-border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--ns-accent) 18%, var(--ns-panel));
  color: var(--ns-accent-dark);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

/* Subtítulo discreto do cartão (Webhook): não compete com a etiqueta do LeadPronto. */
#results-pane-delivery .delivery-card-sub {
  flex-basis: 100%;
  color: var(--ns-muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

/* Receitas prontas no detalhe do Webhook: três links para a página de receitas. */
.webhook-recipes {
  display: grid;
  gap: 6px;
  margin: 4px 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--ns-border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--ns-accent) 5%, var(--ns-panel));
}

.webhook-recipes .fixed-hint {
  margin: 0;
}

.webhook-recipes-title {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
}

.webhook-recipes-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px;
}

.webhook-recipe {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--ns-border);
  border-radius: 8px;
  background: var(--ns-panel);
  color: inherit;
  text-decoration: none;
}

.webhook-recipe:hover {
  border-color: color-mix(in srgb, var(--ns-accent) 45%, var(--ns-border));
}

.webhook-recipe:focus-visible {
  outline: 2px solid var(--ns-accent);
  outline-offset: 2px;
}

.webhook-recipe-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ns-accent-dark, var(--ns-accent));
}

.webhook-recipe-hint {
  font-size: 0.74rem;
  color: var(--ns-muted);
}

#results-pane-delivery .delivery-card-chev {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--ns-muted);
}

#results-pane-delivery .delivery-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  min-width: 0;
}

#results-pane-delivery .delivery-card-level {
  padding: 1px 7px;
  border: 1px solid var(--ns-border);
  border-radius: 999px;
  color: var(--ns-muted);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

#results-pane-delivery .delivery-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 7px;
  border: 1px solid var(--ns-border);
  border-radius: 999px;
  color: var(--ns-muted);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

#results-pane-delivery .delivery-state::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

#results-pane-delivery .delivery-state.is-on {
  border-color: color-mix(in srgb, var(--ns-success) 45%, var(--ns-border));
  background: color-mix(in srgb, var(--ns-success) 14%, transparent);
  color: var(--ns-success-ink);
}

#results-pane-delivery .delivery-state.is-fail {
  border-color: color-mix(in srgb, var(--ns-danger) 45%, var(--ns-border));
  background: var(--ns-danger-bg);
  color: var(--ns-danger);
}

#results-pane-delivery .delivery-card-delivery {
  flex: 1 1 160px;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--ns-muted);
  font-size: 0.75rem;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#results-pane-delivery .delivery-card-status {
  margin: 0;
  color: var(--ns-muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

#results-pane-delivery .delivery-card-status.is-error {
  color: var(--ns-danger);
  font-weight: 650;
}

#results-pane-delivery .delivery-card-level:empty,
#results-pane-delivery .delivery-card-delivery:empty,
#results-pane-delivery .delivery-card-status:empty {
  display: none;
}

#results-pane-delivery .delivery-card-test {
  position: relative;
  z-index: 1;
}

/* Sub-tela de detalhe: uma seção por vez, com Voltar no lugar das seções empilhadas. */
#results-pane-delivery .delivery-detail {
  display: grid;
  gap: 10px;
  align-content: start;
}

#results-pane-delivery .delivery-back {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

#results-pane-delivery .delivery-list[hidden],
#results-pane-delivery .delivery-detail[hidden],
#results-pane-delivery .leads-webhook[hidden] {
  display: none;
}

#results-pane-delivery .delivery-detail .leads-webhook {
  border-top: 0;
  padding-top: 0;
}

/* No celular o detalhe cobre o diálogo inteiro (cartão → tela cheia). */
@media (max-width: 720px), (pointer: coarse) {
  #results-pane-delivery .delivery-card-delivery {
    flex-basis: 100%;
  }

  #results-pane-delivery .delivery-card-test {
    min-height: 40px;
  }

  #results-pane-delivery .delivery-detail:not([hidden]) {
    position: absolute;
    inset: 0;
    z-index: 4;
    box-sizing: border-box;
    padding: 14px;
    overflow: auto;
    overscroll-behavior: contain;
    border-radius: 12px;
    background: var(--ns-panel);
  }

  #results-pane-delivery .delivery-back {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--ns-panel);
  }
}

.analytics-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.analytics-tour {
  margin: 0;
  min-width: 0;
  font-weight: 650;
  color: var(--ns-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-range {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--ns-border);
  border-radius: 999px;
  background: var(--ns-input-bg);
}

.analytics-range-btn {
  border: 0;
  background: transparent;
  color: var(--ns-muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.analytics-range-btn.is-active {
  background: var(--ns-accent);
  color: #fff;
}

.analytics-status,
.analytics-empty p,
.analytics-split,
.analytics-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ns-muted);
}

.analytics-status:empty,
.analytics-status[hidden],
.analytics-empty[hidden],
.analytics-body[hidden] {
  display: none;
}

.analytics-empty {
  padding: 28px 12px;
  text-align: center;
  border: 1px dashed var(--ns-border);
  border-radius: 10px;
}

.analytics-body {
  display: grid;
  gap: 12px;
}

.analytics-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.analytics-card {
  display: grid;
  gap: 2px;
  align-content: start;
  padding: 10px 12px;
  border: 1px solid var(--ns-border);
  border-radius: 10px;
  background: var(--ns-input-bg);
  min-width: 0;
}

.analytics-card-label {
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--ns-muted);
}

.analytics-card-value {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--ns-ink);
  line-height: 1.2;
}

.analytics-card-sub {
  font-size: 0.72rem;
  color: var(--ns-muted);
}

.analytics-chart {
  display: grid;
  gap: 6px;
}

.analytics-svg {
  width: 100%;
  height: 120px;
  display: block;
}

.analytics-axis {
  stroke: var(--ns-border);
  stroke-width: 1;
}

.analytics-line-views {
  stroke: var(--ns-accent);
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
}

.analytics-line-done {
  stroke: #2f9e6b;
  stroke-width: 2;
  stroke-dasharray: 5 4;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
}

.analytics-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.75rem;
  color: var(--ns-muted);
}

.analytics-legend-views::before,
.analytics-legend-done::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 0;
  margin-right: 6px;
  vertical-align: middle;
  border-top: 2.5px solid var(--ns-accent);
}

.analytics-legend-done::before {
  border-top: 2px dashed #2f9e6b;
}

.analytics-legend-range {
  margin-left: auto;
}

.analytics-h {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: var(--ns-ink);
}

.analytics-steps {
  display: grid;
  border: 1px solid var(--ns-border);
  border-radius: 10px;
  overflow: hidden;
}

.analytics-step {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) minmax(56px, 0.7fr) minmax(90px, 1.2fr) minmax(70px, 0.8fr);
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
  font-size: 0.82rem;
  border-top: 1px solid var(--ns-border);
}

.analytics-step-head {
  border-top: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ns-muted);
  background: color-mix(in srgb, var(--ns-hover) 70%, transparent);
}

.analytics-step.is-removed {
  color: var(--ns-muted);
  font-style: italic;
}

.analytics-step-name {
  display: flex;
  gap: 8px;
  min-width: 0;
}

.analytics-step-name b {
  flex: 0 0 auto;
  min-width: 18px;
  color: var(--ns-muted);
}

.analytics-step-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-num {
  font-variant-numeric: tabular-nums;
}

.analytics-drop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}

.analytics-drop-bar {
  display: block;
  height: 8px;
  min-width: 0;
  max-width: 70%;
  border-radius: 4px;
  background: color-mix(in srgb, var(--ns-danger, #d14343) 70%, transparent);
}

.analytics-sources {
  display: grid;
  gap: 6px;
}

.analytics-source {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) 48px;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
}

.analytics-source-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-source-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--ns-input-bg);
  overflow: hidden;
}

.analytics-source-bar i {
  display: block;
  height: 100%;
  background: var(--ns-accent);
  border-radius: 4px;
}

.analytics-actions {
  justify-content: flex-start;
}

.analytics-preview-link {
  font-size: 0.8rem;
  color: var(--ns-accent);
}

.analytics-preview-link[hidden] {
  display: none;
}

@media (max-width: 640px) {
.analytics-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  
}
.analytics-step {
    grid-template-columns: minmax(0, 1.4fr) 64px minmax(58px, 1fr) 56px;
    gap: 6px;
    padding: 7px 8px;
    font-size: 0.76rem;
  
}
.analytics-step-head {
    font-size: 0.6rem;
    letter-spacing: 0;
  
}
.analytics-range-btn {
    padding: 5px 8px;
  
}
}

/* Otimizar projeto: tamanho discreto no menu e no cartão, modal com antes/depois */
.file-size-tag {
  margin-left: auto;
  padding-left: 12px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ns-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.file-size-tag:empty {
  display: none;
}

.project-card-dots .project-card-size {
  margin-left: auto;
  font-size: 0.68rem;
  line-height: 10px;
  color: var(--ns-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.project-card-actions .project-card-optimize {
  flex: none;
  width: 26px;
  padding: 0;
  margin-left: auto;
}

.optimize-dialog {
  width: min(420px, calc(100vw - 32px));
}

.optimize-name {
  margin: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.optimize-progress {
  width: 100%;
  height: 6px;
  accent-color: var(--ns-accent);
}

.optimize-progress[hidden] {
  display: none;
}

.optimize-status {
  margin: 0;
  min-height: 1.3em;
  font-size: 0.85rem;
  color: var(--ns-muted);
}

.optimize-sizes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
}

.optimize-sizes[hidden] {
  display: none;
}

.optimize-sizes > div {
  padding: 10px 12px;
  border: 1px solid var(--ns-border);
  border-radius: 10px;
  background: var(--ns-input-bg);
}

.optimize-sizes dt {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ns-muted);
}

.optimize-sizes dd {
  margin: 2px 0 0;
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Chaves de API / MCP */
dialog.api-keys-modal {
  width: min(720px, calc(100vw - 24px));
  max-width: 720px;
  max-height: min(880px, calc(100dvh - 16px));
  margin: auto;
  overflow: auto;
}

.api-keys-lead {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ns-muted);
}

.api-keys-section {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--ns-border);
}

.api-keys-section h4 {
  margin: 0;
  font-size: 0.9rem;
}

.api-keys-upsell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--ns-accent) 10%, transparent);
}

.api-keys-upsell p {
  margin: 0;
  font-size: 0.88rem;
}

.api-keys-field {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 0.85rem;
}

.api-keys-field legend {
  padding: 0;
  margin-bottom: 4px;
}

.api-key-scopes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

#api-key-scopes .api-key-scope {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin: 0;
  text-align: left;
}

#api-key-scopes .api-key-scope input {
  width: auto;
  margin: 0;
}

.api-key-scope code,
.api-keys-last4,
.api-recent-row code {
  font-size: 0.72rem;
  color: var(--ns-muted);
}

.api-key-fresh {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--ns-accent) 55%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--ns-accent) 8%, transparent);
}

.api-key-fresh-title {
  margin: 0;
  font-weight: 700;
  font-size: 0.88rem;
}

.api-key-fresh-row {
  display: flex;
  gap: 8px;
}

.api-key-fresh-row input {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
}

.api-keys-list {
  max-height: 220px;
}

.api-keys-row {
  display: grid;
  gap: 2px;
  padding: 8px 12px;
  border: 1px solid var(--ns-border);
  border-radius: 10px;
  font-size: 0.85rem;
}

.api-keys-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.api-keys-row-head strong {
  overflow-wrap: anywhere;
}

.api-keys-revoke {
  margin-left: auto;
}

.api-keys-revoke:hover {
  color: var(--ns-danger);
}

.api-keys-badge.is-off {
  font-size: 0.68rem;
  padding: 1px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ns-danger) 14%, transparent);
  color: var(--ns-danger);
}

.api-keys-meta,
.api-keys-empty {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ns-muted);
}

.api-recent-list {
  display: grid;
  gap: 2px;
  max-height: 180px;
  overflow: auto;
  font-size: 0.78rem;
}

.api-recent-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.4fr) auto;
  gap: 10px;
  align-items: baseline;
  color: var(--ns-muted);
}

.api-recent-client {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-recent-status.is-error {
  color: var(--ns-danger);
}

/* "criado por agente": discreto, só para saber a origem do tour */
.topbar-agent-tag,
.agent-tag {
  flex: none;
  align-self: center;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
  opacity: 0.72;
  white-space: nowrap;
}

.topbar-agent-tag {
  color: var(--ns-topbar-muted);
}

.agent-tag {
  display: inline-block;
  margin-left: 4px;
  line-height: 1.3;
  color: var(--ns-muted);
}

.topbar-agent-tag[hidden],
.agent-tag[hidden] {
  display: none;
}

.project-card-dots .agent-tag {
  line-height: 10px;
  padding: 2px 6px;
  font-size: 0.62rem;
}

.theme-contrast-warn {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #b45309;
  background: #fffbeb;
  color: #78350f;
  font-size: 0.8rem;
  line-height: 1.35;
}

.theme-contrast-warn[hidden] {
  display: none;
}

/* ---- Texto alternativo discreto (chip "ALT" na imagem, como Canva/Notion) ---- */
.alt-chip {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.62);
  color: #ffffff;
  font: 700 0.68rem/1 var(--ns-font-mono, ui-monospace, monospace);
  letter-spacing: 0.06em;
  cursor: pointer;
  opacity: 0.72;
  transition: opacity 0.15s ease;
}

.alt-chip[hidden],
.alt-pop[hidden] {
  display: none !important;
}

.canvas-frame:hover .alt-chip,
.alt-chip:focus-visible,
.alt-chip[aria-expanded="true"] {
  opacity: 1;
}

.alt-chip:focus-visible {
  outline: 2px solid #111111;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px #ffffff;
}

.alt-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
  background: transparent;
}

.alt-chip[data-state="set"] .alt-chip-dot {
  background: #34d399;
  border-color: #34d399;
}

.alt-chip[data-state="decorative"] .alt-chip-dot {
  background: #ffffff;
}

.is-presenting .alt-chip,
.is-presenting .alt-pop {
  display: none !important;
}

.alt-pop {
  position: fixed;
  z-index: 1000;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--ns-border, #e4e4e7);
  border-radius: 10px;
  background: var(--ns-surface, #ffffff);
  color: var(--ns-ink, #18181b);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  font-size: 0.82rem;
}

.alt-pop-field {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

.alt-pop-field textarea {
  width: 100%;
  resize: vertical;
  font: inherit;
  font-weight: 400;
}

.alt-pop-hint {
  margin: 0;
  color: var(--ns-muted, #52525b);
  font-size: 0.75rem;
  line-height: 1.35;
}

.alt-pop-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
}

.theme-fonts { display: grid; grid-template-columns: 1fr; gap: 4px; 
}

.theme-font-option > span { font-family: inherit !important; 
}

.theme-font-option { display: flex !important; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--ns-border, #d0d5dd); border-radius: 8px; cursor: pointer; font-size: 0.85rem; 
}

.theme-font-option:has(input:checked) { border-color: var(--ns-accent, #2563eb); box-shadow: inset 0 0 0 1px var(--ns-accent, #2563eb); 
}

.theme-font-option .theme-font-sample { margin-left: auto; font-size: 1.05rem; font-weight: 700; 
}

/* Idiomas do tour (PRD multi-idioma) */
.edit-lang { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted, #8a8f98); margin-right: 6px; 
}

.edit-lang select { font-size: 12px; padding: 4px 6px; max-width: 170px; 
}

.ml-modal { width: min(720px, 96vw); 
}

.ml-dialog { display: flex; flex-direction: column; gap: 12px; 
}

.ml-list { display: flex; flex-direction: column; gap: 6px; 
}

.ml-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border, rgba(127,127,127,.25)); border-radius: 10px; 
}

.ml-row.ml-add,
.ml-row.ml-source { border-style: dashed; 
}

.ml-lang { font-weight: 600; min-width: 150px; 
}

.ml-voice { min-width: 120px; 
}

.ml-count { font-size: 12px; color: #16a34a; margin-left: auto; 
}

.ml-count.is-pending { color: #d97706; 
}

.ml-actions { display: flex; flex-wrap: wrap; gap: 8px; 
}

.ml-style label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; 
}

.tg-modal { width: min(1200px, 98vw); max-height: 94vh; 
}

.tg-dialog { display: flex; flex-direction: column; gap: 10px; max-height: 90vh; 
}

.tg-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; 
}

.tg-bar input[type="search"] { min-width: 160px; 
}

.tg-scroll { overflow: auto; flex: 1; min-height: 200px; border: 1px solid var(--border, rgba(127,127,127,.25)); border-radius: 10px; 
}

.tg-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; 
}

.tg-table th,
.tg-table td { vertical-align: top; padding: 8px; border-bottom: 1px solid var(--border, rgba(127,127,127,.2)); text-align: left; min-width: 260px; 
}

.tg-table thead th { position: sticky; top: 0; background: var(--panel, #fff); z-index: 1; 
}

.tg-src { font-weight: 400; color: var(--muted, #555); 
}

.tg-row-title { font-weight: 700; color: inherit; margin-bottom: 4px; 
}

.tg-src-field { display: flex; flex-direction: column; margin-bottom: 6px; 
}

.tg-field-label { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; opacity: .7; 
}

.tg-field { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; 
}

.tg-field-head { display: flex; justify-content: space-between; gap: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; opacity: .85; 
}

.tg-input { width: 100%; font: inherit; 
}

.tg-status { font-size: 11px; text-transform: none; letter-spacing: 0; padding: 1px 6px; border-radius: 999px; background: rgba(127,127,127,.18); 
}

.tg-status.is-reviewed { background: rgba(22,163,74,.15); color: #15803d; 
}

.tg-status.is-stale { background: rgba(217,119,6,.15); color: #b45309; 
}

.tg-status.is-missing { background: rgba(220,38,38,.13); color: #b91c1c; 
}

.tg-consent-warn { font-size: 12px; color: #b45309; 
}

.tg-cell-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; 
}

.tg-audio { font-size: 11px; opacity: .8; 
}

dialog.studio-modal.tg-modal { width: min(1200px, 98vw); max-width: 98vw; 
}

dialog.studio-modal.ml-modal { width: min(720px, 96vw); max-width: 96vw; 
}

.tg-dialog .studio-modal-body,
.tg-dialog { width: 100%; max-width: none; 
}

/* Idiomas do tour + revisão: mesma tipografia e campos escuros dos demais diálogos */
.ml-dialog,
.tg-dialog { font-size: 0.8125rem; 
}

.ml-dialog .account-dialog-head h3,
.tg-dialog .account-dialog-head h3 { font-size: 1.02rem; 
}

.ml-dialog select,
.ml-dialog textarea,
.ml-dialog input[type="text"],
.tg-bar select,
.tg-bar input[type="search"],
.tg-input {
  font: inherit; font-size: 0.8125rem; font-weight: 400; line-height: 1.35;
  color: var(--ns-ink); background: var(--ns-input-bg);
  border: 1px solid var(--ns-border); border-radius: 7px; padding: 6px 8px;
}

.ml-dialog select,
.tg-bar select,
.tg-bar input[type="search"] { min-height: 32px; box-sizing: border-box; color-scheme: light dark; 
}

.ml-dialog textarea { width: 100%; box-sizing: border-box; resize: vertical; 
}

.ml-row { padding: 8px 12px; gap: 8px 10px; 
}

.ml-lang { font-size: 0.875rem; min-width: 120px; 
}

.ml-row.ml-source .ml-lang { min-width: 0; 
}

.ml-row.ml-source select { margin-left: auto; 
}

.ml-row.ml-add select { flex: 1 1 200px; max-width: 280px; 
}

.ml-row.ml-add .btn { min-height: 32px; 
}

.ml-style label { font-size: 0.78rem; font-weight: 600; color: var(--ns-muted); 
}

.ml-dialog > .props-meta { margin: 0; font-size: 0.75rem; 
}

.tg-table { font-size: 0.8125rem; 
}

.tg-table thead th { background: var(--ns-panel); color: var(--ns-muted); font-size: 0.75rem; font-weight: 600; 
}

.tg-src { color: var(--ns-ink); opacity: .8; 
}

@media (max-width: 560px) {
.ml-lang { min-width: 0; flex: 1 1 100%; 
}
.ml-row.ml-source select { margin-left: 0; 
}
.ml-row.ml-add select { max-width: none; 
}
.ml-count { margin-left: 0; 
}
}

@media (hover: none) and (pointer: coarse) and (max-width: 900px),
  (hover: none) and (pointer: coarse) and (max-height: 500px) {
body.is-compact-touch .topbar {
    flex-wrap: nowrap;
    gap: 4px;
    min-height: 52px;
    padding: 4px 6px;
    padding-top: calc(4px + env(safe-area-inset-top, 0px));
    padding-left: calc(6px + env(safe-area-inset-left, 0px));
    padding-right: calc(6px + env(safe-area-inset-right, 0px));
  
}
body.is-compact-touch .topbar-brand { flex: 1 1 auto; min-width: 0; gap: 4px; 
}
body.is-compact-touch .logo-brand .logo-full { display: none; 
}
body.is-compact-touch .logo-brand .logo-mark { display: block; width: 26px; height: 26px; 
}
body.is-compact-touch .topbar-nav { flex: 1 1 auto; min-width: 0; gap: 2px; 
}
body.is-compact-touch #file-panel,
  body.is-compact-touch .topbar-agent-tag { display: none; 
}
body.is-compact-touch .topbar-project {
    max-width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0 4px;
    font-size: 0.875rem;
  
}
body.is-compact-touch .topbar-tools { flex: none; gap: 4px; margin-left: 0; 
}
body.is-compact-touch .topbar-actions { gap: 4px; flex-wrap: nowrap; 
}
body.is-compact-touch .edit-lang { margin: 0; gap: 0; 
}
body.is-compact-touch .edit-lang > span { display: none; 
}
body.is-compact-touch .edit-lang select {
    width: 64px;
    max-width: 64px;
    min-height: 44px;
    font-size: 12px;
    padding: 0 4px;
    text-overflow: ellipsis;
  
}
body.is-compact-touch #btn-account-signin { display: none; 
}
body.is-compact-touch .compact-only:not([hidden]) { display: flex; 
}
body:not(.is-compact-touch) .compact-only { display: none !important; 
}
/* ⚙ do cabeçalho = "Ajustes" da barra inferior (mesmo #prefs-panel): no celular fica só o Ajustes.
     Resultados sai do cabeçalho e fica em Publicar, na barra de baixo (#mobile-publish). */
body.is-compact-touch #btn-prefs,
  body.is-compact-touch #btn-results { display: none !important; 
}
body.is-compact-touch .logo-brand { flex: none; 
}
/* conta: mesmo botão 44px dos demais (deslogado com ícone, logado com avatar), centrado na linha */
body.is-compact-touch .account-slot,
  body.is-compact-touch .account-chip { display: flex; align-items: center; 
}
body.is-compact-touch .account-chip[hidden] { display: none; 
}
body.is-compact-touch .account-chip-toggle {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border: 1px solid color-mix(in srgb, var(--ns-topbar-muted) 45%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--ns-topbar-muted) 16%, var(--ns-topbar));
    color: var(--ns-button-text);
  
}
body.is-compact-touch .account-chip-toggle .account-avatar { width: 30px; height: 30px; border-radius: 7px; 
}
/* Banner da extensão: no celular não dá para instalar; vira uma linha com "não mostrar" */
body.is-compact-touch .ext-banner {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 4px 6px 4px 12px;
    font-size: 12px;
  
}
body.is-compact-touch .ext-banner p { flex: 1 1 auto; 
}
body.is-compact-touch .ext-banner-actions a { display: none; 
}
body.is-compact-touch .ext-banner-actions .btn { min-height: 44px; font-size: 12px; 
}
/* Diálogos: folha inferior de largura total */
body.is-compact-touch dialog.studio-modal[open],
  body.is-compact-touch dialog.image-modal[open] {
    position: fixed;
    inset: auto 0 0 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: min(92dvh, calc(100dvh - 8px - env(safe-area-inset-top, 0px))) !important;
    border-radius: 16px 16px 0 0 !important;
    overflow: auto;
    overscroll-behavior: contain;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-sizing: border-box;
  
}
body.is-compact-touch dialog.studio-modal[open]::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    margin: 8px auto 0;
    border-radius: 2px;
    background: color-mix(in srgb, var(--ns-ink) 30%, transparent);
  
}
/* Menus e painéis do topo: também como folha inferior */
body.is-compact-touch .topbar details[open] > .more-panel-body,
  body.is-compact-touch .topbar details[open] > .export-panel-body,
  body.is-compact-touch .topbar details[open] > .menu-panel-body,
  body.is-compact-touch .topbar details[open] > .account-chip-menu {
    position: fixed;
    inset: auto 0 0 0;
    top: auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    max-height: 85dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 16px 16px 0 0;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    z-index: 300;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.45);
  
}
body.is-compact-touch .more-flyout > .more-flyout-body { position: static; max-height: none; width: auto; 
}
/* Alvos de toque e fontes mínimas */
body.is-compact-touch .more-item,
  body.is-compact-touch .more-flyout > summary,
  body.is-compact-touch .more-section > summary,
  body.is-compact-touch .settings-fold > summary,
  body.is-compact-touch .export-option,
  body.is-compact-touch dialog .btn,
  body.is-compact-touch .btn-sm,
  body.is-compact-touch select,
  body.is-compact-touch .split-btn > *,
  body.is-compact-touch .topbar details[open] summary,
  body.is-compact-touch .topbar details[open] .btn { min-height: 44px; 
}
body.is-compact-touch .export-quality-row { flex-wrap: wrap; 
}
body.is-compact-touch dialog input[type="checkbox"] { width: 22px; height: 22px; 
}
body.is-compact-touch .export-quality-row select { flex: 1 1 140px; 
}
body.is-compact-touch .appearance-opt,
  body.is-compact-touch .btn-icon,
  body.is-compact-touch dialog .btn-icon { min-width: 44px; min-height: 44px; 
}
body.is-compact-touch .theme-swatch,
  body.is-compact-touch .theme-preset { min-height: 44px; 
}
body.is-compact-touch input[type="text"],
  body.is-compact-touch input[type="search"],
  body.is-compact-touch input[type="email"],
  body.is-compact-touch input[type="tel"],
  body.is-compact-touch input[type="url"],
  body.is-compact-touch input[type="number"],
  body.is-compact-touch input[type="password"],
  body.is-compact-touch input:not([type]),
  body.is-compact-touch textarea,
  body.is-compact-touch dialog select { font-size: 16px; min-height: 44px; 
}
body.is-compact-touch :is(.props-meta, .tg-field-label, .tg-field-head, .tg-status, .tg-audio, .theme-section-label, .pro-badge, .badge, .film-scene-label, .local-save, .more-legal, .file-size-tag, .ml-count) {
    font-size: max(12px, 1em);
  
}
}

/* ───────── Mobile B: barra de ações fixa, folha "Editar passo", filmstrip compacta, deitado ───────── */
.mobile-bar[hidden],
.mobile-sheet-backdrop[hidden] { display: none !important; 
}

.mobile-sheet-head,
.mobile-sheet-audio { display: none; 
}

@media (hover: none) and (pointer: coarse) and (max-width: 900px),
  (hover: none) and (pointer: coarse) and (max-height: 500px) {
body.has-mobile-bar { --mbar-h: 56px; 
}
.mobile-bar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 260;
    display: flex;
    justify-content: space-around;
    gap: 2px;
    padding: 4px calc(4px + env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) calc(4px + env(safe-area-inset-left, 0px));
    background: var(--ns-panel);
    border-top: 1px solid var(--ns-border);
  
}
.mobile-bar-btn {
    flex: 1 1 0;
    min-width: 44px;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ns-ink);
    font-size: 12px;
    line-height: 1.1;
    padding: 2px;
  
}
.mobile-bar-btn svg { width: 22px; height: 22px; 
}
.mobile-bar-btn span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; 
}
.mobile-bar-btn:disabled { opacity: 0.4; 
}
.mobile-bar-btn[aria-expanded="true"] { background: color-mix(in srgb, var(--ns-accent) 22%, transparent); color: var(--ns-accent); 
}
body.has-mobile-bar .view-editor:not(.is-presenting) {
    padding-bottom: calc(var(--mbar-h) + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  
}
body.has-mobile-bar .view-editor:not(.is-presenting) > * { min-width: 0; 
}
.mobile-sheet-audio .btn-ai-spark { width: 18px; height: 18px; 
}
body.has-mobile-bar .toast-host,
  body.has-mobile-bar .toast,
  body.has-mobile-bar #toast { bottom: calc(var(--mbar-h) + 12px + env(safe-area-inset-bottom, 0px)) !important; 
}
/* A barra de cima só tinha desfazer/refazer: foi para a barra de baixo */
body.has-mobile-bar .view-editor:not(.is-presenting) .canvas-toolbar { display: none; 
}
/* Filmstrip compacta: faixa horizontal de miniaturas; ações no ⋯ do cartão */
body.has-mobile-bar .view-editor:not(.is-presenting) #filmstrip-panel { max-height: none; 
}
body.has-mobile-bar .filmstrip-header,
  body.has-mobile-bar .filmstrip-footer { display: none; 
}
/* why: no celular o aviso "Sincronizado" tomava uma faixa inteira da filmstrip sem dizer nada
   de útil. Em repouso (sincronizado) e durante a sincronização automática a faixa some; ela
   só aparece quando precisa de atenção (offline/erro) ou para o aviso de "salvo só neste
   navegador". Os dois avisos nunca aparecem juntos (ver paintLocalSave). */
body.has-mobile-bar .filmstrip-notices:has(> .sync-status[data-phase="synced"]:not([hidden])),
  body.has-mobile-bar .filmstrip-notices:has(> .sync-status[data-phase="syncing"]:not([hidden])) { display: none; 
}
body.has-mobile-bar .filmstrip {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 8px;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
  
}
body.has-mobile-bar .film-scene {
    flex: none;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    align-self: stretch;
    padding: 4px 2px;
    margin: 0;
    max-height: 120px;
    overflow: hidden;
  
}
body.has-mobile-bar .film-scene-label { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
}
body.has-mobile-bar .film-fixed { flex: none; width: 88px; min-height: 64px; scroll-snap-align: start; 
}
body.has-mobile-bar .film-item {
    flex: none;
    width: 104px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 4px;
    scroll-snap-align: start;
  
}
body.has-mobile-bar .film-item img,
  body.has-mobile-bar .film-item .film-thumb-slide { width: 100%; height: 56px; 
}
body.has-mobile-bar .film-meta strong {
    display: block;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  
}
/* why: as setas ← → e o × gastavam uma linha inteira do cartão ativo. Agora só o ⋯ fica
   sobre a miniatura, e o menu (folha de baixo) traz mover, duplicar e excluir. Reordenar
   também dá para fazer segurando o cartão e arrastando (toque longo). */
body.has-mobile-bar .film-item .film-actions {
    position: absolute;
    inset: 0;
    display: block;
    margin: 0;
    pointer-events: none;
  
}
body.has-mobile-bar .film-item .film-action-move,
  body.has-mobile-bar .film-item .film-action-close { display: none; 
}
/* Só o cartão do passo atual mostra o ⋯: a faixa fica limpa como antes, sem três botões por cartão. */
body.has-mobile-bar .film-item:not(.is-active) .film-action-menu { display: none; 
}
body.has-mobile-bar .film-action-menu {
    position: absolute;
    top: 2px;
    right: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: color-mix(in srgb, var(--ns-panel) 74%, transparent);
    color: var(--ns-ink);
    font-size: 1rem;
    line-height: 1;
    pointer-events: auto;
  
}
body.has-mobile-bar .film-item { -webkit-touch-callout: none; 
}
body.has-mobile-bar .film-item.is-touch-dragging {
    opacity: 0.92;
    transform: scale(1.04);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
    z-index: 2;
  
}
body.is-film-dragging,
  body.is-film-dragging .filmstrip { user-select: none; -webkit-user-select: none; 
}
body.is-film-dragging .filmstrip { scroll-snap-type: none; 
}
/* Em pé a faixa rola na horizontal: o marcador de "solta aqui" vira uma barra em pé. */
body.has-mobile-bar .film-item.drop-before::before,
  body.has-mobile-bar .film-item.drop-after::after {
    top: 4px;
    bottom: 4px;
    width: 3px;
    height: auto;
    left: auto;
    right: auto;
  
}
body.has-mobile-bar .film-item.drop-before::before { left: -5px; 
}
body.has-mobile-bar .film-item.drop-after::after { right: -5px; 
}
/* Folha "Editar passo": o próprio painel de propriedades, só texto e narração */
.mobile-sheet-backdrop { position: fixed; inset: 0; z-index: 240; background: rgba(0, 0, 0, 0.45); 
}
body.is-props-sheet .view-editor:not(.is-presenting) #props-panel {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    inset: auto 0 calc(var(--mbar-h) + env(safe-area-inset-bottom, 0px)) 0;
    z-index: 250;
    width: 100%;
    max-height: calc(100dvh - var(--mbar-h) - 60px - env(safe-area-inset-top, 0px));
    border-radius: 16px 16px 0 0;
    border: 1px solid var(--ns-border);
    background: var(--ns-panel);
    box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.35);
    overflow: hidden;
  
}
body.is-props-sheet #props-panel > :not(.mobile-sheet-head):not(.props-body) { display: none !important; 
}
body.is-props-sheet #props-panel .props-body {
    display: block !important;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 14px 14px;
    flex: 1 1 auto;
    min-height: 0;
  
}
body.is-props-sheet #props-panel #prop-type,
  body.is-props-sheet #props-panel .props-section:not([data-sec="texts"]):not([data-sec="narration"]),
  body[data-sheet-sec="texts"] #props-panel [data-sec="narration"],
  body[data-sheet-sec="narration"] #props-panel [data-sec="texts"] { display: none !important; 
}
body.is-props-sheet #props-panel .props-section-head { min-height: 44px; 
}
body.is-props-sheet .mobile-sheet-head {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 8px;
  
}
.mobile-sheet-grab { grid-column: 1 / -1; justify-self: center; width: 40px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--ns-ink) 30%, transparent); 
}
.mobile-sheet-title { font-size: 1rem; 
}
.mobile-sheet-done { min-height: 44px; 
}
body.is-props-sheet .mobile-sheet-audio:not([hidden]) { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; 
}
.mobile-sheet-audio .btn { min-height: 44px; 
}
.mobile-sheet-audio .mobile-upload-audio { min-width: 44px; 
}
.mobile-sheet-audio .btn[hidden] { display: none; 
}
body.is-props-sheet #props-panel #prop-caption { min-height: 120px; 
}
/* Menu do cartão (⋯) no celular: folha colada na barra de baixo, com linhas de 44px */
.film-context-menu.is-sheet {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: calc(var(--mbar-h, 0px) + 8px + env(safe-area-inset-bottom, 0px));
    min-width: 0;
    max-width: none;
    max-height: 60dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
  
}
.film-context-menu.is-sheet button { min-height: 44px; font-size: 0.95rem; 
}
/* no celular não há teclado: as dicas de atalho só ocupam espaço */
.film-context-menu.is-sheet .film-context-kbd { display: none; 
}
}


@media (hover: none) and (pointer: coarse) and (max-height: 500px) and (orientation: landscape) {
/* Deitado: filmstrip vira coluna estreita à esquerda; barra com rótulos menores */
body.has-mobile-bar { --mbar-h: 48px; 
}
.mobile-bar-btn { flex-direction: row; gap: 6px; min-height: 40px; 
}
body.has-mobile-bar .view-editor:not(.is-presenting) {
    grid-template-columns: 132px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  
}
body.has-mobile-bar .view-editor:not(.is-presenting) #filmstrip-panel {
    grid-row: 1;
    grid-column: 1;
    border-top: 0;
    border-right: 1px solid var(--ns-border);
    min-height: 0;
    overflow: hidden;
  
}
body.has-mobile-bar .view-editor:not(.is-presenting) .canvas-wrap { grid-row: 1; grid-column: 2; 
}
body.has-mobile-bar .filmstrip {
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    height: 100%;
    scroll-snap-type: y proximity;
  
}
body.has-mobile-bar .film-scene { writing-mode: horizontal-tb; transform: none; max-height: none; align-self: stretch; 
}
body.has-mobile-bar .film-item,
  body.has-mobile-bar .film-fixed { width: 100%; 
}
/* Deitado a faixa é uma coluna: o marcador de "solta aqui" volta a ser uma barra deitada. */
body.has-mobile-bar .film-item.drop-before::before,
  body.has-mobile-bar .film-item.drop-after::after {
    left: 4px;
    right: 4px;
    width: auto;
    height: 3px;
    top: auto;
    bottom: auto;
  
}
body.has-mobile-bar .film-item.drop-before::before { top: -5px; 
}
body.has-mobile-bar .film-item.drop-after::after { bottom: -5px; 
}
body.is-props-sheet .view-editor:not(.is-presenting) #props-panel {
    inset: 8px 8px calc(var(--mbar-h) + 4px) auto;
    width: min(420px, 60vw);
    max-height: none;
    border-radius: 16px;
  
}
}

@media (hover: none) and (pointer: coarse) and (max-width: 900px),
  (hover: none) and (pointer: coarse) and (max-height: 500px) {
/* ───────── Mobile: no editor o balão sai de cima da captura, igual ao player compacto ─────────
 * why: o balão flutuante cobria quase toda a imagem no celular. Em pé: captura em cima, balão embaixo.
 * Deitado: captura à esquerda, balão ao lado. O player publicado (body.is-presenting) não muda. */
body.is-compact-touch .view-editor:not(.is-presenting) #canvas-frame:has(#canvas-image:not([hidden])):has(#editor-popover:not([hidden])) {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    background: transparent;
  
}
body.is-compact-touch .view-editor:not(.is-presenting) #canvas-frame:has(#editor-popover:not([hidden])) #canvas-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 44dvh;
    object-fit: contain;
    object-position: left top;
  
}
body.is-compact-touch .view-editor:not(.is-presenting) #canvas-frame #editor-popover:not([hidden]) {
    position: relative;
    left: auto !important;
    top: auto !important;
    width: 100%;
    max-width: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  
}
body.is-compact-touch .view-editor:not(.is-presenting) #editor-popover .editor-popover-arrow { display: none; 
}
}

@media (hover: none) and (pointer: coarse) and (max-height: 500px) and (orientation: landscape) {
/* Deitado: o quadro fica do tamanho da captura (o destaque usa as medidas do quadro) e o balão vai ao lado */
body.is-compact-touch .view-editor:not(.is-presenting) #canvas-frame:has(#canvas-image:not([hidden])):has(#editor-popover:not([hidden])) {
    display: block;
    position: relative;
    width: auto;
    margin-right: calc(min(300px, 40vw) + 8px);
  
}
body.is-compact-touch .view-editor:not(.is-presenting) #canvas-frame:has(#editor-popover:not([hidden])) #canvas-image {
    width: auto;
    max-width: 100%;
    max-height: calc(100dvh - 52px - var(--mbar-h, 48px) - 24px);
  
}
body.is-compact-touch .view-editor:not(.is-presenting) #canvas-frame #editor-popover:not([hidden]) {
    position: absolute;
    left: calc(100% + 8px) !important;
    top: 0 !important;
    width: min(300px, 40vw);
    max-height: calc(100dvh - 52px - var(--mbar-h, 48px) - 24px);
    overflow: auto;
  
}
}

/* Team: escolha de plano no diálogo de assinatura */
/* diálogo de assinatura compacto: plano e preços no topo, lista curta, CTA + "Já sou assinante" sempre visíveis */
dialog.upgrade-modal { width: min(560px, calc(100vw - 24px)); max-width: 560px; 
}

.upgrade-scroll { gap: 12px; 
}

.paywall-hero { position: relative; gap: 4px; padding: 14px 18px 12px; 
}

.paywall-hero-top { justify-content: flex-start; 
}

.paywall-hero-top .btn-icon { position: absolute; top: 8px; right: 10px; min-width: 44px; min-height: 44px; 
}

.paywall-hero h3 { font-size: 1.3rem; padding-right: 48px; 
}

.paywall-lead { font-size: 0.85rem; line-height: 1.35; 
}

.upgrade-tiers,
.upgrade-intervals,
.paywall-benefits { margin-inline: 18px; 
}

.upgrade-tiers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border: 0; margin-block: 0; padding: 0; min-inline-size: 0; 
}

.upgrade-tiers[hidden] { display: none; 
}

.upgrade-tier { position: relative; display: grid; gap: 1px; align-content: center; min-height: 48px; padding: 8px 12px; border: 2px solid var(--ns-border); border-radius: 12px; background: var(--ns-input-bg); color: var(--ns-ink); cursor: pointer; 
}

.upgrade-tier input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; 
}

.upgrade-tier:has(input:checked) { border-color: var(--ns-accent); background: color-mix(in srgb, var(--ns-accent) 14%, var(--ns-panel)); 
}

.upgrade-tier:has(input:focus-visible) { outline: 2px solid color-mix(in srgb, var(--ns-accent) 45%, transparent); outline-offset: 3px; 
}

.upgrade-tier .paywall-interval-name { display: inline-flex; align-items: center; gap: 5px; font-size: 0.92rem; color: var(--ns-ink); 
}

.upgrade-tier .pro-badge-crown { width: 14px; height: 14px; vertical-align: -2px; 
}

.upgrade-interval { min-height: 72px; padding: 10px 12px; 
}

.paywall-price { font-size: 1.25rem; 
}

.paywall-benefits { grid-template-columns: 1fr 1fr; gap: 0 12px; margin-block: 0; 
}

.paywall-benefits li { padding: 4px 2px; font-size: 0.85rem; line-height: 1.3; 
}

.upgrade-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: stretch; 
}

.upgrade-actions .paywall-cta { width: 100%; min-height: 46px; 
}

.upgrade-actions .paywall-login { justify-self: stretch; min-height: 46px; margin: 0; padding: 0 16px; border: 1px solid var(--ns-border); border-radius: 10px; background: var(--ns-input-bg); color: var(--ns-ink); font: inherit; font-size: 0.9rem; font-weight: 650; text-decoration: none; white-space: nowrap; cursor: pointer; 
}

.upgrade-actions .paywall-login:hover,
.upgrade-actions .paywall-login:focus-visible { border-color: var(--ns-accent); color: var(--ns-ink); 
}

.upgrade-footer { gap: 6px; padding: 10px 18px 12px; 
}

@media (max-width: 720px) {
dialog.upgrade-modal { width: calc(100vw - 16px); 
}
.upgrade-scroll { gap: 10px; 
}
.paywall-hero { padding: 10px 14px 8px; 
}
.paywall-hero h3 { font-size: 1.15rem; 
}
.upgrade-tiers,
  .upgrade-intervals,
  .upgrade-tiers { gap: 6px; 
}
.upgrade-tier { padding: 6px 10px; min-height: 48px; 
}
.upgrade-intervals { grid-template-columns: 1fr 1fr; gap: 6px; 
}
.upgrade-interval { min-height: 64px; padding: 8px; 
}
.paywall-price { font-size: 1rem; 
}
.paywall-benefits li { padding: 3px 2px; font-size: 0.8rem; 
}
.upgrade-actions { grid-template-columns: 1fr; gap: 6px; 
}
.upgrade-footer { padding: 8px 14px 10px; 
}
.upgrade-actions .paywall-login { min-height: 44px; 
}
.paywall-legal { font-size: 0.7rem; 
}
}

@media (max-width: 380px) {
.upgrade-tiers { grid-template-columns: 1fr; 
}
.paywall-benefits { grid-template-columns: 1fr; 
}
}

.subscription-seats { display: grid; gap: 6px; margin: 12px 0; padding: 12px; border: 1px solid var(--ns-border); border-radius: 12px; background: var(--ns-input-bg); 
}

.subscription-seats[hidden] { display: none; 
}

.subscription-seats p { margin: 0; 
}

.subscription-seats-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; 
}

.subscription-seats-row label { font-size: 0.85rem; font-weight: 650; 
}

.subscription-seats-row input { width: 72px; min-height: 44px; 
}

.subscription-seats-row .btn { min-height: 44px; 
}

/* Compartilhar em abas (Link / Incorporar / Baixar) */
.export-panel-body.share-card { width: min(420px, 94vw); min-width: 0; padding: 0; gap: 0; max-height: min(78vh, 640px); font-family: var(--ns-font); font-size: 14px; line-height: 1.35; letter-spacing: 0; text-transform: none; 
}

.share-tablist { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px 8px 0; border-bottom: 1px solid var(--ns-border); position: sticky; top: 0; background: var(--ns-panel); z-index: 1; overflow: visible; 
}

.share-tab { flex: 1 1 auto; min-width: min-content; max-width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 6px 8px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--ns-muted); font: 600 13px/1.15 var(--ns-font); letter-spacing: 0; text-transform: none; text-wrap: balance; white-space: normal; cursor: pointer; overflow: visible; 
}

.share-tab[hidden] { display: none; 
}

.share-tab[aria-selected="true"] { color: var(--ns-ink); border-bottom-color: var(--ns-accent); 
}

.share-tab:hover { color: var(--ns-ink); 
}

.share-tab:focus-visible { outline: 2px solid color-mix(in srgb, var(--ns-accent) 55%, transparent); outline-offset: -2px; border-radius: 6px; 
}

.share-pane { display: grid; gap: 4px; padding: 8px; align-content: start; min-width: 0; 
}

.share-kind { display: grid; gap: 6px; margin: 4px 0; padding: 10px 12px; border: 1px solid var(--ns-border); border-radius: 10px; background: color-mix(in srgb, var(--ns-accent) 6%, var(--ns-panel)); min-width: 0; 
}

#share-permanent-card { border-color: color-mix(in srgb, var(--ns-accent) 55%, var(--ns-border)); 
}

.share-kind-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; 
}

.share-kind-head strong { font-size: 0.9rem; color: var(--ns-ink); 
}

.share-recommended { font-size: 0.68rem; font-weight: 700; padding: 2px 6px; border-radius: 999px; background: color-mix(in srgb, var(--ns-accent) 22%, transparent); color: var(--ns-ink); 
}

.share-kind-note { margin: 0; color: var(--ns-muted); font-size: 0.75rem; 
}

.share-kind .share-expiry-note { margin: 0; 
}

.share-kind .export-option { padding: 8px 0; 
}

.share-kind .share-link-actions { border-bottom: 0; margin: 0; padding: 0; 
}

.people-panel { position: relative; 
}

.people-panel[hidden] { display: none; 
}

.people-panel > summary.people-menu { position: relative; width: auto; min-height: 32px; height: 32px; padding: 0 12px; gap: 6px; border-radius: 8px; background: transparent; color: var(--ns-ink); font-weight: 650; 
}

.people-panel[open] > summary.people-menu { background: color-mix(in srgb, var(--ns-accent) 12%, transparent); 
}

.people-avatars { display: inline-flex; align-items: center; 
}

.people-avatars:empty { display: none; 
}

.people-panel-body { width: min(420px, 94vw); padding: 8px; 
}

.share-pane[hidden] { display: none; 
}

.share-pane .embed-code { max-width: 100%; 
}

.share-pane .embed-tabs { flex-wrap: wrap; 
}

.share-team-off { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; 
}

.share-team-lead { margin: 0; color: var(--ns-muted); 
}

.share-team-off[hidden],
.share-team-seats[hidden] { display: none; 
}

.share-team-host { padding: 12px 12px 8px; overflow: visible; 
}

.share-team-host .collab-members-list,
.share-team-host .collab-invites-list { gap: 10px; 
}

.share-team-host .collab-member { flex-wrap: wrap; align-items: center; min-width: 0; 
}

.share-team-host .collab-member-name { flex: 1 1 140px; min-width: 0; overflow-wrap: anywhere; line-height: 1.3; 
}

.share-team-host .collab-member-name small { display: block; overflow-wrap: anywhere; line-height: 1.3; 
}

.share-team-host .collab-role-chip,
.share-team-host .collab-member .btn { flex: none; white-space: nowrap; 
}

.share-team-host .collab-invite-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; margin-top: 12px; 
}

.share-team-host .collab-invite-form h4,
.share-team-host .collab-invite-form label,
.share-team-host .collab-invite-status { grid-column: 1 / -1; 
}

.share-team-host .collab-invite-form input { width: 100%; min-width: 0; 
}

.share-team-host h3 { font-size: 14px; margin: 0 0 8px; font-family: var(--ns-font); letter-spacing: 0; text-transform: none; 
}

.share-team-seats { margin: 4px 16px 12px; 
}

.export-panel-body .share-team-seats {
  width: auto;
  display: inline-flex;
  margin: 4px 16px 12px;
  background: transparent;
  color: var(--ns-link, var(--ns-accent-dark));
  border: 1px solid var(--ns-border);
  text-align: left;
  font-weight: 600;
}

/* hierarquia tipográfica da aba Equipe / Compartilhar */
.share-team-host h3,
.share-team-host h4,
.share-team-host .collab-invite-form h4 {
  color: var(--ns-ink);
  font-weight: 700;
}

.share-team-host .collab-member-name small,
.share-team-lead,
.share-expiry-note,
.embed-lead,
.embed-hint,
.share-cover-note,
.share-brand-text small {
  color: var(--ns-muted);
}

.share-team-host .collab-invite-status {
  font-size: 13px;
  line-height: 1.4;
}

.results-btn { display: inline-flex; align-items: center; gap: 6px; 
}

.capture-btn { display: inline-flex; align-items: center; gap: 6px; }

.results-tablist { position: static; padding: 0; margin: 0; flex-wrap: wrap; 
}

.results-tablist .results-tab { flex: 1 1 auto; padding: 6px 12px; 
}

.results-tab .pro-badge { margin-left: 4px; 
}

body.is-compact-touch dialog.results-modal[open] {
  overflow: hidden;
}

@media (max-width: 760px) {
.results-btn span:not(.pro-badge):not(.pro-badge *) { display: none; 
}
.capture-btn > span { display: none; 
}
}

/* PR5: nome do tour = botão do menu do projeto */
.file-menu .topbar-project { cursor: pointer; max-width: 260px; padding: 0 4px; border: 0; background: transparent; 
}

.file-menu .topbar-project[data-editing="1"] { cursor: text; 
}

.topbar-project:hover { border-color: transparent; background: transparent; 
}

.toolbar .edit-lang,
#btn-redo ~ .edit-lang { margin-left: 8px; margin-right: 0; 
}

.account-anon-ico { display: none; width: 20px; height: 20px; 
}

.account-chip.is-anon .account-avatar { display: none; 
}

.account-chip.is-anon .account-anon-ico { display: inline-block; 
}


.account-chip-menu .account-signed-in[hidden],
.account-chip-menu [hidden] { display: none; 
}

/* PR6: folha inferior do Compartilhar no celular (largura total, alvos de 44px, sem cortar atrás da barra) */
body.is-compact-touch .topbar details[open] > .export-panel-body.share-card {
  width: 100%; left: 0; right: 0; max-height: 85dvh; padding: 0 0 calc(64px + env(safe-area-inset-bottom, 0px));
}

body.is-compact-touch .share-tablist { padding: 0 8px; 
}

body.is-compact-touch .share-tab { min-height: 48px; 
}

body.is-compact-touch .share-pane { padding: 8px 12px; 
}

body.is-compact-touch .results-btn { min-width: 44px; min-height: 44px; 
}

body.is-compact-touch .capture-btn { min-width: 44px; min-height: 44px; 
}

/* Captura: cabeçalho, abas e Salvar ficam fixos; só o miolo da aba rola */
body.is-compact-touch dialog.studio-modal.fixed-modal[open] {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.is-compact-touch .topbar details[open] > .account-chip-menu,
body.is-compact-touch .topbar details[open] > .more-panel-body,
body.is-compact-touch .topbar details[open] > .menu-panel-body { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); 
}

/* PR7: ⚙ e Preview na barra de botões, ao lado de desfazer/refazer e Editando em */
.toolbar-tools-end { display: inline-flex; align-items: center; gap: 8px; margin-left: 8px; 
}

.canvas-toolbar { flex-wrap: wrap; overflow: visible; height: auto; min-height: var(--editor-bar-h); padding-block: 6px; row-gap: 6px; 
}

.canvas-toolbar .toolbar-pos { display: none; 
}

.canvas-toolbar .toolbar-tools-end .split-main,
.canvas-toolbar .toolbar-tools-end .split-caret { background: var(--ns-input-bg); color: var(--ns-ink); border-color: var(--ns-border); 
}

.canvas-toolbar .toolbar-tools-end .split-main:hover,
.canvas-toolbar .toolbar-tools-end .split-caret:hover,
.canvas-toolbar .toolbar-tools-end .preview-panel[open] > .split-caret { background: color-mix(in srgb, var(--ns-accent) 12%, var(--ns-input-bg)); 
}

.canvas-toolbar .toolbar-tools-end #btn-prefs { color: var(--ns-ink); 
}

.canvas-toolbar .toolbar-tools-end #btn-prefs:hover { background: color-mix(in srgb, var(--ns-accent) 12%, transparent); 
}

.canvas-toolbar .toolbar-tools-end .prefs-panel > .more-panel-body,
.canvas-toolbar .toolbar-tools-end .preview-panel > .menu-panel-body { left: 0; right: auto; 
}

.canvas-toolbar .toolbar-tools-end #btn-prefs { background: var(--ns-input-bg); border: 1px solid var(--ns-border); min-height: 32px; width: 32px; padding: 0; 
}

.canvas-toolbar .toolbar-tools-end .split-main { height: 32px; 
}

.lang-picker-native { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; clip-path: inset(50%) !important; 
}

.lang-picker { position: relative; display: inline-flex; vertical-align: middle; 
}

.lang-picker-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 8px; border: 1px solid var(--ns-border); border-radius: 8px; background: var(--ns-input-bg); color: var(--ns-ink); font: 600 13px/1 var(--ns-font); cursor: pointer; 
}

.lang-picker-btn:hover:not(:disabled) { background: var(--ns-hover); 
}

.lang-picker-btn:focus-visible { outline: 2px solid color-mix(in srgb, var(--ns-accent) 60%, transparent); outline-offset: 2px; 
}

.lang-picker-btn:disabled { opacity: .5; cursor: default; 
}

.lang-picker.is-open .lang-picker-btn { border-color: var(--ns-accent); 
}

.lang-picker-caret { width: 14px; height: 14px; color: var(--ns-muted); transition: transform .15s ease; 
}

.lang-picker.is-open .lang-picker-caret { transform: rotate(180deg); 
}

.lang-picker-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; 
}

.lang-picker-list { position: absolute; top: calc(100% + 6px); left: 0; z-index: 400; min-width: 180px; max-height: min(320px, 60vh); overflow: auto; margin: 0; padding: 6px; list-style: none; border: 1px solid var(--ns-border); border-radius: 12px; background: var(--ns-panel); color: var(--ns-ink); box-shadow: 0 12px 32px rgba(0, 0, 0, .18); 
}

.lang-picker[data-align="end"] .lang-picker-list { left: auto; right: 0; 
}

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

.lang-picker-list:focus { outline: none; 
}

.lang-picker-list:focus-visible { box-shadow: 0 0 0 2px color-mix(in srgb, var(--ns-accent) 55%, transparent), 0 12px 32px rgba(0, 0, 0, .18); 
}

.lang-picker-opt { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: 8px; font: 500 14px/1.2 var(--ns-font); cursor: pointer; white-space: nowrap; 
}

.lang-picker-opt.is-active { background: var(--ns-hover); 
}

.lang-picker-opt[aria-selected="true"] { font-weight: 700; 
}

.lang-picker-opt-name { flex: 1 1 auto; 
}

.lang-picker-check { width: 16px; height: 16px; color: var(--ns-accent); 
}

body.is-compact-touch .lang-picker-btn,
body.is-compact-touch .lang-picker-opt { min-height: 44px; 
}

@media (prefers-reduced-motion: reduce) {
.lang-picker-caret { transition: none; 
}
}

.more-locale.locale-select { display: flex; align-items: center; justify-content: space-between; gap: 8px; 
}

.more-locale .more-pref-label { font-size: 0.8125rem; 
}

.embed-lang-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; 
}

.embed-lang-row[hidden] { display: none; 
}

.edit-lang .lang-picker-btn { min-height: 30px; padding: 0 6px; 
}

/* Assinante Pro/Team (ou convidado em sessão do Team): sem coroas nem selos Pro; o diálogo de upgrade mantém os dele */
body.gf-subscriber .pro-badge:not(#modal-upgrade .pro-badge),
body.gf-subscriber .pro-crown { display: none !important; 
}

/* GUI-32: itens só do celular (Entrar e o aviso de Resultados no ☰) ficam fora do desktop */
body:not(.is-compact-touch) .compact-only { display: none !important; }

/* GUI-32: aviso "mudou de lugar" nos menus antigos (some depois de duas versões) */
.more-item-moved {
  color: var(--ns-muted);
  font-size: 0.82rem;
  line-height: 1.3;
  white-space: normal;
  text-align: left;
}
.more-item-moved:hover,
.more-item-moved:focus-visible { color: var(--ns-accent); }
.more-moved-group[hidden],
.more-item-moved[hidden] { display: none !important; }

/* GUI-32: Publicar no celular (Captura, Compartilhar e Resultados numa folha acima da barra de baixo) */
.mobile-publish[hidden] { display: none !important; }
.mobile-bar-btn { position: relative; }
.mobile-bar-dot {
  position: absolute;
  top: 6px;
  right: calc(50% - 18px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ns-accent);
}
.mobile-bar-dot[hidden] { display: none; }
.mobile-publish {
  position: fixed;
  inset: auto 0 calc(var(--mbar-h, 56px) + env(safe-area-inset-bottom, 0px)) 0;
  z-index: 259;
  display: grid;
  gap: 4px;
  padding: 12px 12px 8px;
  background: var(--ns-panel);
  border-top: 1px solid var(--ns-border);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.45);
}
.mobile-publish-title { margin: 0 4px 4px; font-weight: 700; font-size: 0.95rem; }
.mobile-publish .more-item { position: relative; min-height: 56px; align-items: center; gap: 12px; }
.mobile-publish .more-item[hidden] { display: none; }
.mobile-publish .more-item .mobile-bar-dot { top: 12px; right: auto; left: 30px; }
.mobile-publish-text { display: grid; gap: 2px; text-align: left; flex: 1 1 auto; min-width: 0; }
.mobile-publish-text small { color: var(--ns-muted); font-size: 0.8rem; }
/* com a barra de baixo, Captura e Compartilhar saem do cabeçalho: abrem por Publicar */
body.has-mobile-bar #btn-capture,
body.has-mobile-bar .topbar .export-panel > summary { display: none !important; }

@keyframes boot-progress-slide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

@keyframes sync-pulse {
  50% {
    opacity: 0.35;
  }
}

@keyframes ai-sparkle {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
    opacity: 0.75;
    filter: drop-shadow(0 0 0 transparent);
  }
  40% {
    transform: rotate(-12deg) scale(1.12);
    opacity: 1;
    filter: drop-shadow(0 0 6px color-mix(in srgb, var(--ns-accent) 55%, transparent));
  }
  70% {
    transform: rotate(10deg) scale(1.05);
    opacity: 0.9;
  }
}

@keyframes ai-progress {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@keyframes ai-field-shimmer {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

@keyframes ai-audio-pulse {
  0%,
  100% {
    outline-color: color-mix(in srgb, var(--ns-accent) 30%, transparent);
  }
  50% {
    outline-color: color-mix(in srgb, var(--ns-accent) 70%, transparent);
  }
}

/* Mídia do passo (Imagem | Vídeo) e vídeo por link (YouTube/Vimeo) no painel */
.media-toggle[hidden] {
  display: none;
}

.video-link-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.video-link-field[hidden] {
  display: none;
}

.video-link-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.video-link-row input {
  flex: 1;
  min-width: 0;
  text-overflow: ellipsis;
}

/* why: mesma altura/raio dos campos — o botão e o input formam uma linha só */
.video-link-row .btn {
  flex: none;
  min-height: var(--props-field-h, 34px);
  border-radius: var(--props-field-radius, 7px);
}

.video-link-status.is-error {
  color: var(--ns-danger, #c0392b);
  font-weight: 600;
}

.video-link-current {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.video-link-current:empty,
.video-link-current:not(:has(> :not([hidden]))) {
  display: none;
}

.video-link-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ns-accent) 16%, transparent);
  color: var(--ns-ink);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}

.video-link-chip[hidden] {
  display: none;
}

.video-link-chip:hover {
  text-decoration: underline;
}

/* ---- barra de formatação leve (B / I / U / lista) — js/richTextEditor.js ---- */
.rt-toolbar {
  position: fixed;
  z-index: 2147483000;
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--ns-border);
  border-radius: 9px;
  background: var(--ns-panel);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.16);
}
.rt-toolbar[hidden] {
  display: none !important;
}
.rt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ns-ink);
  cursor: pointer;
}
.rt-btn svg {
  width: 18px;
  height: 18px;
}
.rt-btn:hover {
  background: var(--ns-hover);
}
.rt-btn:focus-visible {
  outline: 2px solid var(--ns-accent-dark);
  outline-offset: 1px;
}
.rt-btn[aria-pressed="true"] {
  background: color-mix(in srgb, var(--ns-accent) 22%, var(--ns-panel));
  border-color: color-mix(in srgb, var(--ns-accent-dark) 45%, transparent);
  color: var(--ns-accent-dark);
}
/* toque compacto: barra fixa acima do teclado, alvos de 44 px */
.rt-toolbar.is-compact {
  left: 0;
  right: 0;
  justify-content: center;
  gap: 8px;
  border-radius: 0;
  border-width: 1px 0 0;
  padding: 4px max(8px, env(safe-area-inset-left)) calc(4px + env(safe-area-inset-bottom, 0px));
}
.rt-toolbar.is-compact .rt-btn {
  width: 44px;
  height: 44px;
}
.rt-toolbar.is-compact .rt-btn svg {
  width: 22px;
  height: 22px;
}

/* ---- Modo de exibição (Tour guiado | Galeria): só ⚙ Preferências do projeto ---- */
.mode-picker {
  display: grid;
  gap: 6px;
  margin: 0 0 8px;
  padding: 8px 10px 10px;
  border: 1px solid var(--ns-border);
  border-radius: 10px;
}

.mode-picker legend {
  padding: 0 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ns-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mode-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.mode-option:hover {
  background: var(--ns-hover);
}

.mode-option:has(input:checked) {
  border-color: var(--ns-accent);
  background: color-mix(in srgb, var(--ns-accent) 8%, var(--ns-panel));
}

.mode-option input {
  margin-top: 3px;
  accent-color: var(--ns-accent);
}

.mode-option-text {
  display: grid;
  gap: 2px;
}

.mode-option-title {
  font-weight: 600;
}

.mode-option-hint {
  font-size: 0.8rem;
  color: var(--ns-muted);
}

.preview-mode-badge {
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ns-accent) 18%, transparent);
  font-size: 0.7rem;
  font-weight: 700;
}

.preview-mode-badge[hidden] {
  display: none;
}

/* F1: tipos de evento do webhook/LeadPronto e histórico de entregas */
.leads-webhook-events {
  border: 0;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.leads-webhook-events legend {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 4px;
  padding: 0;
}

.leads-webhook-history {
  margin: 4px 0 8px;
  font-size: 0.8rem;
}

.leads-webhook-history summary {
  cursor: pointer;
}

.leads-webhook-history-list {
  margin: 6px 0 0;
  padding-left: 18px;
  max-height: 220px;
  overflow: auto;
}

.leads-webhook-history-row.is-failed {
  color: var(--ns-danger, #b42318);
}

/* Enquadrar: diálogo com o print inteiro. O recorte em si é gravado nos pixels (js/cropArea.js). */
.crop-dialog {
  padding: 0;
  border: 0;
  border-radius: 14px;
  max-width: min(1100px, 94vw);
  background: var(--ns-surface, #fff);
  color: inherit;
}
.crop-dialog::backdrop {
  background: rgba(10, 14, 20, 0.6);
}
.crop-card {
  display: grid;
  gap: 10px;
  padding: 18px 20px;
}
.crop-title {
  margin: 0;
  font-size: 1.1rem;
}
.crop-lead {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.8;
}
.crop-stage {
  position: relative;
  justify-self: center;
  line-height: 0;
  overflow: hidden;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  border-radius: 6px;
}
.crop-img {
  display: block;
  max-width: min(1040px, 88vw);
  max-height: 64vh;
  pointer-events: none;
}
.crop-rect {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
  cursor: move;
}
.crop-rect[hidden] {
  display: none;
}
.crop-rect i {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
}
.crop-rect i[data-h="nw"] { left: -7px; top: -7px; cursor: nwse-resize; }
.crop-rect i[data-h="ne"] { right: -7px; top: -7px; cursor: nesw-resize; }
.crop-rect i[data-h="sw"] { left: -7px; bottom: -7px; cursor: nesw-resize; }
.crop-rect i[data-h="se"] { right: -7px; bottom: -7px; cursor: nwse-resize; }
.crop-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.crop-spacer {
  flex: 1;
}
.crop-dialog.is-busy .crop-stage {
  cursor: progress;
  opacity: 0.7;
}
/* Desfocar área: retângulos sobre o print. O desfoque em si é gravado nos pixels (js/blurArea.js). */
.blur-layer {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 9;
  cursor: crosshair;
  touch-action: none;
  outline: 2px dashed color-mix(in srgb, var(--ns-accent, #2a9d8f) 70%, transparent);
  outline-offset: -2px;
}
.blur-layer[hidden],
.blur-hint[hidden],
body.is-presenting .blur-layer,
body.is-presenting .blur-hint,
.is-presenting .blur-layer,
.is-presenting .blur-hint {
  display: none !important;
}
.blur-layer.is-baking {
  cursor: progress;
}
.canvas-frame.is-blurring .hotspot,
.canvas-frame.is-blurring .click-point,
.canvas-frame.is-blurring .editor-popover,
.canvas-frame.is-blurring .alt-chip {
  visibility: hidden;
}
.blur-rect {
  position: absolute;
  box-sizing: border-box;
  border: 2px dashed #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55);
  border-radius: 4px;
  cursor: move;
  background: rgba(255, 255, 255, 0.06);
}
.blur-rect.is-drawing {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.blur-rect.is-selected {
  border-style: solid;
  border-color: var(--ns-accent, #2a9d8f);
}
.blur-rect-remove {
  position: absolute;
  top: -11px;
  right: -11px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #1f2933;
  color: #fff;
  font: 600 15px/22px system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.blur-rect-remove:hover,
.blur-rect-remove:focus-visible {
  background: #c0392b;
}
.blur-rect-handle {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
  cursor: nwse-resize;
}
.blur-hint {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  z-index: 10;
  margin: 0;
  max-width: calc(100% - 16px);
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.85);
  color: #fff;
  font: 500 12px/1.35 system-ui, sans-serif;
  pointer-events: none;
  text-align: center;
}

/* aviso: link publicado ainda sem o desfoque (não bloqueia) */
.blur-share-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 24px 0;
  padding: 8px 8px 8px 12px;
  border: 1px solid #f0c36d;
  border-radius: 10px;
  background: #fff8e6;
  color: #5b4300;
  font-size: 0.8125rem;
  line-height: 1.35;
}
.blur-share-notice[hidden],
.is-presenting .blur-share-notice {
  display: none !important;
}
.blur-share-notice-text {
  flex: 1 1 220px;
  min-width: 0;
}
.blur-share-notice-close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
}
.blur-share-notice-close:hover,
.blur-share-notice-close:focus-visible {
  background: rgba(91, 67, 0, 0.1);
}
