:root {
  color-scheme: dark;
  --ui-font: Aptos, "SF Pro Text", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #101318;
  --panel: #181d25;
  --panel-2: #202633;
  --input-bg: #0f1319;
  --text: #eef3f6;
  --muted: #9aa5ad;
  --line: #24d7ea;
  --accent: #ef2f37;
  --focus: #f5c84b;
  --border: rgba(255, 255, 255, 0.09);
  --transition: 0.13s ease;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 25% -5%, rgba(36, 215, 234, 0.055) 0%, transparent 52%),
    var(--bg);
  color: var(--text);
  font-family: var(--ui-font);
  font-weight: 450;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  min-height: 100vh;
  padding: 18px;
}

.stage-panel,
.controls-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.stage-panel {
  display: grid;
  grid-template-rows: auto minmax(280px, 1fr) auto auto;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.022) 0%, var(--panel) 64px) var(--panel);
}

.stage-toolbar,
.export-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(22px, 2.6vw, 36px);
  font-weight: 720;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(154, 165, 173, 0.65);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.toolbar-actions,
.format-buttons,
.row-actions,
.segmented,
.export-row {
  display: flex;
  gap: 8px;
}

.icon-button,
.primary-button,
.download-link,
.small-button,
.segment,
.format {
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text);
  min-height: 40px;
  transition:
    background var(--transition),
    border-color var(--transition),
    color var(--transition),
    box-shadow var(--transition),
    transform 0.1s ease;
}

.icon-button {
  width: 42px;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-button:hover,
.small-button:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: #252d3b;
}

.icon-button:active,
.small-button:active {
  transform: scale(0.94);
}

.primary-button,
.download-link,
.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  padding: 0 16px;
  font-weight: 520;
  text-decoration: none;
  gap: 7px;
}

.primary-button:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: #252d3b;
}

.small-button {
  flex: 1;
  min-width: 0;
  padding: 0 10px;
}

.danger-button {
  width: 100%;
  border-color: rgba(239, 47, 55, 0.35);
  color: #ff8589;
  background: rgba(239, 47, 55, 0.08);
}

.danger-button:hover {
  border-color: rgba(239, 47, 55, 0.62);
  background: rgba(239, 47, 55, 0.14);
}

.accent {
  background: rgba(36, 215, 234, 0.13);
  border-color: rgba(36, 215, 234, 0.35);
  color: var(--line);
}

.accent:hover {
  background: rgba(36, 215, 234, 0.22) !important;
  border-color: rgba(36, 215, 234, 0.55) !important;
  box-shadow: 0 0 18px rgba(36, 215, 234, 0.14);
}

.download-link:not([hidden]) {
  display: inline-flex;
}

.canvas-wrap {
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: auto;
  background: #0b0e14;
  border-radius: 8px;
  border: 1px solid var(--border);
  position: relative;
}

.canvas-wrap.show-checker {
  background-image:
    linear-gradient(45deg, #16191f 25%, transparent 25%),
    linear-gradient(-45deg, #16191f 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #16191f 75%),
    linear-gradient(-45deg, transparent 75%, #16191f 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0px;
  background-color: #0d1016;
}

.canvas-wrap.show-safe-zone::after {
  content: "";
  position: absolute;
  inset: 10%;
  border: 1px dashed rgba(245, 200, 75, 0.78);
  box-shadow: 0 0 0 9999px rgba(245, 200, 75, 0.035);
  pointer-events: none;
}

canvas {
  display: block;
  width: min(100%, 1280px);
  height: auto;
  aspect-ratio: 16 / 9;
}

.callout-text {
  min-height: 72px;
  font-family: inherit;
}

.timeline-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.timeline-scrubber {
  flex: 1;
  accent-color: var(--line);
  cursor: pointer;
}

.timeline-time {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  min-width: 34px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.controls-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
  max-height: calc(100vh - 36px);
  padding: 16px;
}

.settings-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  margin-bottom: 2px;
}

.tab-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 52px;
  padding: 6px 2px;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.02em;
  margin-bottom: -1px;
  transition:
    color var(--transition),
    border-color var(--transition),
    background var(--transition);
}

.tab-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.tab-label {
  line-height: 1;
  white-space: nowrap;
}

.tab-button:hover:not(.is-active) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.tab-button.is-active {
  border-color: transparent;
  border-bottom-color: var(--line);
  background: transparent;
  color: var(--line);
}

.control-group {
  display: grid;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.control-group.is-hidden {
  display: none;
}

.control-group:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

input[type="text"],
input[type="number"],
textarea,
select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: var(--input-bg);
  color: var(--text);
  min-height: 42px;
  padding: 10px 12px;
  outline: none;
  transition: border-color var(--transition);
}

input[type="text"]:hover,
input[type="number"]:hover,
select:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

select {
  appearance: none;
}

textarea {
  min-height: 142px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, monospace;
  line-height: 1.45;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible,
.download-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

input[type="range"] {
  accent-color: var(--line);
}

input[type="color"] {
  width: 100%;
  height: 42px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 7px;
  background: var(--input-bg);
}

.hint {
  margin: -5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.hidden-file {
  display: none;
}

.segment,
.format {
  flex: 1;
  padding: 0 10px;
  font-weight: 520;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.segment.is-active,
.format.is-active {
  border-color: rgba(36, 215, 234, 0.45);
  background: rgba(36, 215, 234, 0.12);
  color: var(--line);
  box-shadow: inset 0 0 0 1px rgba(36, 215, 234, 0.08);
}

.segment:hover:not(.is-active),
.format:hover:not(.is-active) {
  border-color: rgba(255, 255, 255, 0.2);
  background: #252d3b;
}

.data-editor {
  display: grid;
  gap: 8px;
}

.data-header,
.data-row {
  display: grid;
  grid-template-columns: minmax(74px, 1fr) minmax(74px, 1fr) 38px;
  gap: 8px;
  align-items: center;
}

.data-header {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.data-row input {
  min-height: 38px;
}

.remove-row {
  min-width: 38px;
  width: 38px;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: var(--input-bg);
  color: var(--muted);
  font-weight: 700;
  font-size: 16px;
  transition:
    background var(--transition),
    border-color var(--transition),
    color var(--transition),
    transform 0.1s ease;
}

.remove-row:hover {
  border-color: rgba(239, 47, 55, 0.45);
  background: rgba(239, 47, 55, 0.12);
  color: #ff7075;
}

.remove-row:active {
  transform: scale(0.93);
}

.swatch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dimension-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.toggle-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--line);
  flex-shrink: 0;
}

@keyframes pulse-rec {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 47, 55, 0.55); }
  50% { box-shadow: 0 0 0 6px rgba(239, 47, 55, 0); }
}

.primary-button.is-recording {
  background: rgba(239, 47, 55, 0.18) !important;
  border-color: rgba(239, 47, 55, 0.48) !important;
  color: #ff7075 !important;
  animation: pulse-rec 1.3s ease-in-out infinite;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 36px));
}

.toast {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 19, 25, 0.96);
  color: var(--text);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.32);
  font-size: 13px;
  line-height: 1.35;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.series-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.series-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: var(--input-bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.series-tab::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dot, var(--line));
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.04);
}

.series-tab:hover {
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text);
}

.series-tab.is-active {
  border-color: rgba(36, 215, 234, 0.45);
  background: rgba(36, 215, 234, 0.08);
  color: var(--line);
}

.toolbar-divider {
  display: inline-block;
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 2px;
}

.toast.error {
  border-color: rgba(239, 47, 55, 0.45);
  color: #ffb1b4;
}

.toast.success {
  border-color: rgba(36, 215, 234, 0.38);
  color: #a9f7ff;
}

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

  .controls-panel {
    max-height: none;
  }
}

@media (max-width: 620px) {
  .app-shell {
    padding: 10px;
  }

  .stage-toolbar,
  .export-row {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-actions,
  .export-row {
    width: 100%;
    flex-wrap: wrap;
  }

  .icon-button,
  .primary-button,
  .download-link {
    flex: 1;
  }
}

/* ───────────────────────────────────────────────────────────────
   Brand wrapper — integración con luislopezcomunicacion.es
   Las variables de marca (--purple, --bg-deep, etc.) se definen
   inline en el <head> de index.html para evitar parpadeos.
   ─────────────────────────────────────────────────────────────── */

.brand-page {
  background: var(--bg-deep);
  color: var(--white);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
}

html, body { overflow-x: hidden; max-width: 100vw; }
.brand-page * { box-sizing: border-box; }
.brand-page img, .brand-page canvas, .brand-page video { max-width: 100%; height: auto; }

.brand-page main.app-shell {
  background: #0b0f15;
  border-radius: 18px;
  margin: 24px;
  padding: 18px;
  width: auto;
  max-width: calc(100vw - 48px);
  box-sizing: border-box;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(31, 27, 46, 0.18);
  grid-template-columns: minmax(0, 1fr) 420px;
}

/* Fullscreen del animador */
main.app-shell.is-fullscreen,
main.app-shell:fullscreen,
main.app-shell:-webkit-full-screen {
  margin: 0;
  border-radius: 0;
  padding: 14px;
  width: 100vw;
  height: 100vh;
  background: #0b0f15;
  box-shadow: none;
  overflow: auto;
}

main.app-shell:fullscreen .controls-panel,
main.app-shell.is-fullscreen .controls-panel {
  max-height: calc(100vh - 28px);
  overflow-y: auto;
}

main.app-shell:fullscreen .stage-panel,
main.app-shell.is-fullscreen .stage-panel {
  min-height: 0;
}

.hero-preview {
  display: block;
  width: min(960px, 100%);
  height: auto;
  margin: 30px auto 0;
  border-radius: 14px;
  box-shadow: 0 30px 70px rgba(31, 27, 46, 0.22);
}

/* Contenido extendido (casos de uso) */
.brand-content {
  max-width: 1080px;
  margin: 60px auto 20px;
  padding: 0 24px;
}

.brand-content h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--white);
  text-align: center;
  margin-bottom: 22px;
  text-transform: none;
  border-bottom: 0;
  padding-bottom: 0;
}

.brand-content .lead-text {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--gray);
  max-width: 820px;
  margin: 0 auto 40px;
  text-align: center;
}

.use-cases {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  margin-bottom: 48px;
}

.use-case {
  background: rgba(107, 38, 156, 0.04);
  border: 1px solid rgba(107, 38, 156, 0.12);
  border-radius: 14px;
  padding: 22px;
}

.use-case h3 {
  font-family: var(--font-body);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--purple);
  margin-bottom: 10px;
}

.use-case p {
  color: var(--gray);
  font-size: 0.95rem;
  line-height: 1.6;
}

.why-section {
  background: var(--bg-dark);
  border-radius: 14px;
  padding: 28px 26px;
}

.why-section h3 {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--white);
  margin: 18px 0 8px;
}

.why-section h3:first-child {
  margin-top: 0;
}

.why-section p {
  color: var(--gray);
  line-height: 1.65;
  font-size: 0.97rem;
}

.why-section em {
  color: var(--purple);
  font-style: normal;
  font-weight: 600;
}

/* CTA solo botón */
.brand-cta-row {
  display: flex;
  justify-content: center;
  margin: 50px 24px;
}

.cta-button-solo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 18px 36px;
  background: var(--purple);
  color: #fff;
  text-decoration: none;
  border-radius: 100px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.05rem;
  transition: transform 0.25s var(--ease-out), background 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
  box-shadow: 0 12px 30px rgba(107, 38, 156, 0.28);
}

.cta-button-solo:hover {
  background: var(--purple-light);
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(107, 38, 156, 0.35);
}

.brand-hero {
  position: relative;
  padding: 130px 24px 40px;
  text-align: center;
  max-width: 1080px;
  margin: 0 auto;
}

.brand-hero .hero-badge {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--purple);
  background: rgba(107, 38, 156, 0.08);
  border: 1px solid rgba(107, 38, 156, 0.15);
  border-radius: 100px;
  padding: 6px 18px;
  margin-bottom: 18px;
}

.brand-hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--white);
  margin-bottom: 18px;
}

.brand-hero h1 .brand-accent,
.brand-content h2 .brand-accent,
.brand-faq h2 .brand-accent {
  color: var(--purple);
  font-style: italic;
  background: transparent;
  border: 0;
}

.brand-hero p.lead {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.55;
  color: var(--gray);
  max-width: 720px;
  margin: 0 auto 22px;
}

.brand-hero .hero-keywords {
  font-size: 0.85rem;
  color: var(--gray);
  margin-top: 14px;
}

.brand-faq {
  max-width: 880px;
  margin: 60px auto 30px;
  padding: 0 24px;
}

.brand-faq h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  line-height: 1.15;
  color: var(--white);
  text-align: center;
  margin-bottom: 28px;
  letter-spacing: -0.01em;
  text-transform: none;
  border-bottom: 0;
  padding-bottom: 0;
}


.faq-item {
  border-top: 1px solid rgba(31, 27, 46, 0.12);
}

.faq-item:last-child {
  border-bottom: 1px solid rgba(31, 27, 46, 0.12);
}

.faq-trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 6px;
  background: transparent;
  border: 0;
  text-align: left;
  font-family: var(--font-body);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--white);
  cursor: pointer;
}

.faq-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(107, 38, 156, 0.35);
  color: var(--purple);
  transition: transform 0.3s var(--ease-out);
  font-size: 1rem;
  line-height: 1;
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
}

.faq-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease-out);
}

.faq-body p {
  padding: 0 6px 22px;
  color: var(--gray);
  line-height: 1.6;
  font-size: 0.97rem;
}

/* ─── Adaptación móvil del wrapper de marca + animador ─── */
@media (max-width: 980px) {
  .brand-page main.app-shell {
    grid-template-columns: 1fr;
    margin: 16px;
    padding: 14px;
    max-width: calc(100vw - 32px);
  }
  /* Capa de seguridad: nadie dentro del app-shell puede tener min-width intrínseco */
  .brand-page main.app-shell,
  .brand-page main.app-shell * {
    min-width: 0;
  }
  .brand-page main.app-shell .controls-panel {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 720px) {
  .brand-hero { padding: 130px 16px 20px; }
  .brand-hero h1 { font-size: clamp(1.6rem, 7vw, 2.2rem); }
  .brand-hero p.lead { font-size: 0.94rem; line-height: 1.45; }
  .brand-hero .hero-keywords { font-size: 0.76rem; }
  .brand-hero .hero-badge { font-size: 0.74rem; padding: 5px 14px; }

  .brand-page main.app-shell {
    margin: 10px;
    padding: 10px;
    border-radius: 12px;
    gap: 12px;
    max-width: calc(100vw - 20px);
  }
  .brand-page main.app-shell .stage-panel { padding: 10px; gap: 10px; min-width: 0; width: 100%; box-sizing: border-box; }
  .brand-page main.app-shell .controls-panel { padding: 10px; min-width: 0; width: 100%; box-sizing: border-box; }
  .brand-page main.app-shell .canvas-wrap {
    overflow: hidden;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .brand-page main.app-shell canvas {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }

  /* Toolbar superior del animador en móvil: scroll horizontal en vez de wrap caótico */
  .stage-toolbar { flex-direction: row !important; align-items: center; gap: 8px; }
  .stage-toolbar > div:first-child h2 { font-size: 0.92rem; }
  .stage-toolbar .eyebrow { font-size: 9px; }
  .toolbar-actions {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .toolbar-actions::-webkit-scrollbar { display: none; }
  .icon-button { flex: 0 0 36px; min-height: 36px; }
  .save-indicator { display: none; }

  /* Botones de exportación: 2x2 con min-width forzado a 0 para que respeten la grid */
  .export-row {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }
  .export-row .primary-button,
  .export-row .download-link {
    min-width: 0 !important;
    min-height: 44px;
    padding: 0 8px;
    font-size: 13px;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .export-row .primary-button svg { flex-shrink: 0; }
  .export-row .primary-button span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }

  /* Línea de tiempo */
  .timeline-row { gap: 8px; }

  /* Pestañas del panel: scroll horizontal y tap targets más grandes */
  .settings-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }
  .settings-tabs::-webkit-scrollbar { display: none; }
  .tab-button { flex: 0 0 auto; padding: 10px 14px; min-height: 44px; }

  /* Inputs y controles: más altos en móvil para acertarles bien */
  .control-group label { font-size: 13px; }
  .control-group input[type="text"],
  .control-group input[type="number"],
  .control-group select,
  .control-group textarea {
    font-size: 16px; /* evita zoom automático en iOS */
    min-height: 40px;
    padding: 8px 10px;
  }
  .control-group input[type="range"] { height: 28px; }
  .small-button { min-height: 38px; padding: 8px 12px; font-size: 13px; }
  .toggle-row { padding: 6px 0; min-height: 38px; }

  .row-actions { flex-wrap: wrap; gap: 6px; }
  .row-actions .small-button { flex: 1 1 calc(50% - 6px); }

  /* Plantillas visuales: 3 columnas en vez de scroll */
  .segmented {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .segment { padding: 10px 6px !important; font-size: 12px; }

  /* Formatos de lienzo */
  .format-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .format { padding: 10px 6px; }

  /* Resto del wrapper */
  .brand-cta-row { margin: 36px 16px; }
  .cta-button-solo { padding: 16px 26px; font-size: 0.98rem; }
  .brand-faq { margin: 40px auto 20px; }
  .brand-content { margin: 40px auto 16px; padding: 0 18px; }
  .why-section { padding: 22px 18px; }
}

@media (max-width: 480px) {
  /* En pantallas muy estrechas, el editor de datos en una columna */
  .data-editor { font-size: 12px; }
  .templates-grid { grid-template-columns: 1fr !important; }
  .swatch-grid, .dimension-grid { grid-template-columns: 1fr 1fr; }
  .brand-hero { padding: 100px 14px 18px; }
  .brand-page main.app-shell { margin: 6px; padding: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .faq-icon, .faq-body, .cta-button-solo { transition: none; }
}

/* ─── Save indicator ─── */
.save-indicator {
  font-size: 11px;
  color: var(--muted);
  padding-left: 8px;
  letter-spacing: 0.02em;
  align-self: center;
  white-space: nowrap;
  transition: color 0.4s ease;
}
.save-indicator.flash { color: #6cd97e; }

/* ─── kbd inside hints / shortcuts ─── */
.hint kbd, .shortcuts-list kbd {
  display: inline-block;
  padding: 1px 6px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: ui-monospace, SF Mono, Menlo, monospace;
  font-size: 10.5px;
  color: var(--text);
  margin: 0 1px;
}

/* ─── Embed output textarea ─── */
.embed-output {
  width: 100%;
  margin-top: 8px;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  font-family: ui-monospace, SF Mono, Menlo, monospace;
  font-size: 11px;
  line-height: 1.45;
  resize: vertical;
}

/* ─── Shortcuts overlay ─── */
.shortcuts-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 21, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.shortcuts-overlay.is-open {
  display: flex;
}
.shortcuts-modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 30px;
  max-width: 480px;
  width: 100%;
  position: relative;
  color: var(--text);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.shortcuts-modal h3 {
  font-size: 1.05rem;
  margin-bottom: 18px;
  letter-spacing: 0;
}
.shortcuts-list {
  display: grid;
  grid-template-columns: minmax(120px, auto) 1fr;
  gap: 10px 16px;
  font-size: 13px;
}
.shortcuts-list dt {
  color: var(--muted);
  white-space: nowrap;
}
.shortcuts-list dd {
  margin: 0;
  color: var(--text);
}
.shortcuts-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
}
.shortcuts-close:hover {
  background: var(--input-bg);
  color: var(--text);
}
