* {
  box-sizing: border-box;
}

:root {
  --bg: #f3f4f6;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --input-bg: #ffffff;
  --topbar-bg: rgba(243, 244, 246, 0.92);
  --button-bg: #ffffff;
  --toast-bg: #111827;
  --toast-text: #ffffff;
  --checker: rgba(15,23,42,.04);
  --radius: 18px;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-right: env(safe-area-inset-right, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-left: env(safe-area-inset-left, 0px);
}

html[data-app-theme="dark"] {
  color-scheme: dark;
  --bg: #090d18;
  --panel: #111827;
  --text: #f8fafc;
  --muted: #b6c0d1;
  --line: rgba(226, 232, 240, 0.16);
  --accent: #67e8f9;
  --accent-dark: #22d3ee;
  --danger: #fca5a5;
  --danger-soft: rgba(127, 29, 29, 0.36);
  --input-bg: #0f172a;
  --topbar-bg: rgba(9, 13, 24, 0.92);
  --button-bg: #0f172a;
  --toast-bg: #e2e8f0;
  --toast-text: #0f172a;
  --checker: rgba(226,232,240,.06);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

html,
body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

html[data-display-mode="standalone"] body {
  min-height: 100dvh;
}

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

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: max(18px, var(--safe-area-top)) max(22px, var(--safe-area-right)) 18px max(22px, var(--safe-area-left));
  background: var(--topbar-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

h2 {
  margin: 0 0 14px;
  font-size: 1rem;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.primary-btn,
.secondary-btn,
.danger-btn,
.device-btn,
.upload-btn,
.tab-btn {
  border: 0;
  border-radius: 999px;
  min-height: 44px;
  padding: 10px 15px;
  font-weight: 800;
}

/* v412: objetivos tactiles estables en la navegacion interna del editor */
#floatingHelpBtn,
#appThemeToggle,
.editor-tabs .tab-btn,
.preview-toolbar .device-btn {
  min-height: 44px !important;
}

#floatingHelpBtn {
  width: 44px !important;
  height: 44px !important;
}

.primary-btn {
  color: #fff;
  background: var(--accent);
}

@media (hover: hover) and (pointer: fine) {
  .primary-btn:hover {
    background: var(--accent-dark);
  }
}

.secondary-btn,
.device-btn,
.upload-btn,
.tab-btn {
  color: var(--text);
  background: var(--button-bg);
  border: 1px solid var(--line);
}

.danger-btn {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #fecaca;
}

.compact {
  padding: 9px 11px;
  font-size: 0.9rem;
}

.device-btn.active,
.tab-btn.active {
  color: #fff;
  background: var(--text);
  border-color: var(--text);
}

.layout {
  display: grid;
  grid-template-columns: minmax(310px, 410px) 1fr;
  gap: 18px;
  padding: 18px max(18px, var(--safe-area-right)) max(18px, var(--safe-area-bottom)) max(18px, var(--safe-area-left));
  min-height: calc(100vh - 85px);
}

.panel {
  min-width: 0;
}

.editor-control-search {
  position: sticky;
  top: 88px;
  z-index: 18;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--topbar-bg);
  box-shadow: var(--shadow);
  padding: 12px;
  backdrop-filter: blur(16px);
}

.editor-control-search-field {
  margin: 0;
}

.editor-control-search input {
  margin-bottom: 0;
}

.editor-control-search-results {
  display: grid;
  gap: 6px;
  max-height: min(320px, 48vh);
  overflow: auto;
  margin-top: 10px;
}

.editor-control-search-results[hidden] {
  display: none;
}

.editor-control-search-result {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--button-bg);
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
}

.editor-control-search-result.is-active,
.editor-control-search-result[aria-selected="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

@media (hover: hover) and (pointer: fine) {
  .editor-control-search-result:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
  }
}

:where(button, a, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.92);
}

:where(button, input, textarea, select):disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

@media (pointer: coarse) {
  :where(button, input, select, summary) {
    min-height: 44px;
  }

  .compact,
  .page-select-btn,
  .page-move-btn,
  .tabs-scroll-arrow,
  .client-review-actions .device-btn,
  .editor-control-search-result {
    min-height: 44px;
  }
}

html[data-app-theme="dark"] :where(button, a, input, textarea, select, summary, [tabindex]):focus-visible {
  outline-color: #67e8f9;
  box-shadow: 0 0 0 5px rgba(9, 13, 24, 0.94);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.editor-control-search-result strong {
  display: block;
  font-size: .94rem;
}

.editor-control-search-result span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}

.editor-control-search-empty {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 800;
}

.editor-search-highlight {
  outline: 4px solid rgba(37, 99, 235, .38);
  outline-offset: 5px;
  border-radius: 16px;
  animation: editorSearchPulse 1.1s ease-in-out 2;
}

@keyframes editorSearchPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, .0);
  }

  50% {
    box-shadow: 0 0 0 9px rgba(37, 99, 235, .16);
  }
}

.editor-tabs {
  position: sticky;
  top: 87px;
  z-index: 10;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 12px;
  margin-bottom: 2px;
  scrollbar-width: thin;
}

.tab-btn {
  white-space: nowrap;
  flex: 0 0 auto;
  padding: 9px 12px;
  font-size: 0.9rem;
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.tab-panel.active {
  display: flex;
}

.tab-panel:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .46);
  outline-offset: 6px;
  border-radius: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.project-manager {
  border-color: rgba(37, 99, 235, 0.24);
}

.project-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field span {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: var(--input-bg);
  color: var(--text);
}

textarea {
  resize: vertical;
}

input[type="color"] {
  min-height: 44px;
  padding: 4px;
}

.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.check {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 10px 0;
  font-weight: 700;
}

.check input {
  width: auto;
}

.full,
.upload-btn {
  width: 100%;
  display: block;
  text-align: center;
  margin-bottom: 10px;
}

.upload-btn input {
  display: none;
}

.small-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.preview-shell {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.preview-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.preview-viewport {
  flex: 1;
  min-height: 720px;
  overflow: auto;
  background:
    linear-gradient(45deg, var(--checker) 25%, transparent 25%),
    linear-gradient(-45deg, var(--checker) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--checker) 75%),
    linear-gradient(-45deg, transparent 75%, var(--checker) 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
  padding: 0;
}

#previewFrame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 720px;
  border: 0;
  background: #fff;
  margin: 0 auto;
  transition: width 180ms ease, min-height 180ms ease;
}

.preview-shell[data-device="tablet"] .preview-viewport,
.preview-shell[data-device="mobile"] .preview-viewport {
  padding: 18px;
}

.preview-shell[data-device="tablet"] #previewFrame {
  width: min(768px, 100%);
  min-height: 720px;
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
}

.preview-shell[data-device="mobile"] #previewFrame {
  width: 390px;
  max-width: 100%;
  min-height: 760px;
  border-radius: 30px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.2);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--toast-bg);
  color: var(--toast-text);
  padding: 12px 16px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  font-weight: 800;
  z-index: 100;
}

.app-theme-toggle {
  min-width: 128px;
}

.theme-toggle-project-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  margin: 0 0 14px;
  background: var(--panel);
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.text-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 9200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.58);
}

.text-dialog-overlay.is-open {
  display: flex;
}

.text-dialog-panel {
  width: min(480px, 100%);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.28);
}

.text-dialog-header h2,
.text-dialog-description {
  margin: 0;
}

.text-dialog-description {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

.text-dialog-field input {
  min-height: 44px;
}

.text-dialog-field.is-hidden {
  display: none;
}

.text-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

body.text-dialog-open {
  overflow: hidden;
}

@media (max-width: 520px) {
  .text-dialog-overlay {
    align-items: flex-end;
    padding: 12px;
  }

  .text-dialog-panel {
    border-radius: 18px;
  }

  .text-dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .editor-tabs {
    top: 141px;
  }

  .project-actions-grid {
    grid-template-columns: 1fr;
  }

  .preview-viewport {
    min-height: 640px;
  }

  #previewFrame {
    min-height: 640px;
  }
}

@media (max-width: 520px) {
  .layout {
    padding: 10px max(10px, var(--safe-area-right)) max(10px, var(--safe-area-bottom)) max(10px, var(--safe-area-left));
  }

  .topbar {
    padding: max(14px, var(--safe-area-top)) max(14px, var(--safe-area-right)) 14px max(14px, var(--safe-area-left));
  }

  .preview-shell[data-device="mobile"] .preview-viewport,
  .preview-shell[data-device="tablet"] .preview-viewport {
    padding: 10px;
  }

  .preview-shell[data-device="mobile"] #previewFrame {
    width: 100%;
    border-radius: 22px;
  }
}


.asset-preview {
  display: grid;
  place-items: center;
  min-height: 120px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: #f9fafb;
  color: var(--muted);
  font-weight: 800;
  overflow: hidden;
  margin: 0 0 10px;
}

.asset-preview.warn {
  border-style: solid;
  border-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

.asset-preview.error {
  border-style: solid;
  border-color: #ef4444;
  background: #fef2f2;
  color: #991b1b;
}

.asset-preview img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.asset-preview.logo-preview img {
  width: auto;
  max-width: 100%;
  height: 90px;
  object-fit: contain;
  padding: 14px;
}

.gallery-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.gallery-thumb {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f9fafb;
}

.gallery-thumb img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.gallery-thumb button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.86);
  color: #fff;
  font-weight: 900;
  line-height: 1;
  font-size: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

@media (max-width: 520px) {
  .gallery-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


.checklist {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.checklist-item {
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.9rem;
}

.checklist-item.ok {
  color: #166534;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
}

.checklist-item.warn {
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
}

.checklist-item.error {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fecaca;
}


.help-card details {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  margin-bottom: 10px;
}

.help-card summary {
  cursor: pointer;
  font-weight: 900;
}

.help-card p,
.help-card li {
  color: var(--muted);
  font-weight: 650;
}

.help-card ol,
.help-card ul {
  padding-left: 22px;
}

.export-summary {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}


.asset-settings {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: #f9fafb;
  margin-bottom: 14px;
}

.asset-stats {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

.asset-stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 9px 11px;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.88rem;
}

.asset-stat.warn {
  color: #92400e;
  background: #fef3c7;
  border-color: #fde68a;
}

.asset-stat.danger {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fecaca;
}

.asset-stat.ok {
  color: #166534;
  background: #dcfce7;
  border-color: #bbf7d0;
}


.section-subtitle {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.section-order-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.section-order-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.section-order-item.is-hidden {
  opacity: 0.55;
}

.section-order-title {
  font-weight: 900;
}

.section-order-state {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.section-order-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f9fafb;
  font-weight: 900;
}

.section-order-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}


.pages-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.page-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 10px 12px;
}

.page-item.active {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.page-item-title {
  font-weight: 900;
}

.page-item-slug {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.page-select-btn {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f9fafb;
  font-weight: 900;
  padding: 8px 10px;
}

.page-item-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.page-move-btn {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
  padding: 8px 9px;
}

.page-move-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}


.post-meta {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  margin: 0 0 10px;
}

.post-list {
  display: grid;
  gap: 16px;
}

.post-list .post a {
  color: inherit;
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .post-list .post a:hover {
    text-decoration: underline;
  }
}


.floating-help-btn {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(17, 24, 39, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #111827;
  font-weight: 950;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(14px);
}

@media (hover: hover) and (pointer: fine) {
  .floating-help-btn:hover {
    background: #111827;
    color: #fff;
  }
}

.page-select-btn,
.page-move-btn,
.tabs-scroll-arrow,
.client-review-actions .device-btn {
  touch-action: manipulation;
}

.page-select-btn:focus-visible,
.page-move-btn:focus-visible,
.tabs-scroll-arrow:focus-visible,
.client-review-actions .device-btn:focus-visible,
.page-item:focus-within {
  outline: 3px solid rgba(37, 99, 235, .46);
  outline-offset: 3px;
}

.editor-tabs {
  position: relative;
  padding-left: 2px;
  padding-right: 48px;
  mask-image: linear-gradient(to right, transparent 0, black 18px, black calc(100% - 54px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, black 18px, black calc(100% - 54px), transparent 100%);
}

.panel::after {
  content: "›";
  position: sticky;
  top: 91px;
  float: right;
  z-index: 12;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: -45px;
  margin-right: 4px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 950;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

.tabs-scroll-hint {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.tabs-scroll-hint span {
  display: inline-block;
  padding: 5px 9px;
  border: 1px dashed var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
}

@media (min-width: 1180px) {
  .tabs-scroll-hint {
    display: none;
  }
}

@media (max-width: 520px) {
  .floating-help-btn {
    top: 8px;
    left: 8px;
    width: 44px;
    height: 44px;
  }
}


/* v14.1: arreglo estable de solapamientos visuales */
.topbar {
  padding-left: 72px;
}

.floating-help-btn {
  top: 14px;
  left: 14px;
  z-index: 300;
}

.editor-tabs {
  position: static !important;
  top: auto !important;
  z-index: 5;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 42px 12px 0;
  margin-bottom: 0;
  scrollbar-width: thin;
  mask-image: linear-gradient(to right, black 0, black calc(100% - 52px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 0, black calc(100% - 52px), transparent 100%);
}

.panel::after {
  content: none !important;
  display: none !important;
}

.tabs-scroll-hint {
  margin: 0 0 14px;
  display: block;
  clear: both;
  position: relative;
  z-index: 1;
}

.tab-panel {
  position: relative;
  z-index: 1;
  clear: both;
}

.card {
  position: relative;
  z-index: 1;
}

@media (max-width: 920px) {
  .editor-tabs {
    top: auto !important;
  }

  .topbar {
    padding-left: 58px;
  }
}

@media (max-width: 520px) {
  .topbar {
    padding-left: 54px;
  }
}


/* v15.1: vista completa estable y aislada */
.preview-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.preview-fullscreen-btn {
  background: #eef2ff;
  border-color: #c7d2fe;
}

.preview-fullscreen-btn.is-active {
  color: #fff;
  background: #2563eb;
  border-color: #2563eb;
}

.client-review-btn {
  background: #ecfdf5;
  border-color: #bbf7d0;
}

body.preview-fullscreen-active {
  overflow: hidden;
}

body.preview-fullscreen-active .topbar,
body.preview-fullscreen-active .panel,
body.preview-fullscreen-active .floating-help-btn {
  display: none !important;
}

body.preview-fullscreen-active .layout {
  display: block;
  padding: 0;
  min-height: 100vh;
}

body.preview-fullscreen-active .preview-shell {
  position: fixed;
  inset: 0;
  z-index: 500;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.preview-fullscreen-active .preview-toolbar {
  min-height: 58px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
}

body.preview-fullscreen-active .preview-viewport {
  min-height: calc(100vh - 58px);
  padding: 0 !important;
  background: #fff;
}

body.preview-fullscreen-active #previewFrame {
  width: 100% !important;
  max-width: none !important;
  min-height: calc(100vh - 58px);
  height: calc(100vh - 58px);
  border-radius: 0 !important;
  box-shadow: none !important;
}

body.preview-fullscreen-active .device-btn:not(.preview-fullscreen-btn) {
  display: none;
}

@media (max-width: 640px) {
  .preview-actions {
    justify-content: flex-start;
  }

  .preview-fullscreen-btn {
    width: 100%;
  }
}

.client-review-overlay {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: none;
  background: #f3f4f6;
}

body.client-review-active {
  overflow: hidden;
}

body.client-review-active .client-review-overlay {
  display: block;
}

.client-review-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.client-review-toolbar {
  min-height: 64px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.client-review-toolbar strong,
.client-review-status {
  overflow-wrap: anywhere;
}

.client-review-status {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.client-review-status.ok {
  color: #166534;
}

.client-review-status.warn {
  color: #92400e;
}

.client-review-status.danger {
  color: #991b1b;
}

.client-review-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.client-review-close-btn {
  color: #fff;
  background: #111827;
  border-color: #111827;
}

.client-review-viewport {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0;
  background: #fff;
}

#clientReviewFrame {
  display: block;
  width: 100%;
  min-height: calc(100vh - 64px);
  height: calc(100vh - 64px);
  margin: 0 auto;
  border: 0;
  background: #fff;
}

.client-review-shell[data-client-device="tablet"] .client-review-viewport,
.client-review-shell[data-client-device="mobile"] .client-review-viewport {
  padding: 18px;
  background:
    linear-gradient(45deg, rgba(15,23,42,.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(15,23,42,.04) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(15,23,42,.04) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(15,23,42,.04) 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
}

.client-review-shell[data-client-device="tablet"] #clientReviewFrame {
  width: min(768px, 100%);
  min-height: calc(100vh - 100px);
  height: calc(100vh - 100px);
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
}

.client-review-shell[data-client-device="mobile"] #clientReviewFrame {
  width: 390px;
  max-width: 100%;
  min-height: calc(100vh - 100px);
  height: calc(100vh - 100px);
  border-radius: 30px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.2);
}

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

  .client-review-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .client-review-shell[data-client-device="tablet"] .client-review-viewport,
  .client-review-shell[data-client-device="mobile"] .client-review-viewport {
    padding: 10px;
  }

  .client-review-shell[data-client-device="mobile"] #clientReviewFrame {
    width: 100%;
    border-radius: 22px;
  }
}


/* v16: modo rápido / avanzado */
.mode-btn {
  background: #ecfeff;
  border-color: #a5f3fc;
}

.mode-btn.is-advanced {
  color: #fff;
  background: #111827;
  border-color: #111827;
}

body.quick-mode .tab-btn[data-mode="advanced"] {
  display: none;
}

body.quick-mode .tabs-scroll-hint span::after {
  content: " · Modo rápido activo";
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--muted);
}


/* v17: pestaña Media fase 1 */
body.quick-mode .tab-btn[data-tab="media"] {
  display: none;
}

.media-phase-note {
  border: 1px solid #fde68a;
  background: #fef3c7;
  color: #92400e;
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 900;
}


/* v18.1: modo único estable, todas las pestañas visibles */
.mode-btn {
  display: none !important;
}

body.quick-mode .tab-btn,
body.quick-mode .tab-btn[data-mode="quick"],
body.quick-mode .tab-btn[data-mode="advanced"],
body.quick-mode .tab-btn[data-tab="media"] {
  display: inline-flex !important;
}


/* v21: media preview-only */
#audioPreviewOnlyBox audio {
  width: 100%;
}

#videoPreviewOnlyBox video {
  width: 100%;
  max-height: 280px;
  display: block;
  background: #111827;
  border-radius: 14px;
}

.media-preview-filename {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 900;
}


/* v22: media guardada en proyecto */
.media-size-warning {
  margin-top: 8px;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 900;
}


/* v23: avisos media */
.media-error-note {
  margin-top: 8px;
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 900;
}


/* v24: vídeo temporal para evitar límite de localStorage */
.media-temp-note {
  margin-top: 8px;
  color: #1d4ed8;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 900;
}


/* v25: aviso de vídeo temporal no restaurado */
.media-reselect-note {
  margin-top: 8px;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 900;
}


/* v26: vídeo persistente en IndexedDB */
.media-indexeddb-note {
  margin-top: 8px;
  color: #166534;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 900;
}


/* v27: reproductores media en preview generada */
.media-player {
  width: 100%;
  display: block;
  margin-top: 12px;
}

.audio-player {
  width: 100%;
}

.video-player {
  width: 100%;
  max-height: 520px;
  border-radius: 18px;
  background: #111827;
}


/* v29: límites y avisos de peso multimedia */
.media-limits-box {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-weight: 800;
}

.media-limits-box strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
}

.media-limits-box p {
  margin: 5px 0;
}

.media-weight-status {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.media-weight-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-weight: 900;
}

.media-weight-item.ok {
  color: #166534;
  background: #dcfce7;
  border-color: #bbf7d0;
}

.media-weight-item.warn {
  color: #92400e;
  background: #fef3c7;
  border-color: #fde68a;
}

.media-weight-item.danger {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fecaca;
}


/* v30: peso visible junto a audio/vídeo */
.media-file-size {
  margin-top: 6px;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 7px 10px;
  font-size: 0.86rem;
  font-weight: 900;
}


/* v31: exportación opcional de vídeo */
.video-export-warning {
  margin-top: 8px;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 900;
}


/* v33: formato recomendado y estado profesional */
.video-format-guide {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-weight: 800;
}

.video-format-guide strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
}

.video-format-guide p {
  margin: 5px 0;
}

.video-compatibility-status,
.project-quality-status {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.video-compatibility-item,
.project-quality-item {
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-weight: 900;
}

.video-compatibility-item.ok,
.project-quality-item.ok {
  color: #166534;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
}

.video-compatibility-item.warn,
.project-quality-item.warn {
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
}

.video-compatibility-item.danger,
.project-quality-item.danger {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fecaca;
}


/* v34: informe de exportación */
.report-note {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}


/* v35: entrega del proyecto */
.delivery-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 900;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
}


/* v36: guía de formatos de imagen */
.image-format-guide {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-weight: 800;
}

.image-format-guide strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
}

.image-format-guide p {
  margin: 5px 0;
}


/* v37: sincronización manual de preview */
.sync-preview-btn {
  background: #f0fdf4;
  border-color: #bbf7d0;
}


/* v38: descripciones editables de servicios */
.service-description-help {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}


/* v39: ayuda clara para descripciones de servicios */
.field-help {
  margin: -6px 0 14px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.4;
}


/* v40: descripciones separadas y claramente editables */
.services-description-editor {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 18px;
  padding: 14px;
  margin: 14px 0;
}

.services-description-editor h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}


/* v41: auditoría de coherencia editable */
.editable-audit-status {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.audit-item {
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-weight: 900;
}

.audit-item.ok {
  color: #166534;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
}

.audit-item.warn {
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
}

.audit-item.danger {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fecaca;
}

.audit-assistant-line {
  margin-top: 6px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.audit-rules {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.5;
}

.readiness-traffic-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #f8fafc;
  color: var(--ink);
  overflow: hidden;
}

.readiness-traffic-panel.danger {
  border-color: #fecaca;
  background: #fff7f7;
}

.readiness-traffic-panel.warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.readiness-traffic-panel.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.readiness-traffic-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.readiness-traffic-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.readiness-traffic-title span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.readiness-traffic-title strong {
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.readiness-traffic-title em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
}

.readiness-traffic-score {
  display: inline-grid;
  place-items: center;
  width: 76px;
  min-width: 76px;
  aspect-ratio: 1;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.10);
}

.readiness-traffic-score strong {
  font-size: 1.55rem;
  line-height: 1;
}

.readiness-traffic-score span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.readiness-state-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.readiness-state-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 999px;
  padding: 8px 10px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 950;
  text-align: center;
  white-space: normal;
}

.readiness-state-step.is-active {
  color: #0f172a;
  border-color: currentColor;
  box-shadow: inset 0 0 0 2px rgba(15, 23, 42, 0.08);
}

.readiness-state-step.danger.is-active {
  color: #991b1b;
  background: #fee2e2;
}

.readiness-state-step.warn.is-active {
  color: #92400e;
  background: #fef3c7;
}

.readiness-state-step.ok.is-active {
  color: #166534;
  background: #dcfce7;
}

.readiness-traffic-meter {
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.10);
  overflow: hidden;
}

.readiness-traffic-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ef4444, #f59e0b 48%, #22c55e);
}

.readiness-traffic-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.readiness-traffic-metrics span {
  min-height: 36px;
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 0.82rem;
  font-weight: 950;
  text-align: center;
}

.readiness-action-plan {
  display: grid;
  gap: 8px;
  border-radius: 12px;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.72);
}

.readiness-action-plan strong {
  font-size: 0.92rem;
  font-weight: 950;
}

.readiness-action-plan ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.readiness-action-plan li {
  font-size: 0.84rem;
  font-weight: 850;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.readiness-action-plan.danger {
  color: #991b1b;
  border-color: #fecaca;
  background: rgba(254, 226, 226, 0.72);
}

.readiness-action-plan.warn {
  color: #92400e;
  border-color: #fde68a;
  background: rgba(254, 243, 199, 0.72);
}

.readiness-action-plan.ok {
  color: #166534;
  border-color: #bbf7d0;
  background: rgba(220, 252, 231, 0.72);
}

.readiness-area-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.readiness-area-cell {
  display: grid;
  gap: 6px;
  min-height: 116px;
  border-radius: 12px;
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.76);
  overflow: hidden;
}

.readiness-area-cell.danger {
  border-color: #fecaca;
  background: #fee2e2;
  color: #991b1b;
}

.readiness-area-cell.warn {
  border-color: #fde68a;
  background: #fef3c7;
  color: #92400e;
}

.readiness-area-cell.ok {
  border-color: #bbf7d0;
  background: #dcfce7;
  color: #166534;
}

.readiness-area-cell-top {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: flex-start;
  min-width: 0;
}

.readiness-area-cell-top strong,
.readiness-area-cell-top span {
  font-weight: 950;
  overflow-wrap: anywhere;
}

.readiness-area-cell-counts,
.readiness-area-cell-note {
  font-size: 0.8rem;
  font-weight: 850;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.readiness-area-cell-note {
  opacity: 0.86;
}

@media (max-width: 640px) {
  .readiness-traffic-header,
  .readiness-traffic-metrics {
    grid-template-columns: 1fr;
  }

  .readiness-traffic-score {
    width: 100%;
    min-width: 0;
    aspect-ratio: auto;
    min-height: 58px;
  }

  .readiness-state-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* v42: campos separados de descripciones y flechas de pestañas */
.services-description-editor {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 18px;
  padding: 14px;
  margin: 14px 0;
}

.services-description-editor h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.field-help {
  margin: -2px 0 14px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.4;
}

.tabs-scroll-shell {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.tabs-scroll-shell .editor-tabs {
  min-width: 0;
  margin-bottom: 0;
}

.tabs-scroll-arrow {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #111827;
  font-size: 1.5rem;
  font-weight: 950;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.10);
}

.tabs-scroll-arrow:active {
  transform: scale(0.97);
}

@media (max-width: 700px) {
  .tabs-scroll-shell {
    grid-template-columns: 1fr;
  }

  .tabs-scroll-arrow {
    display: none;
  }
}


/* v43: corrección real sobre archivos enviados */
.services-description-editor {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 18px;
  padding: 14px;
  margin: 14px 0;
}

.services-description-editor h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.field-help {
  margin: -2px 0 14px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.4;
}

.tabs-scroll-shell {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.tabs-scroll-shell .editor-tabs {
  min-width: 0;
  margin-bottom: 0;
  position: static !important;
}

.tabs-scroll-arrow {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #111827;
  font-size: 1.5rem;
  font-weight: 950;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.10);
}

.tabs-scroll-arrow:active {
  transform: scale(0.97);
}

@media (max-width: 700px) {
  .tabs-scroll-shell {
    grid-template-columns: 1fr;
  }

  .tabs-scroll-arrow {
    display: none;
  }
}


/* v44: títulos editables de galería */
.gallery-caption-help {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}


/* v45: títulos editables de secciones */
.section-title-editor-note {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}


/* v46: tutorial dentro de ayuda */
.help-version-note {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.tutorial-help {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.tutorial-help h3 {
  margin: 10px 0 0;
  font-size: 0.98rem;
}

.tutorial-help p {
  margin: 0;
}


/* v47: ayuda a pantalla completa */
.help-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  background: rgba(15, 23, 42, 0.58);
  padding: 18px;
}

.help-overlay.is-open {
  display: block;
}

.help-overlay-panel {
  width: min(1100px, 100%);
  height: min(920px, 100%);
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.28);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.help-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.help-overlay-header h2 {
  margin: 0;
  font-size: 1.35rem;
}

.help-overlay-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.help-section-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 44px;
  padding: 10px 14px;
  background: #fff;
  font-weight: 900;
}

.help-section-btn.active {
  color: #fff;
  background: var(--text);
  border-color: var(--text);
}

.help-overlay-content {
  overflow: auto;
  padding: 18px;
}

.help-section {
  display: none;
  max-width: 880px;
  margin: 0 auto;
}

.help-section.active {
  display: block;
}

.help-section details {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  margin-bottom: 10px;
}

.help-section summary {
  cursor: pointer;
  font-weight: 900;
}

.help-section p,
.help-section li {
  color: var(--muted);
  font-weight: 650;
}

.help-section h3 {
  margin-top: 0;
}

.tutorial-help h4 {
  margin: 18px 0 6px;
  font-size: 1rem;
}

body.help-overlay-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .help-overlay {
    padding: 0;
  }

  .help-overlay-panel {
    height: 100%;
    border-radius: 0;
  }

  .help-overlay-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .help-overlay-header .secondary-btn {
    width: 100%;
  }
}


/* v48: footer editable */
.footer-settings-note {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}


/* v49: buscador interno de ayuda */
.help-search-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.help-search-field {
  margin-bottom: 0;
}

.help-search-status {
  min-height: 28px;
  padding: 0 18px 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
  background: #fff;
}

.help-search-hidden {
  display: none !important;
}

.help-search-mark {
  background: #fef3c7;
  color: #92400e;
  border-radius: 6px;
  padding: 0 3px;
  font-weight: 950;
}

@media (max-width: 640px) {
  .help-search-bar {
    grid-template-columns: 1fr;
  }

  .help-search-bar .secondary-btn {
    width: 100%;
  }
}


/* v50: corrección de espacio vacío y scroll en ayuda */
.help-overlay {
  overflow: hidden;
}

.help-overlay-panel {
  height: calc(100vh - 36px);
  max-height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
}

.help-overlay-header {
  flex-shrink: 0;
}

.help-overlay-tabs {
  flex-shrink: 0;
}

.help-search-bar {
  flex-shrink: 0;
}

.help-search-status {
  flex-shrink: 0;
}

.help-overlay-content {
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 80px;
}

@media (max-width: 640px) {
  .help-overlay-panel {
    height: 100vh;
    max-height: 100vh;
  }

  .help-overlay-content {
    padding-bottom: 110px;
  }
}


/* v51: historial de versiones en ayuda */
.changelog-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.changelog-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px 14px;
}

.changelog-item h4 {
  margin: 0 0 6px;
  font-size: 0.96rem;
}

.changelog-item p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}


/* v52: copias de seguridad de proyectos */
.project-backup-box {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.project-backup-box h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.import-projects-label {
  cursor: pointer;
}

.import-projects-label input {
  display: none;
}


/* v53: revisión de enlaces internos */
.link-audit-note {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}


/* v54: mapa de exportación */
.export-map-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
  padding: 14px;
  margin: 14px 0;
}

.export-map-box h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.export-map-status {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.export-map-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-weight: 850;
  color: var(--text);
}

.export-map-item.warn {
  color: #92400e;
  background: #fef3c7;
  border-color: #fde68a;
}

.export-map-item.ok {
  color: #166534;
  background: #dcfce7;
  border-color: #bbf7d0;
}


/* v55: resumen del proyecto */
.project-dashboard {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

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

.project-dashboard-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 11px 12px;
}

.project-dashboard-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.project-dashboard-card span {
  display: block;
  font-weight: 950;
  color: var(--text);
}

.project-dashboard-card.ok {
  background: #dcfce7;
  border-color: #bbf7d0;
}

.project-dashboard-card.warn {
  background: #fef3c7;
  border-color: #fde68a;
}

.project-dashboard-card.danger {
  background: #fee2e2;
  border-color: #fecaca;
}

@media (max-width: 520px) {
  .project-dashboard-grid {
    grid-template-columns: 1fr;
  }
}


/* v56: lista de comprobación final */
.final-review-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
  padding: 14px;
  margin: 14px 0;
}

.final-review-box h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.final-review-status {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.final-review-item {
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-weight: 900;
}

.final-review-item.ok {
  color: #166534;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
}

.final-review-item.warn {
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
}


/* v57: notas internas privadas */
.internal-notes-warning {
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.88rem;
  font-weight: 900;
}


/* v58: hoja de ruta y bloque FAQ */
.roadmap-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.roadmap-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px 14px;
}

.roadmap-item h4 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.roadmap-item ul {
  margin: 0;
  padding-left: 20px;
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-item {
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255,255,255,.72);
}

.faq-item h3 {
  margin: 0 0 8px;
}

.faq-item p {
  margin: 0;
}


/* v59: bloques Testimonios y Precios */
.testimonials-list,
.pricing-list {
  display: grid;
  gap: 16px;
}

.testimonials-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.pricing-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.testimonial-card,
.pricing-card {
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 18px;
  padding: 18px;
  background: rgba(255,255,255,.76);
}

.testimonial-card blockquote {
  margin: 0 0 12px;
  font-weight: 750;
  line-height: 1.55;
}

.testimonial-card cite {
  color: var(--muted);
  font-style: normal;
  font-weight: 900;
}

.pricing-card h3 {
  margin: 0 0 8px;
}

.pricing-price {
  font-size: 1.35rem;
  font-weight: 950;
  margin: 0 0 10px;
}

.pricing-card p {
  margin: 0;
}


/* v60: bloques Equipo, Horarios y Proceso */
.team-list,
.schedule-list,
.process-list {
  display: grid;
  gap: 16px;
}

.team-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.team-card,
.schedule-row,
.process-step {
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 18px;
  padding: 18px;
  background: rgba(255,255,255,.76);
}

.team-card h3,
.process-step h3 {
  margin: 0 0 8px;
}

.team-role,
.schedule-day {
  color: var(--muted);
  font-weight: 950;
  margin: 0 0 8px;
}

.schedule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.schedule-hour {
  font-weight: 950;
}

.process-number {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 950;
  margin-bottom: 10px;
}

@media (max-width: 520px) {
  .schedule-row {
    grid-template-columns: 1fr;
  }
}


/* v61: bloques Ubicación y CTA final */
.location-card,
.final-cta-card {
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 20px;
  padding: 22px;
  background: rgba(255,255,255,.78);
}

.location-card p,
.final-cta-card p {
  margin-top: 0;
}

.map-link,
.final-cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 950;
  text-decoration: none;
}

.final-cta-card {
  text-align: center;
}


/* v62: bloques Logos y Datos destacados */
.logos-list,
.stats-list {
  display: grid;
  gap: 14px;
}

.logos-list {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.logo-name-card {
  display: grid;
  place-items: center;
  min-height: 86px;
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 18px;
  background: rgba(255,255,255,.76);
  font-weight: 950;
  text-align: center;
  padding: 14px;
}

.stats-list {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.stat-card {
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 18px;
  background: rgba(255,255,255,.76);
  padding: 18px;
  text-align: center;
}

.stat-number {
  display: block;
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 950;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-weight: 900;
}


/* v63: bloques Recursos y Comparativa */
.resources-list {
  display: grid;
  gap: 14px;
}

.resource-card {
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 18px;
  background: rgba(255,255,255,.76);
  padding: 18px;
}

.resource-card h3 {
  margin: 0 0 8px;
}

.resource-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 950;
  text-decoration: none;
}

.comparison-table-wrap {
  overflow-x: auto;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
  background: rgba(255,255,255,.76);
  border-radius: 18px;
  overflow: hidden;
}

.comparison-table th,
.comparison-table td {
  border: 1px solid rgba(148, 163, 184, .35);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

.comparison-table th {
  background: rgba(15,23,42,.06);
  font-weight: 950;
}

.comparison-table td:first-child,
.comparison-table th:first-child {
  font-weight: 950;
}


/* v64: bloques Timeline y Productos destacados */
.timeline-list {
  display: grid;
  gap: 14px;
  position: relative;
}

.timeline-item {
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 18px;
  background: rgba(255,255,255,.76);
  padding: 18px;
}

.timeline-date {
  display: inline-flex;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(15,23,42,.08);
  color: var(--muted);
  font-weight: 950;
  margin-bottom: 10px;
}

.timeline-item h3 {
  margin: 0 0 8px;
}

.products-list {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.product-card {
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 18px;
  background: rgba(255,255,255,.76);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-card h3 {
  margin: 0;
}

.product-price {
  display: inline-flex;
  align-self: flex-start;
  margin: 0;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(15,23,42,.08);
  color: var(--text);
  font-weight: 950;
}

.product-type {
  display: inline-flex;
  align-self: flex-start;
  margin: 0;
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(37, 99, 235, .12);
  color: var(--primary);
  font-size: .82rem;
  font-weight: 900;
}

.product-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-height: 44px;
  margin-top: auto;
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--primary);
  color: #fff;
  font-weight: 950;
  text-decoration: none;
}

.commerce-external-notice {
  margin: 16px 0 0;
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255,255,255,.72);
  color: var(--muted);
  font-size: .95rem;
  font-weight: 750;
}

.quick-contact {
  z-index: 30;
}

.quick-contact-floating {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: grid;
  gap: 8px;
  justify-items: end;
  max-width: min(320px, calc(100vw - 36px));
}

.quick-contact-normal {
  width: min(1120px, calc(100% - 32px));
  margin: 18px auto;
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 18px;
  background: rgba(255,255,255,.82);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quick-contact-hours {
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(15,23,42,.76);
  color: #fff;
  font-size: .84rem;
  font-weight: 850;
  box-shadow: 0 14px 38px rgba(15,23,42,.16);
}

.quick-contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 999px;
  padding: 12px 18px;
  background: linear-gradient(135deg, #22c55e, #14b8a6);
  color: #04111d;
  font-weight: 950;
  text-decoration: none;
  box-shadow: 0 18px 50px rgba(20,184,166,.22);
}

@media (max-width: 720px) {
  .quick-contact-normal {
    width: calc(100% - 24px);
    flex-direction: column;
    align-items: stretch;
  }

  .quick-contact-normal .quick-contact-button {
    width: 100%;
  }

  .quick-contact-hide-mobile {
    display: none;
  }
}


/* v65: bloques Antes/después y Menú */
.before-after-list,
.menu-list {
  display: grid;
  gap: 16px;
}

.before-after-card,
.menu-item-card {
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 18px;
  background: rgba(255,255,255,.76);
  padding: 18px;
  overflow-wrap: anywhere;
}

.menu-item-card.is-featured {
  border-color: var(--accent);
  box-shadow: 0 22px 70px rgba(37, 99, 235, .16);
}

.menu-item-category,
.menu-chip {
  display: inline-flex;
  max-width: 100%;
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(15,23,42,.08);
  color: var(--muted);
  font-size: .82rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.menu-item-category {
  margin: 0 0 10px;
}

.menu-item-top {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
}

.menu-item-price {
  flex: 0 0 auto;
  color: var(--accent);
  font-weight: 950;
}

.menu-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.menu-allergens .menu-chip {
  background: rgba(180,83,9,.10);
}

.before-after-card h3,
.menu-item-card h3 {
  margin: 0 0 12px;
}

.before-after-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.before-after-column {
  border-radius: 14px;
  background: rgba(15,23,42,.05);
  padding: 12px;
}

.before-after-column strong {
  display: block;
  margin-bottom: 6px;
}

.menu-item-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
}

.menu-item-price {
  flex: 0 0 auto;
  font-weight: 950;
  color: var(--primary);
}

@media (max-width: 620px) {
  .before-after-grid {
    grid-template-columns: 1fr;
  }

  .menu-item-top {
    flex-direction: column;
    gap: 4px;
  }
}


/* v66: vídeo embebido externo */
.embed-video-card {
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 20px;
  background: rgba(255,255,255,.76);
  padding: 18px;
}

.embed-video-description {
  color: var(--muted);
  font-weight: 750;
}

.embed-video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(15,23,42,.08);
  margin-top: 14px;
}

.embed-video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.embed-video-warning {
  margin-top: 12px;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.88rem;
  font-weight: 900;
}


/* v67: atajos internos en Secciones */
.sections-shortcuts {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px;
  margin: 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.96);
  backdrop-filter: blur(10px);
  -webkit-overflow-scrolling: touch;
}

.sections-shortcuts a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  background: #fff;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 950;
  text-decoration: none;
  white-space: nowrap;
}

.sections-shortcuts a:active {
  transform: scale(0.98);
}

.section-anchor {
  scroll-margin-top: 92px;
}

@media (max-width: 700px) {
  .sections-shortcuts {
    top: 0;
    margin-left: -4px;
    margin-right: -4px;
  }

  .section-anchor {
    scroll-margin-top: 110px;
  }
}


/* v68: flechas para atajos internos de Secciones */
.sections-shortcuts-shell {
  position: sticky;
  top: 0;
  z-index: 6;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin: 10px 0 12px;
}

.sections-shortcuts-shell .sections-shortcuts {
  position: static;
  min-width: 0;
  margin: 0;
}

.sections-shortcut-arrow {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #111827;
  font-size: 1.5rem;
  font-weight: 950;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.10);
}

.sections-shortcut-arrow:active {
  transform: scale(0.97);
}

@media (max-width: 700px) {
  .sections-shortcuts-shell {
    grid-template-columns: 1fr;
  }

  .sections-shortcut-arrow {
    display: none;
  }
}


/* v69: personalización visual avanzada */
.visual-advanced-note {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}


/* v71: más controles visuales */
.visual-extra-controls-note {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}


/* v72: modos de exportación */
.export-mode-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
  padding: 14px;
  margin: 14px 0;
}

.export-mode-box h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.export-mode-info {
  border-radius: 12px;
  padding: 10px 12px;
  margin: 10px 0;
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
  font-size: .9rem;
  font-weight: 900;
}


/* v73: paquete de entrega profesional */
.delivery-package-note {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}


/* v74: plantillas propias */
.custom-template-box {
  margin: 14px 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.custom-template-box h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.template-pack-library {
  margin: 14px 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.template-pack-library h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.template-pack-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.template-pack-library-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.template-pack-summary-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  overflow-wrap: anywhere;
}

.template-pack-summary-item span,
.template-pack-summary-item strong {
  display: block;
}

.template-pack-summary-item span {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 950;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.template-pack-summary-item strong {
  margin-top: 4px;
  color: var(--text);
  font-size: .84rem;
  font-weight: 950;
}

.template-pack-summary-item.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.template-pack-summary-item.warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.template-pack-summary-item.danger {
  border-color: #fecaca;
  background: #fef2f2;
}

.template-pack-quality-status {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.template-pack-quality-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 10px;
  background: #fff;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.template-pack-quality-item.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.template-pack-quality-item.warn {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.template-pack-quality-item.danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.template-pack-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: #fff;
  overflow-wrap: anywhere;
}

.template-pack-item.is-applied {
  border-color: rgba(22, 163, 74, .45);
  box-shadow: 0 18px 48px rgba(22, 163, 74, .12);
}

.template-pack-item.level-premium {
  border-color: rgba(37, 99, 235, .32);
  background: linear-gradient(135deg, rgba(37,99,235,.08), rgba(20,184,166,.08));
}

.template-pack-item.level-experimental {
  border-color: rgba(168, 85, 247, .36);
  background: linear-gradient(135deg, rgba(168,85,247,.10), rgba(236,72,153,.08));
}

.template-pack-top {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
}

.template-pack-badges {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.template-pack-top strong,
.template-pack-top span {
  display: block;
}

.template-pack-top span,
.template-pack-item p,
.template-pack-design,
.template-pack-commerce-note,
.template-pack-preview {
  color: var(--muted);
  font-weight: 750;
}

.template-pack-item p {
  margin: 10px 0;
}

.template-pack-design {
  margin: 8px 0;
  font-size: .84rem;
}

.template-pack-base,
.template-pack-state {
  margin: 8px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 10px;
  background: rgba(248, 250, 252, .86);
  color: var(--muted);
  font-size: .84rem;
  font-weight: 900;
}

.template-pack-state.applied {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #166534;
}

.template-pack-meta {
  margin: 8px 0;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 850;
}

.template-pack-commerce-note {
  border: 1px solid rgba(37, 99, 235, .16);
  border-radius: 12px;
  padding: 9px 10px;
  background: rgba(37, 99, 235, .06);
  font-size: .82rem;
}

.template-pack-monetization {
  display: grid;
  gap: 4px;
  margin: 8px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 10px;
  background: rgba(248, 250, 252, .86);
}

.template-pack-purchase {
  margin: 8px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 10px;
  background: rgba(248, 250, 252, .86);
  color: var(--muted);
  font-size: .82rem;
  font-weight: 850;
}

.template-pack-purchase.ready {
  border-color: rgba(37, 99, 235, .22);
  background: rgba(37, 99, 235, .06);
  color: #1e3a8a;
}

.template-pack-purchase.active {
  border-color: rgba(22, 163, 74, .28);
  background: rgba(22, 163, 74, .08);
  color: #166534;
}

.template-pack-monetization span,
.template-pack-monetization strong {
  display: block;
}

.template-pack-monetization span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 950;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.template-pack-monetization strong {
  color: var(--text);
  font-size: .82rem;
  font-weight: 850;
  line-height: 1.35;
}

.template-pack-monetization.ready {
  border-color: rgba(37, 99, 235, .22);
  background: rgba(37, 99, 235, .06);
}

.template-pack-monetization.active {
  border-color: rgba(22, 163, 74, .28);
  background: rgba(22, 163, 74, .08);
}

.template-pack-level {
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(15,23,42,.08);
  color: var(--text);
  font-size: .78rem;
  font-weight: 950;
}

.template-pack-applied {
  border-radius: 999px;
  padding: 5px 9px;
  background: #dcfce7;
  color: #166534;
  font-size: .78rem;
  font-weight: 950;
}

.template-pack-preview {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 9px 10px;
  background: rgba(248,250,252,.82);
  font-size: .84rem;
}

.template-pack-use-btn,
.template-pack-buy-link {
  margin-top: 10px;
}

@media (max-width: 560px) {
  .template-pack-library-summary {
    grid-template-columns: 1fr;
  }
}

.inspired-structure-box {
  margin-top: 16px;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  padding: 12px;
  background: #f8fafc;
}

.inspired-structure-box h3 {
  margin: 0 0 8px;
  font-size: .95rem;
}

.inspired-structure-status {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.inspired-structure-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 10px;
  background: #fff;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.inspired-structure-item.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.inspired-structure-item.warn {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}


/* v75: importar/exportar plantillas propias */
.import-template-label {
  cursor: pointer;
}

.import-template-label input {
  display: none;
}

.import-block-library-label {
  cursor: pointer;
}

.import-block-library-label input {
  display: none;
}


/* v76: auditoría por tipo de web */
.professional-audit-note {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}


/* v77: checklist final por tipo de web */
.final-type-review-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
  padding: 14px;
  margin: 14px 0;
}

.final-type-review-box h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.final-type-checklist-status {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.final-type-checklist-item {
  border-radius: 12px;
  padding: 10px 12px;
  font-size: .9rem;
  font-weight: 900;
  color: #3730a3;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
}


/* v80: diseño temático de plantillas */
.template-theme-note {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

/* v82: navegación interna sincronizada */
html {
  scroll-behavior: smooth;
}

.section,
.hero {
  scroll-margin-top: 96px;
}


/* v84: anclas robustas para navegación interna */
.rwc-section-anchor {
  scroll-margin-top: 110px;
}




/* v87: sincronización preview → edición */
.editor-sync-highlight {
  outline: 3px solid rgba(37, 99, 235, .55);
  outline-offset: 8px;
  border-radius: 18px;
  transition: outline-color .25s ease;
}





/* v89: scroll dividido estricto */
@media (min-width: 901px) {
  .strict-split-scroll-layout {
    min-height: 0 !important;
  }

  .strict-editor-scroll-column,
  .strict-preview-scroll-column {
    min-height: 0 !important;
  }

  .strict-editor-scroll-column {
    scrollbar-gutter: stable;
  }
}


/* v90: sincronización preview-edición reforzada */
.editor-sync-highlight {
  outline: 3px solid rgba(37, 99, 235, .62);
  outline-offset: 8px;
  border-radius: 18px;
}


/* v91: puente preview-edición */
.editor-sync-highlight {
  outline: 3px solid rgba(37, 99, 235, .70);
  outline-offset: 8px;
  border-radius: 18px;
}


/* v96: salud del preview */
.preview-health-status {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.preview-health-item {
  border-radius: 12px;
  padding: 10px 12px;
  font-size: .92rem;
  font-weight: 900;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--text);
}

.preview-health-item.ok {
  background: #dcfce7;
  border-color: #86efac;
  color: #14532d;
}

.preview-health-item.warn {
  background: #fef3c7;
  border-color: #fde68a;
  color: #92400e;
}

.preview-health-item.danger {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}


/* v97: mapa de edición */
.edit-map-status {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.edit-map-item {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) minmax(120px, 1.3fr) minmax(90px, .7fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
  padding: 10px 12px;
  font-size: .9rem;
  font-weight: 850;
}

.edit-map-item strong {
  color: var(--text);
}

.edit-map-item span {
  color: var(--muted);
}

.edit-map-state {
  justify-self: start;
  border-radius: 999px;
  padding: 4px 8px;
  background: #e0f2fe;
  color: #075985;
  font-size: .78rem;
  font-weight: 950;
}

.edit-map-state.off {
  background: #f1f5f9;
  color: #64748b;
}

@media (max-width: 700px) {
  .edit-map-item {
    grid-template-columns: 1fr;
  }
}


/* v98: checklist de estabilidad antes de exportar */
.export-stability-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
  padding: 14px;
  margin: 14px 0;
}

.export-stability-box h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.export-stability-status {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.export-stability-item {
  border-radius: 12px;
  padding: 10px 12px;
  font-size: .9rem;
  font-weight: 900;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--text);
}

.export-stability-item.ok {
  background: #dcfce7;
  border-color: #86efac;
  color: #14532d;
}

.export-stability-item.warn {
  background: #fef3c7;
  border-color: #fde68a;
  color: #92400e;
}

.export-stability-item.danger {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}


/* v99: registro de revisión */
.review-log-status {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
  padding: 12px;
  margin: 12px 0;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .86rem;
  line-height: 1.45;
  color: var(--text);
  max-height: 280px;
  overflow: auto;
}


/* v100: resumen ejecutivo */
.executive-summary-status {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
  padding: 12px;
  margin: 12px 0;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .86rem;
  line-height: 1.45;
  color: var(--text);
  max-height: 260px;
  overflow: auto;
}


/* v102: revisión completa y preparación de exportación */
.full-review-status,
.export-readiness-status {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.full-review-item,
.export-readiness-item {
  border-radius: 12px;
  padding: 10px 12px;
  font-size: .9rem;
  font-weight: 900;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--text);
}

.full-review-item.ok,
.export-readiness-item.ok {
  background: #dcfce7;
  border-color: #86efac;
  color: #14532d;
}

.full-review-item.warn,
.export-readiness-item.warn {
  background: #fef3c7;
  border-color: #fde68a;
  color: #92400e;
}

.full-review-item.danger,
.export-readiness-item.danger {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

.export-prepare-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
  padding: 14px;
  margin: 14px 0;
}

.export-prepare-box h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}


/* v103: editor rápido de textos */
.quick-text-editor-card {
  border: 2px solid rgba(37, 99, 235, .22);
  background: linear-gradient(180deg, rgba(239, 246, 255, .75), rgba(255, 255, 255, .92));
}

.quick-text-editor-fields {
  display: grid;
  gap: 12px;
  margin: 12px 0;
}

.quick-text-editor-fields .field textarea {
  min-height: 90px;
}

.quick-text-editor-note {
  border-radius: 12px;
  padding: 10px 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  font-weight: 850;
  font-size: .9rem;
}

.quick-text-editor-status {
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  font-weight: 800;
  font-size: .88rem;
}

.quick-text-editor-status.ok {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #166534;
}

.quick-text-editor-status.warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.quick-text-editor-summary {
  border-radius: 12px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.quick-text-editor-summary.ok {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #166534;
}

.quick-text-editor-summary.warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.quick-text-editor-route {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #f8fafc;
  color: #334155;
  padding: 10px 12px;
  font-size: .88rem;
  font-weight: 800;
}

.quick-text-editor-route .secondary-btn {
  white-space: nowrap;
}

.page-export-status {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 14px;
  margin: 12px 0 4px;
  color: var(--muted);
  background: #f8fafc;
  font-size: .9rem;
  font-weight: 800;
  line-height: 1.35;
}

.page-export-status.ok {
  border-color: #bbf7d0;
  color: #166534;
  background: #f0fdf4;
}

.page-export-status.warn {
  border-color: #fde68a;
  color: #92400e;
  background: #fffbeb;
}

.block-library-card {
  border-color: rgba(37, 99, 235, 0.22);
}

.block-library-examples {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 12px;
  border: 1px dashed rgba(37, 99, 235, 0.28);
  border-radius: 14px;
  background: #f8fbff;
}

.block-library-examples h3 {
  margin: 0;
  font-size: 1rem;
}

.block-library-status.ok {
  color: #166534;
}

.block-library-status.warn {
  color: #92400e;
}

.block-library-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.block-library-item,
.block-library-empty {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #f9fafb;
}

.block-library-item {
  display: grid;
  gap: 4px;
  min-height: 44px;
  cursor: pointer;
  touch-action: manipulation;
}

.block-library-item:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.42);
  outline-offset: 2px;
}

.block-library-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.block-library-type,
.block-library-tag {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(37, 99, 235, .10);
  color: #1d4ed8;
  font-size: .78rem;
  font-weight: 900;
}

.block-library-type {
  background: rgba(15, 23, 42, .08);
  color: #111827;
}

.block-library-item.active {
  border-color: rgba(37, 99, 235, 0.45);
  background: #eff6ff;
}

.block-library-item strong,
.block-library-item span,
.block-library-empty {
  overflow-wrap: anywhere;
}

.block-library-item span,
.block-library-empty {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.block-library-item .block-library-meta {
  color: inherit;
}

.block-library-item .block-library-type {
  color: #111827;
  font-size: .78rem;
  font-weight: 900;
}

.block-library-item .block-library-tag {
  color: #1d4ed8;
  font-size: .78rem;
  font-weight: 900;
}

@media (max-width: 720px) {
  .quick-text-editor-route {
    grid-template-columns: 1fr;
  }
}


/* v104: salto de preview desde editor rápido */
.rwc-preview-section-highlight {
  outline: 3px solid rgba(37, 99, 235, .55);
  outline-offset: 8px;
  border-radius: 18px;
}


/* v108: editor rápido por tarjetas */
.quick-repeat-editor {
  display: grid;
  gap: 12px;
}

.quick-repeat-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}

.quick-repeat-card-title {
  margin: 0 0 10px;
  font-size: .95rem;
  font-weight: 950;
  color: var(--text);
}

.quick-repeat-editor-toolbar {
  display: grid;
  margin-bottom: 2px;
}

.quick-repeat-card-header {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.quick-repeat-card-header .quick-repeat-card-title {
  margin: 0;
}

.quick-repeat-card-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-repeat-tool-btn {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: #fff;
  color: var(--text);
  font-size: .82rem;
  font-weight: 900;
}

.quick-repeat-tool-btn.danger {
  color: var(--danger);
  border-color: #fecaca;
  background: var(--danger-soft);
}

.quick-repeat-card .field {
  margin: 0 0 10px;
}

.quick-repeat-card .field:last-child {
  margin-bottom: 0;
}

.quick-repeat-card textarea {
  min-height: 84px;
}


/* v109: saneamiento UX del Editor rápido */
.quick-text-editor-card {
  position: relative;
  overflow: visible;
}

.quick-text-editor-top-actions {
  display: grid;
  gap: 8px;
  margin: 10px 0 10px;
}

.quick-text-editor-top-actions .primary-btn {
  width: 100%;
}

.quick-text-editor-actions {
  position: sticky;
  bottom: 10px;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, .5);
  border-radius: 16px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 16px 36px rgba(15, 23, 42, .16);
  backdrop-filter: blur(10px);
}

.quick-text-editor-actions .primary-btn,
.quick-text-editor-actions .secondary-btn {
  width: 100%;
}

.quick-text-editor-fields {
  padding-bottom: 12px;
}

.quick-text-editor-fields .field {
  margin-bottom: 10px;
}

.quick-text-editor-fields .field textarea {
  min-height: 72px;
  max-height: 180px;
  resize: vertical;
}

.quick-repeat-editor {
  gap: 10px;
}

.quick-repeat-card {
  padding: 10px;
  border-radius: 14px;
}

.quick-repeat-card-title {
  margin-bottom: 8px;
}

.quick-repeat-card .field {
  margin-bottom: 8px;
}

.quick-repeat-card textarea {
  min-height: 68px;
  max-height: 150px;
  resize: vertical;
}

@media (max-width: 700px) {
  .quick-text-editor-actions {
    bottom: 8px;
  }
}


/* v110: botonera siempre visible del Editor rápido */
.quick-text-editor-card {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 178px);
  min-height: 420px;
  overflow: hidden !important;
}

.quick-text-editor-card > .field,
.quick-text-editor-card > .small-note,
.quick-text-editor-card > .quick-text-editor-top-actions {
  flex: 0 0 auto;
}

.quick-text-editor-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
  padding-bottom: 12px;
}

.quick-text-editor-actions {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 100;
  flex: 0 0 auto;
  margin: 10px -2px 0;
  padding: 10px;
  border: 1px solid rgba(37, 99, 235, .24);
  border-radius: 16px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 -12px 30px rgba(15, 23, 42, .18);
  backdrop-filter: blur(12px);
}

.quick-text-editor-actions::before {
  content: "Acciones";
  display: block;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.quick-text-editor-actions .primary-btn,
.quick-text-editor-actions .secondary-btn {
  min-height: 44px;
}

.quick-text-editor-top-actions {
  margin: 8px 0;
}

.quick-text-editor-top-actions .primary-btn {
  min-height: 44px;
}

@media (max-width: 900px) {
  .quick-text-editor-card {
    max-height: none;
    overflow: visible !important;
  }

  .quick-text-editor-body {
    overflow: visible;
  }

  .quick-text-editor-actions {
    position: sticky !important;
    bottom: 8px !important;
  }
}


/* v114: botonera principal siempre visible */
@media (min-width: 901px) {
  .panel.strict-editor-scroll-column {
    position: relative;
    padding-top: 0;
  }

  .panel .tabs-scroll-shell {
    position: sticky !important;
    top: 0 !important;
    z-index: 5000 !important;
    margin: -2px 0 8px !important;
    padding: 10px 0 10px !important;
    background: linear-gradient(180deg, rgba(243,244,246,.98), rgba(243,244,246,.94));
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(226, 232, 240, .9);
  }

  .panel .tabs-scroll-hint {
    position: sticky !important;
    top: 62px !important;
    z-index: 4999 !important;
    margin: 0 0 12px !important;
    padding: 0 0 8px !important;
    background: rgba(243,244,246,.94);
    backdrop-filter: blur(14px);
  }

  .panel .tabs-scroll-shell .editor-tabs {
    position: static !important;
    top: auto !important;
  }
}

@media (max-width: 900px) {
  .panel .tabs-scroll-shell {
    position: sticky !important;
    top: 0 !important;
    z-index: 5000 !important;
    padding: 8px 0 !important;
    background: rgba(243,244,246,.98);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(226, 232, 240, .9);
  }
}


/* v158.1: Vista cliente debe quedar por encima de la botonera fija del editor */
body.client-review-active .topbar,
body.client-review-active .panel,
body.client-review-active .floating-help-btn,
body.client-review-active .preview-shell {
  display: none !important;
}

body.client-review-active .layout {
  display: block;
  padding: 0;
  min-height: 100vh;
}

body.client-review-active .client-review-overlay {
  z-index: 10000 !important;
}

.visual-effects-control-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 10px 0 18px;
}

.visual-effects-status {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.visual-effect-check {
  min-height: 44px;
  align-items: center;
}

.advanced-effects-details {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: #f9fafb;
  margin: 0 0 18px;
}

.advanced-effects-details summary {
  cursor: pointer;
  font-weight: 950;
  color: var(--ink);
}

.advanced-effects-details .field {
  margin-top: 12px;
}


/* v255: el buscador del editor debe quedar siempre por encima de las pestañas */
.panel .editor-control-search {
  display: block !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 5105 !important;
  min-height: 112px;
  margin: 0 0 10px !important;
  padding: 12px !important;
  overflow: visible !important;
  background: var(--topbar-bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.panel .editor-control-search-field {
  display: grid !important;
  gap: 8px !important;
  margin: 0 !important;
}

.panel .editor-control-search-field span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel .editor-control-search-field small {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--muted);
  background: var(--button-bg);
  font-size: .72rem;
  font-weight: 900;
  white-space: nowrap;
}

.panel #editorControlSearchInput {
  display: block !important;
  position: relative !important;
  z-index: 1 !important;
  min-height: 48px;
  margin: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
  background: var(--input-bg);
  color: var(--text);
}

.panel .editor-control-search-results {
  position: relative;
  z-index: 2;
}

.panel .tabs-scroll-shell {
  top: 122px !important;
}

.panel .tabs-scroll-hint {
  top: 184px !important;
}


/* v307: contraste fiable del editor en tema oscuro */
html[data-app-theme="dark"] .primary-btn {
  color: #06111f;
  background: linear-gradient(135deg, #67e8f9, #22d3ee);
}

@media (hover: hover) and (pointer: fine) {
  html[data-app-theme="dark"] .primary-btn:hover {
    background: linear-gradient(135deg, #a7f3d0, #67e8f9);
  }
}

html[data-app-theme="dark"] .secondary-btn,
html[data-app-theme="dark"] .device-btn,
html[data-app-theme="dark"] .upload-btn,
html[data-app-theme="dark"] .tab-btn {
  color: #f8fafc;
  background: #111827;
  border-color: rgba(226, 232, 240, 0.24);
}

html[data-app-theme="dark"] .device-btn.active,
html[data-app-theme="dark"] .tab-btn.active,
html[data-app-theme="dark"] .help-section-btn.active {
  color: #07111f;
  background: #f8fafc;
  border-color: #f8fafc;
}

html[data-app-theme="dark"] .sync-preview-btn,
html[data-app-theme="dark"] .client-review-btn {
  color: #052e16;
  background: #bbf7d0;
  border-color: #86efac;
}

html[data-app-theme="dark"] .preview-fullscreen-btn {
  color: #172554;
  background: #dbeafe;
  border-color: #bfdbfe;
}

html[data-app-theme="dark"] .preview-fullscreen-btn.is-active {
  color: #06111f;
  background: #67e8f9;
  border-color: #67e8f9;
}

html[data-app-theme="dark"] .tabs-scroll-shell,
html[data-app-theme="dark"] .panel .tabs-scroll-shell {
  background: linear-gradient(180deg, rgba(9, 13, 24, 0.98), rgba(15, 23, 42, 0.95)) !important;
  border-bottom-color: rgba(226, 232, 240, 0.16) !important;
}

html[data-app-theme="dark"] .panel .tabs-scroll-hint {
  background: rgba(9, 13, 24, 0.94) !important;
}

html[data-app-theme="dark"] .tabs-scroll-hint span {
  color: #dbeafe;
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(226, 232, 240, 0.22);
}

html[data-app-theme="dark"] .tabs-scroll-arrow {
  color: #f8fafc;
  background: #111827;
  border-color: rgba(226, 232, 240, 0.24);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

html[data-app-theme="dark"] .services-description-editor,
html[data-app-theme="dark"] .advanced-effects-details,
html[data-app-theme="dark"] .help-section details,
html[data-app-theme="dark"] .changelog-item,
html[data-app-theme="dark"] .inspired-structure-box {
  color: #f8fafc;
  background: #111827;
  border-color: rgba(226, 232, 240, 0.18);
}

html[data-app-theme="dark"] .template-pack-summary-item,
html[data-app-theme="dark"] .template-pack-quality-item,
html[data-app-theme="dark"] .template-pack-item {
  color: #f8fafc;
  background: #111827;
  border-color: rgba(226, 232, 240, 0.20);
}

html[data-app-theme="dark"] .template-pack-item.is-applied {
  border-color: rgba(134, 239, 172, 0.55);
  box-shadow: 0 18px 48px rgba(34, 197, 94, 0.16);
}

html[data-app-theme="dark"] .template-pack-item.level-premium {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(8, 47, 73, 0.72));
  border-color: rgba(103, 232, 249, 0.42);
}

html[data-app-theme="dark"] .template-pack-item.level-experimental {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.94), rgba(80, 7, 36, 0.64));
  border-color: rgba(216, 180, 254, 0.42);
}

html[data-app-theme="dark"] .template-pack-top span,
html[data-app-theme="dark"] .template-pack-item p,
html[data-app-theme="dark"] .template-pack-meta,
html[data-app-theme="dark"] .template-pack-design,
html[data-app-theme="dark"] .template-pack-base,
html[data-app-theme="dark"] .template-pack-state,
html[data-app-theme="dark"] .template-pack-monetization,
html[data-app-theme="dark"] .template-pack-purchase,
html[data-app-theme="dark"] .template-pack-commerce-note,
html[data-app-theme="dark"] .template-pack-preview {
  color: #dbeafe;
}

html[data-app-theme="dark"] .template-pack-summary-item span {
  color: #cbd5e1;
}

html[data-app-theme="dark"] .template-pack-summary-item strong {
  color: #f8fafc;
}

html[data-app-theme="dark"] .template-pack-design,
html[data-app-theme="dark"] .template-pack-base,
html[data-app-theme="dark"] .template-pack-state,
html[data-app-theme="dark"] .template-pack-monetization,
html[data-app-theme="dark"] .template-pack-purchase,
html[data-app-theme="dark"] .template-pack-commerce-note,
html[data-app-theme="dark"] .template-pack-preview {
  background: rgba(15, 23, 42, 0.76);
  border-color: rgba(226, 232, 240, 0.18);
}

html[data-app-theme="dark"] .template-pack-monetization span {
  color: #bfdbfe;
}

html[data-app-theme="dark"] .template-pack-monetization strong {
  color: #f8fafc;
}

html[data-app-theme="dark"] .template-pack-monetization.ready {
  background: rgba(30, 64, 175, 0.24);
  border-color: rgba(147, 197, 253, 0.28);
}

html[data-app-theme="dark"] .template-pack-monetization.active {
  background: rgba(20, 83, 45, 0.26);
  border-color: rgba(134, 239, 172, 0.30);
}

html[data-app-theme="dark"] .template-pack-purchase.ready {
  background: rgba(30, 64, 175, 0.24);
  border-color: rgba(147, 197, 253, 0.28);
  color: #bfdbfe;
}

html[data-app-theme="dark"] .template-pack-purchase.active {
  background: rgba(20, 83, 45, 0.26);
  border-color: rgba(134, 239, 172, 0.30);
  color: #bbf7d0;
}

html[data-app-theme="dark"] .template-pack-state.applied {
  background: rgba(20, 83, 45, 0.26);
  border-color: rgba(134, 239, 172, 0.30);
  color: #bbf7d0;
}

html[data-app-theme="dark"] .template-pack-top .template-pack-level {
  color: #07111f;
  background: #e2e8f0;
}

html[data-app-theme="dark"] .template-pack-applied {
  color: #052e16;
  background: #bbf7d0;
}

html[data-app-theme="dark"] .template-pack-summary-item.ok {
  background: rgba(20, 83, 45, 0.34);
  border-color: rgba(134, 239, 172, 0.32);
}

html[data-app-theme="dark"] .template-pack-summary-item.warn {
  background: rgba(120, 53, 15, 0.34);
  border-color: rgba(253, 230, 138, 0.32);
}

html[data-app-theme="dark"] .template-pack-summary-item.danger {
  background: rgba(127, 29, 29, 0.34);
  border-color: rgba(254, 202, 202, 0.32);
}

html[data-app-theme="dark"] .template-pack-quality-item.ok {
  color: #bbf7d0;
  background: rgba(20, 83, 45, 0.34);
  border-color: rgba(134, 239, 172, 0.32);
}

html[data-app-theme="dark"] .template-pack-quality-item.warn {
  color: #fde68a;
  background: rgba(120, 53, 15, 0.34);
  border-color: rgba(253, 230, 138, 0.32);
}

html[data-app-theme="dark"] .template-pack-quality-item.danger {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.34);
  border-color: rgba(254, 202, 202, 0.32);
}

html[data-app-theme="dark"] .help-section-btn {
  color: #f8fafc;
  background: #111827;
  border-color: rgba(226, 232, 240, 0.24);
}

html[data-app-theme="dark"] body.preview-fullscreen-active .preview-toolbar {
  background: rgba(15, 23, 42, 0.96);
}


/* v308: superficies completas del editor legibles en tema oscuro */
html[data-app-theme="dark"] .asset-preview,
html[data-app-theme="dark"] .asset-settings,
html[data-app-theme="dark"] .asset-stat,
html[data-app-theme="dark"] .help-card details,
html[data-app-theme="dark"] .section-order-item,
html[data-app-theme="dark"] .section-order-btn,
html[data-app-theme="dark"] .page-item,
html[data-app-theme="dark"] .page-select-btn,
html[data-app-theme="dark"] .page-move-btn,
html[data-app-theme="dark"] .export-map-box,
html[data-app-theme="dark"] .export-map-item,
html[data-app-theme="dark"] .project-dashboard-card,
html[data-app-theme="dark"] .final-review-box,
html[data-app-theme="dark"] .roadmap-item,
html[data-app-theme="dark"] .export-mode-box,
html[data-app-theme="dark"] .inspired-structure-status,
html[data-app-theme="dark"] .final-type-review-box,
html[data-app-theme="dark"] .final-type-checklist-item,
html[data-app-theme="dark"] .preview-health-item,
html[data-app-theme="dark"] .edit-map-item,
html[data-app-theme="dark"] .export-stability-box,
html[data-app-theme="dark"] .export-stability-item,
html[data-app-theme="dark"] .review-log-status,
html[data-app-theme="dark"] .executive-summary-status,
html[data-app-theme="dark"] .full-review-item,
html[data-app-theme="dark"] .export-readiness-item,
html[data-app-theme="dark"] .export-prepare-box,
html[data-app-theme="dark"] .quick-text-editor-card,
html[data-app-theme="dark"] .quick-text-editor-status,
html[data-app-theme="dark"] .quick-text-editor-summary,
html[data-app-theme="dark"] .quick-text-editor-route,
html[data-app-theme="dark"] .page-export-status,
html[data-app-theme="dark"] .block-library-examples,
html[data-app-theme="dark"] .block-library-item,
html[data-app-theme="dark"] .block-library-empty,
html[data-app-theme="dark"] .visual-effects-status,
html[data-app-theme="dark"] .readiness-traffic-panel,
html[data-app-theme="dark"] .readiness-traffic-score,
html[data-app-theme="dark"] .readiness-state-step,
html[data-app-theme="dark"] .readiness-traffic-metrics span,
html[data-app-theme="dark"] .readiness-action-plan,
html[data-app-theme="dark"] .readiness-area-cell,
html[data-app-theme="dark"] .gallery-thumb {
  color: #f8fafc;
  background: #111827;
  border-color: rgba(226, 232, 240, 0.20);
}

html[data-app-theme="dark"] .quick-text-editor-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.96));
}

html[data-app-theme="dark"] .help-card p,
html[data-app-theme="dark"] .help-card li,
html[data-app-theme="dark"] .asset-preview,
html[data-app-theme="dark"] .asset-stat,
html[data-app-theme="dark"] .section-order-state,
html[data-app-theme="dark"] .page-item-slug,
html[data-app-theme="dark"] .post-meta,
html[data-app-theme="dark"] .project-dashboard-card strong,
html[data-app-theme="dark"] .edit-map-item span,
html[data-app-theme="dark"] .quick-text-editor-status,
html[data-app-theme="dark"] .page-export-status,
html[data-app-theme="dark"] .block-library-empty,
html[data-app-theme="dark"] .small-note,
html[data-app-theme="dark"] .field-help,
html[data-app-theme="dark"] .delivery-package-note,
html[data-app-theme="dark"] .visual-advanced-note,
html[data-app-theme="dark"] .visual-extra-controls-note,
html[data-app-theme="dark"] .professional-audit-note,
html[data-app-theme="dark"] .readiness-traffic-title span,
html[data-app-theme="dark"] .readiness-traffic-title em,
html[data-app-theme="dark"] .readiness-traffic-score span,
html[data-app-theme="dark"] .quick-text-editor-note,
html[data-app-theme="dark"] .quick-text-editor-actions::before {
  color: #cbd5e1;
}

html[data-app-theme="dark"] .project-dashboard-card span,
html[data-app-theme="dark"] .edit-map-item strong,
html[data-app-theme="dark"] .roadmap-item h4,
html[data-app-theme="dark"] .help-card summary,
html[data-app-theme="dark"] .export-map-box h3,
html[data-app-theme="dark"] .final-review-box h3,
html[data-app-theme="dark"] .export-mode-box h3,
html[data-app-theme="dark"] .export-prepare-box h3,
html[data-app-theme="dark"] .block-library-examples h3 {
  color: #f8fafc;
}

html[data-app-theme="dark"] .image-format-guide,
html[data-app-theme="dark"] .checklist-item.ok,
html[data-app-theme="dark"] .audit-item.ok,
html[data-app-theme="dark"] .client-review-status.ok,
html[data-app-theme="dark"] .media-weight-status.ok,
html[data-app-theme="dark"] .video-compatibility-status.ok,
html[data-app-theme="dark"] .project-quality-status.ok,
html[data-app-theme="dark"] .editable-audit-status.ok,
html[data-app-theme="dark"] .export-map-item.ok,
html[data-app-theme="dark"] .project-dashboard-card.ok,
html[data-app-theme="dark"] .final-review-item.ok,
html[data-app-theme="dark"] .preview-health-item.ok,
html[data-app-theme="dark"] .export-stability-item.ok,
html[data-app-theme="dark"] .full-review-item.ok,
html[data-app-theme="dark"] .export-readiness-item.ok,
html[data-app-theme="dark"] .quick-text-editor-status.ok,
html[data-app-theme="dark"] .quick-text-editor-summary.ok,
html[data-app-theme="dark"] .page-export-status.ok,
html[data-app-theme="dark"] .readiness-traffic-panel.ok,
html[data-app-theme="dark"] .readiness-state-step.ok.is-active,
html[data-app-theme="dark"] .readiness-action-plan.ok,
html[data-app-theme="dark"] .readiness-area-cell.ok {
  color: #bbf7d0;
  background: rgba(20, 83, 45, 0.36);
  border-color: rgba(134, 239, 172, 0.42);
}

html[data-app-theme="dark"] .checklist-item.warn,
html[data-app-theme="dark"] .audit-item.warn,
html[data-app-theme="dark"] .client-review-status.warn,
html[data-app-theme="dark"] .media-weight-status.warn,
html[data-app-theme="dark"] .video-compatibility-status.warn,
html[data-app-theme="dark"] .project-quality-status.warn,
html[data-app-theme="dark"] .editable-audit-status.warn,
html[data-app-theme="dark"] .asset-stat.warn,
html[data-app-theme="dark"] .export-map-item.warn,
html[data-app-theme="dark"] .project-dashboard-card.warn,
html[data-app-theme="dark"] .final-review-item.warn,
html[data-app-theme="dark"] .internal-notes-warning,
html[data-app-theme="dark"] .preview-health-item.warn,
html[data-app-theme="dark"] .export-stability-item.warn,
html[data-app-theme="dark"] .full-review-item.warn,
html[data-app-theme="dark"] .export-readiness-item.warn,
html[data-app-theme="dark"] .quick-text-editor-status.warn,
html[data-app-theme="dark"] .quick-text-editor-summary.warn,
html[data-app-theme="dark"] .page-export-status.warn,
html[data-app-theme="dark"] .readiness-traffic-panel.warn,
html[data-app-theme="dark"] .readiness-state-step.warn.is-active,
html[data-app-theme="dark"] .readiness-action-plan.warn,
html[data-app-theme="dark"] .readiness-area-cell.warn {
  color: #fde68a;
  background: rgba(120, 53, 15, 0.36);
  border-color: rgba(253, 230, 138, 0.42);
}

html[data-app-theme="dark"] .checklist-item.error,
html[data-app-theme="dark"] .audit-item.danger,
html[data-app-theme="dark"] .client-review-status.danger,
html[data-app-theme="dark"] .media-weight-status.danger,
html[data-app-theme="dark"] .video-compatibility-status.danger,
html[data-app-theme="dark"] .project-quality-status.danger,
html[data-app-theme="dark"] .editable-audit-status.danger,
html[data-app-theme="dark"] .asset-stat.danger,
html[data-app-theme="dark"] .project-dashboard-card.danger,
html[data-app-theme="dark"] .preview-health-item.danger,
html[data-app-theme="dark"] .export-stability-item.danger,
html[data-app-theme="dark"] .full-review-item.danger,
html[data-app-theme="dark"] .export-readiness-item.danger,
html[data-app-theme="dark"] .readiness-traffic-panel.danger,
html[data-app-theme="dark"] .readiness-state-step.danger.is-active,
html[data-app-theme="dark"] .readiness-action-plan.danger,
html[data-app-theme="dark"] .readiness-area-cell.danger {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.38);
  border-color: rgba(254, 202, 202, 0.42);
}

html[data-app-theme="dark"] .export-mode-info,
html[data-app-theme="dark"] .quick-text-editor-note {
  color: #bfdbfe;
  background: rgba(30, 64, 175, 0.24);
  border-color: rgba(147, 197, 253, 0.34);
}

html[data-app-theme="dark"] .edit-map-state {
  color: #bae6fd;
  background: rgba(7, 89, 133, 0.45);
}

html[data-app-theme="dark"] .edit-map-state.off {
  color: #cbd5e1;
  background: rgba(71, 85, 105, 0.44);
}

html[data-app-theme="dark"] .sections-shortcuts a,
html[data-app-theme="dark"] .sections-shortcut-arrow {
  color: #f8fafc;
  background: #111827;
  border-color: rgba(226, 232, 240, 0.24);
}

html[data-app-theme="dark"] button:disabled,
html[data-app-theme="dark"] .section-order-btn:disabled,
html[data-app-theme="dark"] .page-move-btn:disabled {
  color: #94a3b8;
  opacity: 0.62;
}

html[data-app-theme="dark"] .help-overlay-panel,
html[data-app-theme="dark"] .help-overlay-content,
html[data-app-theme="dark"] .help-overlay-tabs {
  color: #f8fafc;
  background: #090d18;
  border-color: rgba(226, 232, 240, 0.16);
}

html[data-app-theme="dark"] .help-overlay-header {
  color: #f8fafc;
  background: #111827;
  border-color: rgba(226, 232, 240, 0.16);
}

html[data-app-theme="dark"] .help-section h3,
html[data-app-theme="dark"] .tutorial-help h4 {
  color: #f8fafc;
}

html[data-app-theme="dark"] .help-section p,
html[data-app-theme="dark"] .help-section li,
html[data-app-theme="dark"] .help-search-status {
  color: #cbd5e1;
}

html[data-app-theme="dark"] .roadmap-item {
  background: #111827;
}
