:root{
  /* Fondo completamente blanco (evita que se vea "imagen pegada") */
  --bg:#ffffff;
  --card:#ffffff;
  --text:#0b1f33;
  --muted:#5b6776;

  --primary:#184b7d;
  --accent:#22a6a1;

  --ok:#16a34a;
  --warn:#b45309;
  --err:#dc2626;

  --border:#dde2e8;
  --shadow:0 6px 18px rgba(16, 24, 40, 0.08);
  --radius:14px;

  --font: Inter, Montserrat, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:var(--font);
}

.wrap{max-width:1100px; margin:0 auto; padding:18px 12px 46px}
.panel{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
}

/* Header: blanco, y solo la franja superior queda fija */
.header{
  padding:0;
  border-bottom:1px solid var(--border);
  background:#fff;
}

.headerTop{
  position:sticky;
  top:0;
  z-index:60;
  background:#fff;
  padding:14px 14px 12px;
  /* Primera línea punteada (hasta aquí queda fijo) */
  border-bottom:1px dashed rgba(0,0,0,0.12);
}

.headerBelow{
  padding:12px 14px 12px;
}

.brandRow{
  display:grid;
  /* Dejamos un "colchón" a la derecha para que el CTA no quede pegado al borde */
  grid-template-columns:1fr minmax(240px, 340px);
  align-items:center;
  gap:12px;
}

.brandTitle{display:flex; align-items:center; gap:10px}
.brandLogo{width:26px; height:26px; border-radius:8px}
.brandText h1{
  margin:0;
  font-size:26px;
  letter-spacing:.2px;
  color:var(--primary);
  line-height:1.15;
}
.brandText .sub{margin-top:3px; font-size:12px; color:var(--muted)}

.privacyLine{
  margin-top:6px;
  font-size:12px;
  color:var(--muted);
  line-height:1.35;
}

.ctaInline{
  justify-self:stretch;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  /* Se quita el encuadre (línea punteada + fondo verdoso) */
  padding:0;
  border-radius:0;
  border:none;
  background:transparent;
}
.ctaRobotInline{width:86px; height:auto; flex:0 0 auto}

/* Confianza + beneficios */
.trustBlock{
  margin-top:12px;
  display:grid;
  grid-template-columns:1fr 180px;
  gap:16px;
  align-items:center;
  /* Evita que el robot quede perdido a la derecha en desktop */
  max-width:960px;
  margin-left:auto;
  margin-right:auto;
}
.trustTitle{font-weight:900; font-size:20px; color:var(--primary)}
.trustLead{margin-top:6px; color:var(--muted); font-size:16px; line-height:1.45}
.trustBullets{margin:12px 0 0; padding-left:18px; color:var(--muted); font-size:15px}
.trustBullets li{margin:8px 0}
.trustRobot{
  width:180px;
  height:auto;
  justify-self:center;
  filter:drop-shadow(0 10px 20px rgba(11,31,51,0.12))
}

.note{
  margin-top:10px;
  font-size:12px;
  color:var(--muted);
  line-height:1.45;
  padding-top:10px;
  border-top:1px dashed rgba(0,0,0,0.10);
}

.content{padding:14px}

.section{
  padding:14px 0;
  border-top:1px solid var(--border);
}
.section:first-child{border-top:none}

.h2{margin:0 0 10px; font-size:15px}
.h3{font-weight:800; font-size:13px}

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

.uploader{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
#file{display:none}

.grid2{display:grid; grid-template-columns:1fr 1fr; gap:12px}
@media (max-width:900px){
  .brandRow{grid-template-columns:1fr;}
  .ctaInline{justify-self:start}
  .trustBlock{grid-template-columns:1fr}
  .trustRobot{width:140px}
  .grid2{grid-template-columns:1fr}
}

.label{display:block; font-size:12px; color:var(--muted); margin:0 0 6px}

.input{
  width:100%;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 10px;
  font-size:13px;
  outline:none;
  background:#fff;
  color:var(--text);
}
.input:focus{
  border-color:rgba(34,166,161,0.55);
  box-shadow:0 0 0 3px rgba(34,166,161,0.16);
}

.btn{
  width:auto;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  font-size:13px;
  cursor:pointer;
  background:#fff;
  color:var(--text);
  transition:transform 0.04s ease, background 0.12s ease, border-color 0.12s ease;
  user-select:none;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}
.btn:active{transform:translateY(1px)}
.btn:disabled{opacity:.55; cursor:not-allowed}
.btn:hover{background:rgba(24,75,125,0.04)}

.btnPrimary{
  background:var(--primary);
  color:#fff;
  border-color:rgba(0,0,0,0.06);
}
.btnPrimary:hover{filter:brightness(1.03)}
.btnSecondary{
  background:rgba(34,166,161,0.10);
  color:#0b3a39;
  border-color:rgba(34,166,161,0.22);
}
.btnDanger{
  background:rgba(220, 38, 38, 0.08);
  color:#7f1d1d;
  border-color:rgba(220, 38, 38, 0.22);
}

.toast{
  margin-top:10px;
  padding:10px 10px;
  border-radius:12px;
  font-size:12px;
  border:1px solid var(--border);
  background:rgba(24,75,125,0.04);
  color:var(--text);
}
.hidden{display:none}

.detected{margin-top:12px}
/* El aviso debe ser MUY visible y centrado */
.detectedHead{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  gap:6px;
}
.detectedNotice{
  font-weight:900;
  /* antes era .mutedSmall (12px). Ahora ~2x, pero responsivo */
  font-size:clamp(16px, 2.2vw, 24px);
  line-height:1.2;
  color:var(--primary);
}
.fields{display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:10px}
@media (max-width:900px){.fields{grid-template-columns:1fr}}

.field{
  display:flex;
  align-items:center;
  gap:10px;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 10px;
  background:#fff;
}
.field__k{color:var(--muted); font-size:12px; font-weight:800; white-space:nowrap; min-width:150px}
.field__v{
  flex:1;
  min-width:0;
  border:1px solid var(--border);
  border-radius:10px;
  padding:8px 10px;
  font-family:var(--mono);
  font-size:12px;
  color:var(--text);
  background:#fff;
}
.field__v:focus{outline:3px solid rgba(34,166,161,0.22); border-color:rgba(34,166,161,0.60)}

.field__chk{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
}
.field__chk input{accent-color:var(--accent)}

.ctaTop{
  margin-top:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border:1px solid rgba(34,166,161,0.22);
  background:rgba(34,166,161,0.06);
  border-radius:14px;
}
.ctaRobot{
  width:110px;
  height:auto;
  flex:0 0 auto;
}
.btnBig{
  /* +~30% (sin mover el bloque, solo el botón) */
  padding:clamp(14px, 1.7vw, 18px) clamp(22px, 2.2vw, 30px);
  font-size:clamp(16px, 1.9vw, 21px);
  font-weight:900;
  border-radius:14px;
}
@media (max-width:900px){
  .ctaTop{flex-direction:column; align-items:stretch}
  .ctaRobot{width:90px; margin:0 auto}
}

.tabs{display:flex; gap:8px; flex-wrap:wrap; margin-bottom:10px}
.tab{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:999px;
  background:#fff;
  font-size:12px;
  color:var(--muted);
  cursor:pointer;
  user-select:none;
}
.tab input{accent-color:var(--accent)}

.box{
  border:1px dashed rgba(0,0,0,0.18);
  background:rgba(24,75,125,0.03);
  border-radius:12px;
  padding:12px;
}

.subhead{margin-top:12px; margin-bottom:8px; font-size:12px; color:var(--muted)}

.checklist{display:grid; grid-template-columns:1fr 1fr; gap:8px}
@media (max-width:900px){.checklist{grid-template-columns:1fr}}

.check{
  display:flex;
  gap:10px;
  align-items:center;
  padding:10px 10px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
}
.check input{margin-top:0; accent-color:var(--accent)}
.check__k{font-size:12px; color:var(--muted); font-weight:800; white-space:nowrap; min-width:160px}
.check__v{
  flex:1;
  min-width:0;
  font-size:12px;
  font-family:var(--mono);
  color:var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.pillList{display:flex; flex-wrap:wrap; gap:6px; align-items:center}
.pill{
  display:inline-flex;
  align-items:center;
  padding:6px 8px;
  border-radius:999px;
  font-size:11px;
  background:rgba(24,75,125,0.06);
  border:1px solid rgba(24,75,125,0.12);
  color:var(--text);
}

.templateRow{display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px}
@media (max-width:980px){.templateRow{grid-template-columns:1fr}}
.template{display:block; cursor:pointer}
.template input{display:none}
.templateBox{
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  overflow:hidden;
  padding:10px;
}
.templateName{margin-top:8px; font-weight:800; font-size:12px; color:var(--muted)}
.template input:checked + .templateBox{
  border-color:rgba(34,166,161,0.70);
  box-shadow:0 0 0 3px rgba(34,166,161,0.14);
}
.template canvas{width:100%; height:auto; display:block; border-radius:10px; background:#fff}

.templateSingle{
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px;
  background:#fff;
}
.templateSingle canvas{width:100%; height:auto; display:block; border-radius:10px; background:#fff}

/* Generate layout (preview pequeña a la derecha) */
.genGrid{display:grid; grid-template-columns:1fr 0.65fr; gap:12px; align-items:start}
.genPreview{display:flex; flex-direction:column; align-items:stretch; gap:6px}
.templateMini{border:1px solid var(--border); border-radius:12px; padding:8px; background:#fff}
.templateMini canvas{width:100%; height:auto; display:block; border-radius:10px; background:#fff; max-width:280px; margin:0 auto}
@media (max-width:900px){
  .genGrid{grid-template-columns:1fr}
  /* En vista tipo celular, la vista previa se mantiene pequeña y centrada */
  .templateMini{display:flex; justify-content:center}
  .templateMini canvas{max-width:220px; margin:0 auto}
}

@media (max-width:480px){
  .templateMini canvas{max-width:180px}
}

.actions{display:flex; gap:10px; flex-wrap:wrap; margin-top:12px}

.out{margin-top:12px}
.outPanel{
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  padding:10px;
}
.outPanel img{width:100%; height:auto; display:block; border-radius:10px; background:#fff}
.outActions{display:flex; gap:10px; flex-wrap:wrap; margin-top:10px}

.fineprint{color:var(--muted); font-size:11px; margin-top:10px}
.foot{padding-bottom:8px}


/* Steps */
.steps{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin-top:10px;
}
@media (max-width:900px){
  .steps{grid-template-columns:1fr 1fr}
}
.step{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  /* Look tipo botón/card (gris perla suave + leve 3D) */
  background:rgba(11,31,51,0.02);
  box-shadow:0 3px 10px rgba(16, 24, 40, 0.08);
  font-size:12px;
  color:var(--muted);
}

/* Tip debajo de Estándar/Personalizada */
.hintTip{
  margin-top:6px;
}
.stepNum{
  width:22px;
  height:22px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:rgba(34,166,161,0.18);
  color:var(--primary);
  font-weight:900;
  flex:0 0 auto;
}
.noteSmall{margin-top:10px; font-size:12px}

/* Modal (compartir) */
body.modalOpen{overflow:hidden}
.modal{position:fixed;inset:0;z-index:80;display:none}
.modal.open{display:block}
.modal__overlay{position:absolute;inset:0;background:rgba(11,31,51,.55);backdrop-filter:blur(3px)}
.modal__card{position:relative;max-width:min(720px, calc(100% - 24px));margin:10vh auto 0;background:var(--card);border:1px solid rgba(221,226,232,.95);border-radius:calc(var(--radius) + 6px);box-shadow:0 22px 60px rgba(0,0,0,.22);padding:16px}
.modal__head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}
.modal__badge{display:inline-flex;align-items:center;gap:8px;padding:6px 10px;border-radius:999px;background:rgba(34,166,161,.12);border:1px solid rgba(34,166,161,.22);font-weight:900;font-size:12px}
.modal__x{border:1px solid rgba(221,226,232,.95);background:#fff;border-radius:12px;padding:8px 10px;cursor:pointer;font-weight:900}
.modal__title{margin:0 0 8px;font-size:18px;letter-spacing:-.2px}
.modal__text{margin:0 0 14px;color:var(--muted);font-size:12px;line-height:1.45}
.shareList{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px}
.shareList--one{grid-template-columns:1fr}
@media (max-width:720px){.shareList{grid-template-columns:1fr}}

/* Utility helpers (avoid inline styles for strict CSP) */
.grid2--mt10{margin-top:10px}
.actions--mt0{margin-top:0}
