/* ============================================================
   rocef.css — Hoja de estilos global ROCEF
   Cargada por: index.html, herramienta/index.html,
               wizard/index.html, articulos/index.html
   ============================================================ */

/* ============================================================
   VARIABLES Y PALETA
   ============================================================ */
:root {
  --bg:           #F7F6F3;
  --surface:      #FFFFFF;
  --surface-2:    #F0EFE9;
  --border:       #E2DDD6;
  --border-focus: #6366F1;
  --text:         #1A1A2E;
  --text-2:       #64748B;
  --text-3:       #94A3B8;
  --accent:       #6366F1;
  --accent-soft:  #EEF2FF;
  --accent-hover: #4F46E5;
  --ok:           #16A34A;
  --ok-soft:      #DCFCE7;
  --warn:         #D97706;
  --warn-soft:    #FEF3C7;
  --danger:       #DC2626;
  --danger-soft:  #FEE2E2;
  --postit-rol:           #FEF08A;
  --postit-objetivo:      #BBF7D0;
  --postit-contexto:      #BAE6FD;
  --postit-estilo:        #F5D0FE;
  --postit-formato:       #FED7AA;
  --postit-rol-border:      #EAB308;
  --postit-objetivo-border: #16A34A;
  --postit-contexto-border: #0284C7;
  --postit-estilo-border:   #A855F7;
  --postit-formato-border:  #EA580C;
  --radius:    14px;
  --radius-sm: 8px;
  --shadow:    0 2px 12px rgba(26,26,46,.07);
  --shadow-md: 0 8px 30px rgba(26,26,46,.10);
  --font-heading: 'Fraunces', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Mono', monospace;
  --font-scale: 1;
  --header-h: 68px;
}

/* ============================================================
   RESET Y BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); font-size: 16px; background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.6; }
button, input, textarea, select { font: inherit; }
textarea { cursor: text; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: .9rem; font-weight: 600;
  cursor: pointer; transition: all .15s; white-space: nowrap;
  text-decoration: none;
}
.btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn.ok:hover { background: #15803D; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--border); }
.btn.danger { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { padding: 6px 12px; font-size: .82rem; }
.btn.lg { padding: 13px 32px; font-size: 1rem; }
.btn:disabled { opacity: .4; pointer-events: none; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: fixed; inset: 0 0 auto 0; height: var(--header-h);
  background: rgba(247,246,243,.96); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); z-index: 100;
  display: flex; align-items: center;
}
.header-inner {
  width: 100%; max-width: 1200px; margin: 0 auto;
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.logo-wrap { display: flex; flex-direction: column; line-height: 1; }
.logo { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.logo span { color: var(--accent); }
.logo-tagline { font-size: .68rem; color: var(--text-3); letter-spacing: .02em; margin-top: 1px; }
.header-right { display: flex; align-items: center; gap: 10px; }
.font-size-group { display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.font-size-group button { border: 0; background: var(--surface); color: var(--text-2); padding: 6px 9px; font-size: .78rem; cursor: pointer; transition: all .15s; }
.font-size-group button.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.mode-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: .8rem; font-weight: 600; color: var(--text-2);
  cursor: pointer; transition: all .15s;
}
.mode-pill:hover { border-color: var(--accent); color: var(--accent); }
.mode-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ============================================================
   LANDING
   ============================================================ */
.landing { padding-top: var(--header-h); }

/* HERO */
.hero { max-width: 720px; margin: 0 auto; padding: 80px 24px 56px; text-align: center; }
.hero h1 { font-family: var(--font-heading); font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 700; line-height: 1.12; letter-spacing: -.03em; margin-bottom: 20px; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-sub { font-size: 1.05rem; color: var(--text-2); max-width: 480px; margin: 0 auto; line-height: 1.65; }

/* RECONOCIMIENTO */
.recognition-section { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 56px 24px; }
.recognition-inner { max-width: 820px; margin: 0 auto; text-align: center; }
.recognition-inner h2 { font-family: var(--font-heading); font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; letter-spacing: -.02em; margin-bottom: 32px; }
.pain-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 32px; text-align: left; }
.pain-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; font-size: .88rem; line-height: 1.55; color: var(--text-2); }
.pain-card .pain-icon { font-size: 1.4rem; margin-bottom: 8px; display: block; }
.pain-card strong { color: var(--text); display: block; margin-bottom: 4px; font-size: .92rem; }
.recognition-conclusion { font-size: .95rem; color: var(--text); font-weight: 600; }

/* DEMO */
.demo-section { max-width: 860px; margin: 0 auto; padding: 64px 24px; }
.section-label { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.section-title { font-family: var(--font-heading); font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; letter-spacing: -.02em; margin-bottom: 6px; color: var(--text); }
.section-subtitle { color: var(--text-2); font-size: .92rem; margin-bottom: 28px; line-height: 1.55; }
.demo-skip { text-align: right; margin-bottom: 16px; }
.demo-skip a { font-size: .78rem; color: var(--text-3); }
.demo-skip a:hover { color: var(--accent); }
.demo-cases { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 28px; }
.demo-case-card { border: 2px solid var(--border); border-radius: var(--radius); padding: 18px 14px; text-align: center; cursor: pointer; background: var(--surface); transition: all .18s; }
.demo-case-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.demo-case-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.case-emoji { font-size: 1.7rem; margin-bottom: 8px; display: block; }
.case-title { font-weight: 700; font-size: .88rem; margin-bottom: 3px; }
.case-desc { font-size: .78rem; color: var(--text-2); line-height: 1.35; }
.demo-step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 16px; box-shadow: var(--shadow); display: none; }
.demo-step.visible { display: block; }
.demo-step-label { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; }
.demo-step h3 { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 700; margin-bottom: 5px; }
.demo-step p { font-size: .88rem; color: var(--text-2); margin-bottom: 14px; line-height: 1.5; }
.demo-user-input { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 13px; font-size: .9rem; line-height: 1.6; background: var(--bg); color: var(--text); min-height: 68px; resize: none; transition: border-color .15s; margin-bottom: 12px; }
.demo-user-input:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(99,102,241,.08); }
.demo-step-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.demo-hint { font-size: .78rem; color: var(--text-3); }

/* Chat simulado */
.chat-window { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; display: none; }
.chat-window.visible { display: block; }
.chat-topbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 16px; display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600; color: var(--text-2); }
.chat-body { padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-bubble { max-width: 82%; border-radius: 14px; padding: 11px 15px; font-size: .88rem; line-height: 1.6; }
.chat-bubble.user { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-bubble.ai { background: var(--surface); color: var(--text); align-self: flex-start; border-bottom-left-radius: 4px; border: 1px solid var(--border); }
.chat-bubble.ai.bad { border-color: #FCA5A5; background: #FFF8F8; }
.chat-bubble.ai.good { border-color: #86EFAC; background: #F6FFF8; }
.chat-label { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 5px; display: block; }
.chat-label.bad { color: var(--danger); }
.chat-label.good { color: var(--ok); }
.chat-verdict { font-size: .8rem; font-weight: 600; padding: 2px 0; }
.chat-verdict.bad { color: var(--danger); }
.chat-verdict.good { color: var(--ok); }
.chat-divider { display: flex; align-items: center; gap: 10px; padding: 2px 0; }
.chat-divider-line { flex: 1; height: 1px; background: var(--border); }
.chat-divider-text { font-size: .78rem; color: var(--text-2); font-weight: 600; white-space: nowrap; }
.rocef-breakdown { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; font-size: .8rem; line-height: 1.7; margin-bottom: 10px; }
.rocef-row { display: flex; gap: 8px; margin-bottom: 3px; }
.rocef-row:last-child { margin-bottom: 0; }
.rocef-tag { font-weight: 700; font-size: .7rem; padding: 1px 6px; border-radius: 4px; white-space: nowrap; align-self: flex-start; margin-top: 2px; }
.rocef-tag.r { background: var(--postit-rol);      color: var(--postit-rol-border); }
.rocef-tag.o { background: var(--postit-objetivo);  color: var(--postit-objetivo-border); }
.rocef-tag.c { background: var(--postit-contexto);  color: var(--postit-contexto-border); }
.rocef-tag.e { background: var(--postit-estilo);    color: var(--postit-estilo-border); }
.rocef-tag.f { background: var(--postit-formato);   color: var(--postit-formato-border); }
.rocef-val { color: var(--text); }

/* Pasarelas post-demo */
.demo-gateways { display: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.demo-gateways.visible { display: block; }
.demo-gateways h3 { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; text-align: center; }
.gateway-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.gateway-card { border: 2px solid var(--border); border-radius: var(--radius); padding: 18px; cursor: pointer; background: var(--bg); transition: all .18s; }
.gateway-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.gateway-card.primary-gw { border-color: var(--accent); background: var(--accent-soft); }
.gateway-card-title { font-weight: 700; font-size: .92rem; margin-bottom: 4px; }
.gateway-card-desc { font-size: .8rem; color: var(--text-2); line-height: 1.4; margin-bottom: 10px; }
.gateway-discrete { text-align: center; padding-top: 12px; border-top: 1px solid var(--border); }
.gateway-discrete a { font-size: .78rem; color: var(--text-3); }
.gateway-discrete a:hover { color: var(--accent); }

/* ============================================================
   WIZARD
   ============================================================ */
.wizard-section { max-width: 640px; margin: 0 auto; padding: 0 24px 64px; display: none; }
.wizard-section.visible { display: block; }
.wizard-header { text-align: center; margin-bottom: 28px; }
.wizard-header h2 { font-family: var(--font-heading); font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: 6px; }
.wizard-header p { color: var(--text-2); font-size: .9rem; }
.wizard-progress { display: flex; align-items: center; gap: 6px; justify-content: center; margin-bottom: 28px; }
.wiz-step-dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface); display: grid; place-items: center; font-size: .72rem; font-weight: 700; color: var(--text-3); transition: all .3s; }
.wiz-step-dot.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.wiz-step-dot.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.wiz-step-line { flex: 1; height: 2px; background: var(--border); border-radius: 1px; max-width: 40px; }
.wiz-step-line.done { background: var(--ok); }
.wizard-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); display: none; }
.wizard-card.active { display: block; }
.wiz-field-tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; margin-bottom: 14px; }
.wiz-field-tag.c { background: var(--postit-contexto); color: var(--postit-contexto-border); }
.wiz-field-tag.o { background: var(--postit-objetivo); color: var(--postit-objetivo-border); }
.wiz-field-tag.e { background: var(--postit-estilo); color: var(--postit-estilo-border); }
.wiz-field-tag.r { background: var(--postit-rol); color: var(--postit-rol-border); }
.wiz-field-tag.f { background: var(--postit-formato); color: var(--postit-formato-border); }
.wizard-card h3 { font-family: var(--font-heading); font-size: 1.25rem; font-weight: 700; margin-bottom: 6px; }
.wizard-card .wiz-hint { font-size: .85rem; color: var(--text-2); margin-bottom: 16px; line-height: 1.5; }
.wiz-textarea { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; font-size: .92rem; line-height: 1.6; background: var(--bg); color: var(--text); min-height: 90px; resize: none; transition: border-color .15s; }
.wiz-textarea:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(99,102,241,.08); }
.wiz-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.wiz-chip { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: .82rem; color: var(--text-2); cursor: pointer; transition: all .15s; }
.wiz-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.wiz-chip.selected { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.wiz-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.wiz-back { background: none; border: none; color: var(--text-3); font-size: .82rem; cursor: pointer; padding: 4px; }
.wiz-back:hover { color: var(--text-2); }

/* Resultado del wizard */
.wiz-result { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); display: none; }
.wiz-result.visible { display: block; }
.wiz-result h3 { font-family: var(--font-heading); font-size: 1.15rem; font-weight: 700; margin-bottom: 6px; }
.wiz-result p { font-size: .85rem; color: var(--text-2); margin-bottom: 14px; line-height: 1.5; }
.wiz-prompt-box { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; font-family: var(--font-mono); font-size: .82rem; line-height: 1.75; white-space: pre-wrap; margin-bottom: 14px; color: var(--text); min-height: 80px; }
.wiz-result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.wiz-feedback { border-top: 1px solid var(--border); padding-top: 18px; }
.wiz-feedback p { font-weight: 600; color: var(--text); margin-bottom: 12px; font-size: .92rem; }
.wiz-feedback-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.wiz-phase-label { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }

/* ============================================================
   MÉTODO
   ============================================================ */
.method-section { background: var(--surface); border-top: 1px solid var(--border); padding: 64px 24px; }
.method-inner { max-width: 1000px; margin: 0 auto; }
.method-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 12px; margin-top: 28px; }
.method-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 16px; transition: transform .2s, box-shadow .2s; }
.method-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.method-letter { font-family: var(--font-heading); font-size: 2.4rem; font-weight: 700; line-height: 1; margin-bottom: 6px; }
.method-name { font-weight: 700; font-size: .88rem; margin-bottom: 4px; }
.method-desc { font-size: .82rem; color: var(--text-2); line-height: 1.5; }
.method-extra { font-size: .78rem; color: var(--text-3); margin-top: 6px; line-height: 1.45; font-style: italic; }
.method-card:nth-child(1) .method-letter { color: var(--postit-rol-border); }
.method-card:nth-child(2) .method-letter { color: var(--postit-objetivo-border); }
.method-card:nth-child(3) .method-letter { color: var(--postit-contexto-border); }
.method-card:nth-child(4) .method-letter { color: var(--postit-estilo-border); }
.method-card:nth-child(5) .method-letter { color: var(--postit-formato-border); }
.method-cta { margin-top: 32px; text-align: center; }

/* ============================================================
   APP
   ============================================================ */
#app { max-width: 860px; margin: 0 auto; padding: calc(var(--header-h) + 28px) 24px 60px; display: none; }
#app.visible { display: block; }
.app-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.app-mode-info { font-size: .8rem; color: var(--text-3); }
.app-mode-info strong { color: var(--text-2); }
.app-downgrade { font-size: .78rem; color: var(--text-3); cursor: pointer; text-decoration: underline; }
.app-downgrade:hover { color: var(--accent); }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.app-title-input { flex: 1; min-width: 180px; height: 42px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 13px; background: var(--surface); color: var(--text); font-size: .92rem; transition: border-color .15s; }
.app-title-input:focus { outline: none; border-color: var(--border-focus); }
.app-actions { display: flex; gap: 8px; align-items: center; }
.progress-wrap { margin-bottom: 20px; }
.progress-label { display: flex; justify-content: space-between; font-size: .78rem; color: var(--text-2); margin-bottom: 5px; }
.progress-bar { height: 5px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s ease; }

/* Campo toggle (habilitar/deshabilitar) */
.field-toggle-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.field-toggle-label { font-size: .8rem; color: var(--text-3); }
.toggle-switch { position: relative; width: 36px; height: 20px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: var(--border); border-radius: 999px; cursor: pointer; transition: .2s; }
.toggle-slider::before { content: ''; position: absolute; width: 14px; height: 14px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); }
.field-disabled { opacity: .4; }
.field-disabled textarea,
.field-disabled .chip,
.field-disabled .snippets-toggle,
.field-disabled .snippets-board,
.field-disabled .save-snippet-row { pointer-events: none; }

/* Modo Aprendo — pasos */
.step-field { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 14px; box-shadow: var(--shadow); }
.step-field.completed { border-color: var(--ok); opacity: .72; }
.step-field.active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.09), var(--shadow-md); }
.step-field.locked { opacity: .3; pointer-events: none; }
.step-field-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.step-badge { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex-shrink: 0; }
.step-field.completed .step-badge { background: var(--ok); color: #fff; }
.step-field.active .step-badge { background: var(--accent); color: #fff; }
.step-field.locked .step-badge { background: var(--border); color: var(--text-3); }
.step-field-title { font-weight: 700; font-size: 1rem; }
.step-field-subtitle { font-size: .82rem; color: var(--text-2); }
.step-tutorial { background: var(--accent-soft); border: 1px solid #C7D2FE; border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 12px; font-size: .85rem; color: var(--text); line-height: 1.6; }
.step-tutorial strong { color: var(--accent); }
.step-example-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.chip { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: .78rem; color: var(--text-2); cursor: pointer; transition: all .15s; }
.chip:hover, .chip.use-example { border-color: #C7D2FE; color: var(--accent); background: var(--accent-soft); }
.step-completed-value { font-size: .88rem; color: var(--text-2); font-style: italic; padding: 4px 0; }

/* Modo Practico — acordeón */
.accordion-field { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; box-shadow: var(--shadow); transition: border-color .15s; }
.accordion-field.open { border-color: var(--accent); }
.accordion-field.field-off { border-color: var(--border); opacity: .5; }
.accordion-header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; cursor: pointer; user-select: none; transition: background .15s; }
.accordion-header:hover { background: var(--bg); }
.accordion-letter { width: 32px; height: 32px; border-radius: var(--radius-sm); display: grid; place-items: center; font-family: var(--font-heading); font-weight: 700; font-size: 1rem; flex-shrink: 0; }
.accordion-info { flex: 1; min-width: 0; }
.accordion-name { font-weight: 700; font-size: .9rem; }
.accordion-preview { font-size: .78rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.accordion-right { display: flex; align-items: center; gap: 10px; }
.accordion-chevron { color: var(--text-3); font-size: .85rem; transition: transform .25s; }
.accordion-field.open .accordion-chevron { transform: rotate(180deg); }
.accordion-body { padding: 0 18px 18px; display: none; }
.accordion-field.open .accordion-body { display: block; }
.field-help-inline { background: var(--surface-2); border-radius: var(--radius-sm); padding: 11px 13px; margin-bottom: 10px; font-size: .82rem; color: var(--text-2); line-height: 1.5; }
.field-help-inline ul { padding-left: 14px; margin-top: 3px; }
.field-help-inline li { margin-bottom: 1px; }
.letter-rol      { background: var(--postit-rol);      color: var(--postit-rol-border); }
.letter-objetivo { background: var(--postit-objetivo);  color: var(--postit-objetivo-border); }
.letter-contexto { background: var(--postit-contexto);  color: var(--postit-contexto-border); }
.letter-estilo   { background: var(--postit-estilo);    color: var(--postit-estilo-border); }
.letter-formato  { background: var(--postit-formato);   color: var(--postit-formato-border); }

/* Modo Creo — dos columnas */
.creo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.creo-grid .creo-full { grid-column: 1 / -1; }
.creo-field { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.creo-label { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; font-weight: 700; font-size: .84rem; }
.creo-dot { width: 9px; height: 9px; border-radius: 50%; }
.dot-rol      { background: var(--postit-rol-border); }
.dot-objetivo { background: var(--postit-objetivo-border); }
.dot-contexto { background: var(--postit-contexto-border); }
.dot-estilo   { background: var(--postit-estilo-border); }
.dot-formato  { background: var(--postit-formato-border); }

/* Textarea compartida */
.field-textarea { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 12px; background: var(--bg); color: var(--text); resize: vertical; min-height: 96px; line-height: 1.6; font-size: .88rem; transition: border-color .15s, box-shadow .15s; }
.field-textarea:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(99,102,241,.07); }
.field-textarea.tall { min-height: 130px; }
.field-textarea.short { min-height: 68px; }
.field-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 5px; gap: 8px; }
.char-count { font-size: .74rem; color: var(--text-3); }
.char-count.warn { color: var(--warn); }

/* Snippets post-it */
.snippets-section { margin-top: 10px; }
.snippets-toggle { display: flex; align-items: center; gap: 5px; font-size: .78rem; color: var(--text-2); font-weight: 600; background: none; border: none; padding: 0; cursor: pointer; margin-bottom: 7px; }
.snippets-toggle:hover { color: var(--accent); }
.snippets-board { display: flex; flex-wrap: wrap; gap: 7px; padding: 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); min-height: 48px; }
.postit { position: relative; padding: 7px 26px 7px 9px; border-radius: 6px; border: 1px solid transparent; font-size: .76rem; line-height: 1.4; max-width: 150px; cursor: pointer; box-shadow: 1px 2px 5px rgba(0,0,0,.08); transition: transform .15s, box-shadow .15s; word-break: break-word; }
.postit:hover { transform: rotate(-1deg) scale(1.04); box-shadow: 2px 4px 10px rgba(0,0,0,.12); }
.postit-name { font-weight: 700; margin-bottom: 1px; }
.postit-preview { color: rgba(0,0,0,.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.postit-delete { position: absolute; top: 3px; right: 3px; width: 16px; height: 16px; border-radius: 50%; border: 0; background: rgba(0,0,0,.1); color: rgba(0,0,0,.4); font-size: .6rem; display: grid; place-items: center; opacity: 0; transition: opacity .15s; cursor: pointer; }
.postit:hover .postit-delete { opacity: 1; }
.postit-rol      { background: var(--postit-rol);      border-color: var(--postit-rol-border); }
.postit-objetivo { background: var(--postit-objetivo);  border-color: var(--postit-objetivo-border); }
.postit-contexto { background: var(--postit-contexto);  border-color: var(--postit-contexto-border); }
.postit-estilo   { background: var(--postit-estilo);    border-color: var(--postit-estilo-border); }
.postit-formato  { background: var(--postit-formato);   border-color: var(--postit-formato-border); }
.snippets-empty { font-size: .76rem; color: var(--text-3); font-style: italic; }
.save-snippet-row { display: flex; gap: 7px; margin-top: 8px; }
.save-snippet-input { flex: 1; height: 32px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 9px; font-size: .78rem; background: var(--surface); }
.save-snippet-input:focus { outline: none; border-color: var(--border-focus); }

/* Botón generar al final de campos nivel 2 y 3 */
.fields-generate-btn {
  margin-top: 20px; text-align: center; padding-bottom: 20px;
}

/* barra inferior eliminada */

/* Mis prompts */
.dropdown-wrap { position: relative; }
.prompts-dropdown { position: absolute; bottom: calc(100% + 8px); right: 0; width: min(400px,90vw); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); z-index: 150; padding: 12px; max-height: 360px; overflow-y: auto; }
.prompts-search { width: 100%; height: 36px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 11px; margin-bottom: 10px; font-size: .85rem; }
.prompts-search:focus { outline: none; border-color: var(--border-focus); }
.prompt-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px; margin-bottom: 7px; background: var(--bg); }
.prompt-item-title { font-weight: 700; font-size: .85rem; margin-bottom: 2px; }
.prompt-item-snippet { font-size: .76rem; color: var(--text-2); margin-bottom: 7px; line-height: 1.4; }
.prompt-item-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.prompts-empty { font-size: .85rem; color: var(--text-3); text-align: center; padding: 16px 0; }

/* Modales */
.modal-overlay { position: fixed; inset: 0; background: rgba(26,26,46,.45); backdrop-filter: blur(4px); z-index: 180; display: none; align-items: center; justify-content: center; padding: 24px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 26px; width: min(820px,100%); max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-md); }
.modal h3 { font-family: var(--font-heading); font-size: 1.3rem; margin-bottom: 6px; }
.modal p { color: var(--text-2); line-height: 1.5; margin-bottom: 3px; font-size: .88rem; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.preview-textarea { width: 100%; min-height: 300px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 13px; resize: vertical; font-family: var(--font-mono); font-size: .82rem; line-height: 1.7; background: var(--bg); color: var(--text); margin-top: 12px; }
.missing-item { display: flex; align-items: center; gap: 7px; color: var(--danger); font-weight: 600; font-size: .88rem; padding: 5px 0; }

/* ============================================================
   CONTACTO / FEEDBACK LANZAMIENTO
   ============================================================ */
.contact-section { background: var(--surface); border-top: 1px solid var(--border); padding: 56px 24px; }
.contact-inner { max-width: 540px; margin: 0 auto; text-align: center; }
.contact-inner h2 { font-family: var(--font-heading); font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: 8px; }
.contact-inner p { color: var(--text-2); font-size: .9rem; margin-bottom: 24px; line-height: 1.55; }
.contact-form { text-align: left; }
.contact-field { margin-bottom: 14px; }
.contact-field label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 5px; color: var(--text); }
.contact-input { width: 100%; height: 42px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 13px; background: var(--bg); color: var(--text); font-size: .9rem; transition: border-color .15s; }
.contact-input:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(99,102,241,.08); }
.contact-textarea { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 13px; background: var(--bg); color: var(--text); font-size: .9rem; line-height: 1.6; min-height: 100px; resize: none; transition: border-color .15s; }
.contact-textarea:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(99,102,241,.08); }
.contact-submit { width: 100%; }
.contact-success { display: none; text-align: center; padding: 20px; color: var(--ok); font-weight: 700; font-size: 1rem; }
.contact-success.visible { display: block; }

/* ============================================================
   FOOTER LEGAL
   ============================================================ */
.site-footer { border-top: 1px solid var(--border); padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.footer-copy { font-size: .76rem; color: var(--text-3); }
.footer-links { display: flex; gap: 16px; }
.footer-links a { font-size: .76rem; color: var(--text-3); }
.footer-links a:hover { color: var(--accent); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 700px) {
  .pain-grid { grid-template-columns: 1fr; }
  .demo-cases { grid-template-columns: 1fr; }
  .gateway-options { grid-template-columns: 1fr; }
  .method-grid { grid-template-columns: 1fr 1fr; }
  .creo-grid { grid-template-columns: 1fr; }
  .creo-grid .creo-full { grid-column: 1; }
  .hero h1 { font-size: 2rem; }
  .font-size-group { display: none; }
  .app-footer-inner { flex-wrap: wrap; }
  .chat-bubble { max-width: 96%; }
  .site-footer { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
}

/* ============================================================
   ANIMACIONES
   ============================================================ */
@keyframes fadeUp { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:translateY(0); } }
.hero > * { animation: fadeUp .5s ease both; }
.hero > *:nth-child(1) { animation-delay: .05s; }
.hero > *:nth-child(2) { animation-delay: .14s; }
@keyframes slideIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
.wizard-card.active { animation: slideIn .3s ease both; }