body { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.brand h1 { font-size: 18px; letter-spacing: -.01em; }
.mark { width: 22px; height: 22px; flex: none; }
.tagline { font-size: 12px; }
.badge.local { background: rgba(74, 222, 128, .14); color: var(--ok); }

/* Con más de una herramienta el encabezado es también la navegación. */
.tools { display: flex; gap: 4px; }
.tool {
  text-decoration: none; font-size: 13px; color: var(--muted);
  padding: 6px 12px; border-radius: 8px; white-space: nowrap;
}
.tool:hover { color: var(--text); background: var(--panel-2); }
.tool.current { color: var(--text); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }

.icon-btn {
  display: grid; place-items: center; padding: 6px;
  background: transparent; border-color: transparent; color: var(--muted);
}
.icon-btn:hover:not(:disabled) { color: var(--text); background: var(--panel-2); border-color: var(--line); }

/* Panel de opciones: fuera de la columna, que era donde estorbaba. */
.sheet {
  position: fixed; top: 56px; right: 16px; z-index: 20; width: min(360px, calc(100vw - 32px));
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
  display: flex; flex-direction: column;
  max-height: calc(100vh - 88px); overflow-y: auto;
}
.sheet[hidden] { display: none; }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 8px;
}
.sheet-head h2 { font-size: 14px; }
.sheet .options-body { padding: 0 14px 14px; }
.scrim { position: fixed; inset: 0; z-index: 10; }
.scrim[hidden] { display: none; }

main { flex: 1; display: grid; grid-template-columns: 380px 1fr; gap: 0; min-height: 0; }

.left {
  padding: 16px; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 14px; overflow-y: auto;
}

.drop {
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 22px 16px; text-align: center; background: var(--panel);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: border-color .15s, background .15s;
}
.drop.over { border-color: var(--accent); background: rgba(226, 87, 76, .08); }
.drop-title { margin: 0; font-size: 14px; }
.small { font-size: 12px; }
.muted.small { margin: 0; }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); cursor: pointer;
}
.item.active { border-color: var(--accent); }
.item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.item .meta { font-size: 11px; color: var(--muted); white-space: nowrap; }
.item .meta.err { color: var(--err); }
.item .drop-btn { background: transparent; border: 0; color: var(--muted); padding: 2px 4px; }
.item .drop-btn:hover { color: var(--err); }

.options { display: flex; flex-direction: column; gap: 10px; }
.chk { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.chk input { width: 15px; height: 15px; padding: 0; accent-color: var(--accent); }

.block { width: 100%; }
.status { font-size: 12px; min-height: 16px; margin: 0; text-align: center; }
.status.err { color: var(--err); }
.status.ok { color: var(--ok); }

.right { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.preview-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.preview-bar button { padding: 2px 10px; line-height: 1.2; }

.stage {
  flex: 1; overflow: auto; padding: 20px;
  display: flex; align-items: flex-start; justify-content: center;
  background: #0b0d11;
}
.stage canvas { box-shadow: 0 6px 28px rgba(0, 0, 0, .55); border-radius: 2px; }
.empty { margin: auto; font-size: 13px; }

.foot { padding: 9px 18px; border-top: 1px solid var(--line); font-size: 11px; text-align: center; }
.sep { opacity: .5; margin: 0 4px; }

@media (max-width: 860px) {
  main { grid-template-columns: 1fr; }
  .left { border-right: 0; border-bottom: 1px solid var(--line); }
}

.tag {
  flex: none; font-size: 10px; font-weight: 700; letter-spacing: .03em;
  padding: 2px 6px; border-radius: 5px;
}
.tag-pdf { background: rgba(226, 87, 76, .16); color: var(--accent); }
.tag-docx { background: rgba(74, 123, 255, .16); color: var(--word); }
.tag-x { background: var(--panel-2); color: var(--muted); }

.item .meta.warn { color: var(--warn); }
.status.warn { color: var(--warn); }

/* Unir PDF: el orden de la lista es el orden del documento, así que se ve y
   se arrastra. El número va delante porque es el dato que se comprueba. */
.grip { flex: none; color: var(--muted); cursor: grab; font-size: 13px; line-height: 1; }
.item .order {
  flex: none; min-width: 20px; text-align: center;
  font-variant-numeric: tabular-nums; font-weight: 700;
}
.item.dragging { opacity: .4; }
.item.over { border-color: var(--accent); box-shadow: 0 -2px 0 -1px var(--accent); }

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .tools { order: 3; width: 100%; }
  .tagline { display: none; }
}

/* ---------- página de planes ---------- */
.page { display: block; overflow-y: auto; padding: 0 20px 64px; }
.page > section { max-width: 1080px; margin: 0 auto; }

.hero { padding: 44px 0 28px; text-align: center; }
.hero h2 { font-size: clamp(24px, 4vw, 34px); letter-spacing: -.02em; }
.hero p { max-width: 60ch; margin: 12px auto 0; font-size: 15px; }

.planes { display: grid; gap: 14px; align-items: start; }
@media (min-width: 700px) { .planes { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .planes { grid-template-columns: repeat(4, 1fr); } }

.plan {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 18px;
}
.plan.destacado { border-color: var(--accent); box-shadow: 0 10px 40px -20px var(--accent); }
.cinta {
  position: absolute; top: -10px; left: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #2a0d09; font-size: 10px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; padding: 3px 9px; border-radius: 999px;
}
.plan h3 { font-size: 15px; letter-spacing: .01em; }
.precio { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.precio.pequeno { font-size: 19px; }
.precio .mes { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.periodo { margin: -6px 0 0; font-size: 12px; }
.plan ul {
  margin: 4px 0 0; padding-left: 18px; font-size: 13.5px; line-height: 1.5;
  display: flex; flex-direction: column; gap: 6px; color: var(--text);
}
.plan ul li::marker { color: var(--muted); }
.quien { font-size: 12px; border-top: 1px solid var(--line); padding-top: 10px; margin: auto 0 0; }

.cta {
  display: block; text-align: center; text-decoration: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #2a0d09; font-weight: 700; padding: 10px 14px; border-radius: 8px;
}
.cta:hover { filter: brightness(1.07); }
.cta.secundaria {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); font-weight: 600;
}
.cta.secundaria:hover { border-color: #3b4250; background: #232833; }

.sede {
  margin-top: 22px; display: grid; gap: 18px; align-items: center;
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--word); border-radius: var(--radius); padding: 22px 20px;
}
@media (min-width: 820px) { .sede { grid-template-columns: 1fr auto; } }
.sede h3 { font-size: 19px; margin-top: 4px; }
.sede p { max-width: 66ch; margin: 8px 0 0; font-size: 14px; }
.sede-cta { display: flex; flex-direction: column; gap: 10px; min-width: 200px; }
.eyebrow {
  font-size: 10px; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: var(--word);
}

.pagos { margin-top: 34px; text-align: center; }
.pagos h3 { font-size: 19px; }
.metodos { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 14px 0 16px; }
.metodo {
  font-size: 12.5px; font-weight: 600; padding: 7px 13px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
}
.pagos .nota { max-width: 68ch; margin: 0 auto 10px; font-size: 13px; line-height: 1.55; }
.pagos .cta { max-width: 260px; margin: 8px auto 0; }

.faq { margin-top: 40px; }
.faq h3 { font-size: 19px; margin-bottom: 12px; }
.faq details {
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); margin-bottom: 8px;
}
.faq summary { cursor: pointer; padding: 12px 14px; font-size: 14px; font-weight: 600; }
.faq details[open] summary { border-bottom: 1px solid var(--line); }
.faq p { margin: 0; padding: 12px 14px; font-size: 13.5px; line-height: 1.6; }

.options-body { display: flex; flex-direction: column; gap: 12px; }
.pdf-options { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.pdf-options[hidden] { display: none; }
