/* 
 * Fuji Recipe Lab — Alejandro Ortiz (imalexortiz.com)
 * Estética editorial de viaje, minimalismo fotográfico, UI a medida.
 */



:root {
  color-scheme: light;
  --bg-page: #f8f8f4;         /* Papel marfil suave característico de imalexortiz.com */
  --bg-card: #ffffff;
  --bg-subtle: #f1f1eb;
  --bg-tile: #f5f5f0;
  --fg-main: #181a1b;
  --fg-muted: #64686c;
  --border-line: #e3e3dc;
  --border-focus: #181a1b;
  --gold-accent: #c9933b;     /* Acento dorado cálido de viaje */
  --gold-hover: #b3802e;
  --green-pro: #16a34a;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow-card: 0 4px 24px -6px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 8px 30px -8px rgba(0, 0, 0, 0.12);
  --font-serif: "Fraunces", Georgia, serif;
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23181a1b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg-page: #0b0d10;       /* Grafito profundo */
    --bg-card: #13171d;
    --bg-subtle: #1c212a;
    --bg-tile: #1a1e26;
    --fg-main: #f2f4f7;
    --fg-muted: #9aa1a9;
    --border-line: #262c36;
    --border-focus: #f2f4f7;
    --gold-accent: #e5a947;
    --gold-hover: #f5bc5e;
    --green-pro: #4ade80;
    --shadow-card: 0 6px 30px -8px rgba(0, 0, 0, 0.45);
    --shadow-hover: 0 12px 40px -8px rgba(0, 0, 0, 0.6);
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f2f4f7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-page: #0b0d10;
  --bg-card: #13171d;
  --bg-subtle: #1c212a;
  --bg-tile: #1a1e26;
  --fg-main: #f2f4f7;
  --fg-muted: #9aa1a9;
  --border-line: #262c36;
  --border-focus: #f2f4f7;
  --gold-accent: #e5a947;
  --gold-hover: #f5bc5e;
  --green-pro: #4ade80;
  --shadow-card: 0 6px 30px -8px rgba(0, 0, 0, 0.45);
  --shadow-hover: 0 12px 40px -8px rgba(0, 0, 0, 0.6);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f2f4f7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--bg-page);
  color: var(--fg-main);
  font: 400 1rem/1.6 var(--font-sans);
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
}

.ao-container {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 28px;
}

/* Tipografía de Encabezados */
h1, h2, h3, h4 { margin: 0; font-weight: 600; color: var(--fg-main); letter-spacing: -0.025em; }

p { margin: 0 0 12px; }
.hint { color: var(--fg-muted); font-size: 0.875rem; line-height: 1.55; }
hr { border: 0; border-top: 1px solid var(--border-line); margin: 28px 0; }

kbd {
  font: 0.8125rem var(--font-mono);
  padding: 2px 6px;
  border: 1px solid var(--border-line);
  background: var(--bg-subtle);
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute; left: 16px; top: -60px;
  padding: 10px 18px;
  background: var(--fg-main); color: var(--bg-page);
  border-radius: var(--radius-sm);
  z-index: 1000;
}
.skip-link:focus { top: 16px; }

:focus-visible { outline: 2px solid var(--fg-main); outline-offset: 2px; }

/* ---------- Barra Superior (Header imalexortiz.com) ---------- */

.ao-nav {
  border-bottom: 1px solid var(--border-line);
  background: var(--bg-page);
  position: sticky; top: 0;
  z-index: 99;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.ao-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 20px;
}
.ao-brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ao-logo {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--fg-main);
  text-decoration: none;
  transition: opacity 0.15s;
}
.ao-logo:hover { opacity: 0.75; }
.ao-lab-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  background: var(--gold-accent);
  color: #121417;
  border-radius: var(--radius-sm);
}

.ao-menu-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.ao-menu-links a {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.15s;
}
.ao-menu-links a:hover, .ao-menu-links a.is-active {
  color: var(--fg-main);
}
.ao-menu-links a.is-active { font-weight: 600; }

.ao-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Badge de Licencia / Modo */
.license-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition:transform 0.2s ease,opacity 0.2s ease,background-color 0.2s ease,color 0.2s ease,border-color 0.2s ease;
  user-select: none;
  border: 1px solid transparent;
}
.license-badge.is-demo {
  background: rgba(201, 147, 59, 0.14);
  color: var(--gold-accent);
  border-color: rgba(201, 147, 59, 0.35);
}
.license-badge.is-demo:hover {
  background: rgba(201, 147, 59, 0.24);
  transform: translateY(-1px);
}
.license-badge.is-pro {
  background: rgba(22, 163, 74, 0.14);
  color: var(--green-pro);
  border-color: rgba(22, 163, 74, 0.35);
}

.lang-switch-btn {
  background: transparent;
  border: 1px solid var(--border-line);
  color: var(--fg-main);
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition:transform 0.15s ease,opacity 0.15s ease,background-color 0.15s ease,color 0.15s ease,border-color 0.15s ease;
}
.lang-switch-btn:hover { background: var(--bg-subtle); }

.theme-icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-line);
  background: transparent;
  color: var(--fg-main);
  display: grid; place-items: center;
  cursor: pointer;
  transition:transform 0.15s ease,opacity 0.15s ease,background-color 0.15s ease,color 0.15s ease,border-color 0.15s ease;
}
.theme-icon-btn:hover { background: var(--bg-subtle); }
.theme-icon-btn .theme-sun { display: block; }
.theme-icon-btn .theme-moon { display: none; }
:root[data-theme="dark"] .theme-icon-btn .theme-sun { display: none; }
:root[data-theme="dark"] .theme-icon-btn .theme-moon { display: block; }

/* ---------- Hero Editorial ---------- */

.ao-hero {
  padding: 44px 0 28px;
  border-bottom: 1px solid var(--border-line);
}
.ao-hero-content {
  max-width: 820px;
}
.ao-eyebrow {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--gold-accent);
  margin-bottom: 6px;
}
.ao-title {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.ao-desc {
  font-size: 1.0625rem;
  color: var(--fg-muted);
  line-height: 1.6;
  max-width: 72ch;
  margin: 0;
}

/* Barra de Colección Rápida */
.ao-quickbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px dashed var(--border-line);
}
.ao-quick-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.ao-quick-label {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
  margin-right: 4px;
}
.preset-chip {
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  color: var(--fg-main);
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition:transform 0.15s ease,opacity 0.15s ease,background-color 0.15s ease,color 0.15s ease,border-color 0.15s ease;
}
.preset-chip:hover {
  background: var(--bg-subtle);
  border-color: var(--fg-main);
  transform: translateY(-1px);
}
.preset-chip.is-featured {
  border-color: var(--gold-accent);
  color: var(--gold-accent);
}

.ao-quick-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Cajón de Importación */
.ao-import-drawer {
  padding: 24px 0;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-line);
  animation: fadeIn 0.2s ease;
}
.import-box {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 24px;
  border: 1px solid var(--border-line);
}
.dropzone {
  border: 2px dashed var(--border-line);
  border-radius: var(--radius-md);
  padding: 28px;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
}
.dropzone.is-dragover { border-color: var(--gold-accent); background: var(--bg-subtle); }
.status-line { margin-top: 12px; font-weight: 500; font-size: 0.875rem; min-height: 1.4em; }
.status-line.is-error { color: #ef4444; }

/* ---------- Espacio Principal (Studio Workspace) ---------- */

.studio-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding-top: 36px;
  padding-bottom: 60px;
}

@media (min-width: 1040px) {
  .studio-workspace {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    align-items: start;
  }
}

/* Panel Izquierdo: Monitor de Revelado */
.studio-viewport-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.header-titles {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.header-titles h2 {
  font-size: 1.1875rem;
  font-weight: 700;
}
.recipe-sim-tag {
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 3px 10px;
  background: var(--bg-tile);
  color: var(--gold-accent);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-line);
}

.view-mode-selector {
  display: inline-flex;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-line);
}
.mode-btn {
  background: transparent;
  border: 0;
  color: var(--fg-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition:transform 0.15s ease,opacity 0.15s ease,background-color 0.15s ease,color 0.15s ease,border-color 0.15s ease;
}
.mode-btn:hover { color: var(--fg-main); }
.mode-btn.is-active {
  background: var(--bg-card);
  color: var(--fg-main);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Lienzo Canvas */
.canvas-viewport {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  aspect-ratio: 3 / 2;
  display: grid;
  place-items: center;
}
.preview-frame {
  width: 100%; height: 100%;
}
.preview-frame canvas {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}

/* Slider de Comparativa */
.compare-slider-wrap {
  margin: 18px 0 14px;
}
.compare-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--fg-muted);
  margin-bottom: 6px;
}
.compare-labels output { font-weight: 600; color: var(--fg-main); font-variant-numeric: tabular-nums; }
.compare-slider-wrap input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--border-line);
  accent-color: var(--fg-main);
  cursor: ew-resize;
}

.monitor-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border-line);
  margin-bottom: 22px;
}
.photo-source-buttons {
  display: flex;
  gap: 8px;
}
.viewport-hint {
  font-size: 0.8125rem;
  color: var(--fg-muted);
  margin: 0;
  max-width: 50ch;
}

/* Tarjeta de Identidad de Receta */
.recipe-identity-card {
  background: var(--bg-tile);
  border-radius: var(--radius-md);
  padding: 18px;
}
.identity-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.input-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 4px;
}
.input-group input {
  width: 100%;
  min-height: 38px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.identity-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Panel Derecho: Consola de Calibración */
.studio-controls-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
}

.studio-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 24px;
  background: var(--bg-subtle);
  padding: 5px;
  border-radius: var(--radius-md);
}
@media (min-width: 540px) {
  .studio-tabs { grid-template-columns: repeat(4, 1fr); }
}

.studio-tab {
  background: transparent;
  border: 0;
  color: var(--fg-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition:transform 0.15s ease,opacity 0.15s ease,background-color 0.15s ease,color 0.15s ease,border-color 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.studio-tab:hover { color: var(--fg-main); }
.studio-tab.is-active {
  background: var(--bg-card);
  color: var(--fg-main);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.tab-pane {
  display: none;
}
.tab-pane.is-active {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* Campos de Ajuste */
.fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px 22px;
}

.field {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 0 12px;
  align-items: center;
}
.field[hidden] { display: none; }
.field .tile {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-tile);
  border: 1px solid var(--border-line);
  display: grid; place-items: center;
  font-weight: 700;
  color: var(--fg-main);
}
.field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 4px;
}
.field select, .field input[type="text"] {
  min-height: 38px;
  padding: 4px 10px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-sm);
}
.field select {
  -webkit-appearance: none; appearance: none;
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px 14px;
  padding-right: 32px;
}

.stepper {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  gap: 4px;
  align-items: center;
}
.stepper input {
  min-height: 38px;
  padding: 2px 4px;
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border-line);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  -moz-appearance: textfield; appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper button {
  width: 34px; height: 38px;
  display: grid; place-items: center;
  background: var(--bg-tile);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.15s;
}
.stepper button:hover { background: var(--border-line); }
.stepper button[disabled] { opacity: 0.4; cursor: default; }

.notes-area {
  margin-top: 22px;
}
.notes-area label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 6px;
}
.notes-area textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-sm);
  resize: vertical;
}

/* ---------- Bandeja de Exportación Pro ---------- */

.export-bay-section {
  padding-bottom: 60px;
}
.bay-header {
  margin-bottom: 24px;
}
.bay-title {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.bay-sub {
  color: var(--fg-muted);
  font-size: 0.95rem;
  margin: 0;
}

.export-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 880px) {
  .export-grid { grid-template-columns: repeat(3, 1fr); }
}

.export-card {
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-md);
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
}
.export-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.card-top { margin-bottom: 18px; }
.card-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-tile);
  color: var(--gold-accent);
  display: grid; place-items: center;
  margin-bottom: 14px;
}
.export-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.card-desc {
  font-size: 0.84rem;
  color: var(--fg-muted);
  line-height: 1.45;
  margin: 0;
}

.card-config {
  margin-bottom: 18px;
}
.choice { border: 0; padding: 0; margin: 0; }
.choice legend { font-size: 0.8125rem; font-weight: 600; color: var(--fg-muted); margin-bottom: 6px; }
.choice label {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.875rem;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-tile);
  margin-bottom: 4px;
  cursor: pointer;
}
.choice input[type="radio"] { accent-color: var(--fg-main); }

.card-action { margin-top: auto; }
.btn-block { width: 100%; justify-content: center; }

.card-buttons-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

/* Indicador de Candado en botones */
.btn.is-locked::after {
  content: " 🔒";
  font-size: 0.85em;
  margin-left: 4px;
}

/* ---------- Biblioteca de Recetas ---------- */

.library-section {
  padding-bottom: 80px;
  border-top: 1px solid var(--border-line);
  padding-top: 48px;
}
.library-header-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.library-backup-actions {
  display: flex;
  gap: 8px;
}

.ao-cards-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--shadow-card);
}
.card h4 { font-size: 1.05rem; font-weight: 700; }
.card p { font-size: 0.84rem; color: var(--fg-muted); margin: 0; }
.card-author { font-style: italic; color: var(--gold-accent) !important; font-size: 0.78rem !important; }
.card .actions { margin-top: 12px; display: flex; gap: 6px; }

.starters-section-wrap {
  margin-top: 40px;
}
.subhead {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  margin-bottom: 16px;
}

/* ---------- Botones & Controles Generales ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-line);
  text-decoration: none;
  transition:transform 0.15s ease,opacity 0.15s ease,background-color 0.15s ease,color 0.15s ease,border-color 0.15s ease;
}
.btn:hover { background: var(--bg-subtle); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--fg-main);
  color: var(--bg-page);
  border-color: var(--fg-main);
}
.btn-primary:hover {
  background: var(--fg-main);
  opacity: 0.88;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--fg-main);
}

.btn-cta {
  background: var(--gold-accent);
  color: #121417;
  border-color: var(--gold-accent);
  font-size: 1rem;
  font-weight: 700;
  padding: 12px 24px;
}
.btn-cta:hover {
  background: var(--gold-hover);
  opacity: 1;
}

.btn-sm { min-height: 32px; padding: 4px 12px; font-size: 0.8125rem; }
.btn .icon { width: 16px; height: 16px; flex: none; }

/* ---------- Pie de Página (imalexortiz.com) ---------- */

.ao-footer {
  border-top: 1px solid var(--border-line);
  padding: 44px 0 60px;
  background: var(--bg-page);
}
.ao-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 28px;
}
.footer-logo {
  font-size: 1.25rem;
  font-weight: 700;
  display: block;
  margin-bottom: 8px;
}
.footer-copy {
  font-size: 0.8125rem;
  color: var(--fg-muted);
  max-width: 60ch;
  margin: 0;
}
.social-links {
  display: flex;
  gap: 16px;
  margin-bottom: 10px;
}
.social-links a {
  color: var(--fg-main);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
}
.social-links a:hover { text-decoration: underline; }
.admin-link-wrap a {
  font-size: 0.75rem;
  color: var(--fg-muted);
  text-decoration: none;
}
.admin-link-wrap a:hover { color: var(--fg-main); }

/* ---------- Modal de Pago (Paywall) ---------- */

.modal-backdrop {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  z-index: 10000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-backdrop.is-open { opacity: 1; pointer-events: auto; }

.modal-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-lg);
  max-width: 520px; width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 34px 28px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  transform: scale(0.96);
  transition: transform 0.25s ease;
}
.modal-backdrop.is-open .modal-card { transform: scale(1); }

.modal-close {
  position: absolute; top: 16px; right: 18px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-line);
  background: transparent;
  color: var(--fg-muted);
  font-size: 1.4rem; line-height: 1;
  display: grid; place-items: center;
  cursor: pointer;
  transition:transform 0.15s ease,opacity 0.15s ease,background-color 0.15s ease,color 0.15s ease,border-color 0.15s ease;
}
.modal-close:hover { background: var(--bg-subtle); color: var(--fg-main); }

.modal-header { text-align: center; margin-bottom: 22px; }
.modal-badge-wrapper { margin-bottom: 10px; }
.modal-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(201, 147, 59, 0.15);
  color: var(--gold-accent);
  border: 1px solid rgba(201, 147, 59, 0.35);
  border-radius: var(--radius-pill);
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.08em;
}
.modal-title {
  font-family: var(--font-serif);
  font-size: 1.85rem; font-weight: 700; line-height: 1.2;
  margin-bottom: 6px;
}
.modal-sub { color: var(--fg-muted); font-size: 0.88rem; line-height: 1.5; margin: 0; }

.modal-pricing-box {
  background: var(--bg-tile);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  margin-bottom: 22px;
}
.pricing-amount {
  display: flex; align-items: baseline; justify-content: center; gap: 8px;
}
.price-current {
  font-size: 2.2rem; font-weight: 800; color: var(--fg-main); letter-spacing: -0.02em;
}
.price-original {
  font-size: 1.15rem; color: var(--fg-muted); text-decoration: line-through;
}
.pricing-label {
  font-size: 0.78rem; color: var(--fg-muted); margin-top: 2px; font-weight: 500;
}

.modal-features {
  list-style: none; padding: 0; margin: 0 0 22px;
  display: flex; flex-direction: column; gap: 10px;
}
.modal-features li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.88rem; line-height: 1.45;
}
.feat-icon {
  flex: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(22, 163, 74, 0.15);
  color: var(--green-pro);
  display: grid; place-items: center;
  margin-top: 2px;
}

.modal-actions { display: flex; flex-direction: column; margin-bottom: 22px; }
.modal-actions .btn-cta { width: 100%; text-align: center; justify-content: center; }

.modal-license-entry {
  border-top: 1px solid var(--border-line);
  padding-top: 18px;
}
.license-entry-title {
  font-size: 0.84rem; font-weight: 600; color: var(--fg-muted); margin-bottom: 8px;
}
.key-input-row {
  display: grid; grid-template-columns: 1fr auto; gap: 8px;
}
.key-input-row input {
  text-transform: uppercase;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  padding: 8px 12px;
  border: 1px solid var(--border-line);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
}
.modal-status {
  font-size: 0.8125rem; font-weight: 600; margin: 6px 0 0; min-height: 1.3em;
}
.modal-status.is-error { color: #ef4444; }
.modal-status.is-success { color: var(--green-pro); }

.modal-footer-hint {
  border-top: 1px solid var(--border-line);
  padding-top: 14px; margin-top: 18px;
  text-align: center;
  font-size: 0.78rem; color: var(--fg-muted);
}
.modal-footer-hint a { color: var(--fg-main); text-decoration: none; font-weight: 500; }

/* Admin modal */
.admin-field { margin-bottom: 14px; }
.admin-field label { display: block; font-size: 0.8125rem; font-weight: 600; margin-bottom: 4px; }
.admin-field input { width: 100%; padding: 8px 10px; border: 1px solid var(--border-line); background: var(--bg-card); border-radius: var(--radius-sm); }
.admin-checkbox { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; font-size: 0.875rem; cursor: pointer; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px;
  transform: translateX(-50%);
  max-width: min(90vw, 520px);
  padding: 10px 20px;
  background: var(--fg-main); color: var(--bg-page);
  border-radius: var(--radius-pill);
  font-size: 0.875rem; font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 9999;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(-4px); }

/* Animaciones */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
  .ao-container { padding: 0 16px; }
  .ao-menu-links { display: none; }
  .studio-viewport-panel, .studio-controls-panel { padding: 20px; border-radius: var(--radius-md); }
  .identity-grid { grid-template-columns: 1fr; }
  .key-input-row { grid-template-columns: 1fr; }
  .ao-quickbar { flex-direction: column; align-items: flex-start; }
}

/* Photo Lab editorial interface, isolated from the public site's styles. */
.ao-hero-content{display:none!important}.ao-hero{padding:12px 0 0!important}.ao-nav{border:0!important}.ao-quickbar{padding:18px 0!important;border:0!important;gap:18px!important}.ao-quick-label{font-size:11px!important;letter-spacing:.08em!important}.preset-chip{padding:10px 15px!important;min-height:44px}.ao-container{max-width:1440px!important;padding-left:14px!important;padding-right:14px!important}.studio-workspace{gap:24px;padding-top:20px;padding-bottom:35px}.studio-viewport-panel,.studio-controls-panel{padding:24px;background:#fff;border:1px solid #e0e4d9;box-shadow:none;border-radius:14px}.header-titles h2,.studio-controls-panel h2,.export-bay h2{font-family:Arial,Helvetica,sans-serif!important;font-weight:700!important;letter-spacing:-.035em;font-size:24px!important}.fields-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 16px}.field{display:block}.field label{color:#424a40;font-size:13px;line-height:1.4;margin-bottom:9px}.field select,.field input[type="text"]{width:100%;min-height:44px;font-size:14px}.stepper{border:1px solid #d9ded2;border-radius:8px;min-height:44px;overflow:hidden;background:#f7f7f2}.stepper button{min-width:44px;min-height:44px;border-radius:0;background:#e3e9de;color:#34432d;font-size:20px}.stepper input{min-width:0;font-size:16px}.studio-tabs{grid-template-columns:repeat(2,minmax(0,1fr))!important;padding:5px;background:#edf0e9;gap:5px}.studio-tab{min-height:44px;padding:10px 8px;white-space:normal;overflow:visible;text-overflow:clip;font-size:13px;line-height:1.35}.studio-tab.is-active{background:#506447;color:white;box-shadow:none}.preview-frame{border-radius:10px;background:#edf0e9;overflow:hidden}.preview-frame canvas{display:block;max-height:620px;width:100%;height:auto;object-fit:contain}.viewport-hint{font-size:12px;line-height:1.5;color:#697064}.view-modes{gap:5px}.mode-btn{min-height:40px;padding:8px 10px}.btn{min-height:44px;border-radius:8px}.btn-primary{background:#506447!important;color:#fff!important;border-color:#506447!important}.btn:focus-visible,.studio-tab:focus-visible,.stepper button:focus-visible,select:focus-visible,input:focus-visible{outline:2px solid #506447;outline-offset:3px}.export-bay{padding-top:20px!important}.export-card{box-shadow:none!important;border:1px solid #e0e4d9!important}.toast{background:#252822!important;color:#fff!important}#h-preview{font-size:22px!important}.lbl-right,.lbl-left{font-size:12px!important}@media(max-width:780px){.ao-container{padding-inline:5px!important}.studio-viewport-panel,.studio-controls-panel{padding:17px}.studio-workspace{gap:18px}.fields-grid{gap:18px 12px}.ao-quickbar{flex-direction:column;align-items:stretch}.ao-quick-chips{gap:8px}.preview-frame canvas{max-height:520px}.preset-chip{font-size:12px}.export-card{padding:20px!important}}@media(max-width:380px){.fields-grid{grid-template-columns:1fr}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
.starters-section-wrap{display:none!important}
/* Embedded converter refinements; colors, spacing and export hierarchy only. */
html .ao-nav{position:relative!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
html .ao-nav-inner{height:44px!important;min-height:44px!important}
html .ao-hero{padding:0!important}
html .ao-quickbar{margin-top:0!important;padding:10px 0!important}
html .studio-workspace{padding-top:14px!important}
html[data-theme=dark]{--bg-page:#191d19!important;--bg-card:#252c24!important;--bg-subtle:#30382d!important;--bg-tile:#2a3227!important;--fg-main:#edece4!important;--fg-muted:#bec5b8!important;--border-line:#4e5c47!important;--border-focus:#b8c9aa!important;--gold-accent:#b8c9aa!important;--gold-hover:#ccdabf!important;--green-pro:#b8c9aa!important}
html[data-theme=dark] :is(.studio-viewport-panel,.studio-controls-panel,.export-card,.card,.import-box){background:var(--bg-card)!important;color:var(--fg-main)!important;border-color:var(--border-line)!important}
html[data-theme=dark] :is(.studio-tabs,.preview-frame,.recipe-identity-card,.view-mode-selector,.stepper){background:var(--bg-subtle)!important;border-color:var(--border-line)!important}
html[data-theme=dark] :is(h1,h2,h3,h4,label,.field label,.input-group label,.compare-labels,.mode-btn,.studio-tab){color:var(--fg-main)!important}
html[data-theme=dark] :is(.viewport-hint,.hint,.card-desc,.ao-quick-label){color:var(--fg-muted)!important}
html[data-theme=dark] .stepper button{background:#394533!important;color:#edece4!important}
html[data-theme=dark] .stepper input{background:var(--bg-card)!important;color:var(--fg-main)!important}
html[data-theme=dark] :is(.studio-tab.is-active,.mode-btn.is-active,.btn-primary){background:#b8c9aa!important;color:#20291e!important;border-color:#b8c9aa!important}
html[data-theme=dark] .btn-primary:hover{background:#ccdabf!important}
html[data-theme=dark] :is(button,input,select,textarea):focus-visible{outline:2px solid #b8c9aa!important;outline-offset:3px!important}
html :is(#btn-xmp,#btn-lut){width:100%!important;min-height:52px!important;font-size:15px!important;font-weight:700!important;padding:14px 18px!important;border-radius:10px!important;box-shadow:0 3px 10px #25282214!important}
html .export-card:has(#btn-xmp),html .export-card:has(#btn-lut){border-color:#87997a!important}
html .export-grid{gap:20px!important}
@media(max-width:780px){html .ao-nav-inner{height:40px!important;min-height:40px!important}html .ao-quickbar{gap:12px!important}html .studio-workspace{padding-top:10px!important}}

/* Reserve the viewport independently of the decoded canvas dimensions. */
.canvas-viewport{position:relative;aspect-ratio:3/2;min-width:0;min-height:0;contain:layout}
.canvas-viewport .preview-frame{position:absolute;inset:0;width:100%;height:100%;min-width:0;min-height:0}
.canvas-viewport .preview-frame canvas{width:100%!important;height:100%!important;max-height:none!important;object-fit:contain;display:block}
#theme-toggle{display:none!important}

/* The parent owns vertical scrolling and adjusts this document to its content. */
html.ao-embedded{overflow-y:hidden}
