:root {
    --bg: #f5f7fb; --card: #ffffff; --ink: #1b2430; --muted: #5b6676;
    --brand: #1f5fd6; --brand-dark: #1747a3; --line: #e1e6ef; --ok: #0e7a4b;
    --warn-bg: #fff6e0; --warn-line: #f0d48a;
  }
  @media (prefers-color-scheme: dark) {
    :root { --bg: #0f141c; --card: #171e29; --ink: #e8edf5; --muted: #a2adbd;
            --brand: #6ea0ff; --brand-dark: #8db4ff; --line: #2a3343; --ok: #4bd08f;
            --warn-bg: #2a2412; --warn-line: #5b4a1a; }
  }
  * { box-sizing: border-box; }
  body { margin: 0; background: var(--bg); color: var(--ink);
         font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
  .wrap { max-width: 820px; margin: 0 auto; padding: 0 16px 48px; }
  header.site { padding: 28px 0 8px; }
  header.site .logo { font-weight: 700; color: var(--brand); letter-spacing: .2px; }
  h1 { font-size: clamp(1.6rem, 4.5vw, 2.3rem); line-height: 1.2; margin: 12px 0 8px; }
  h2 { font-size: 1.35rem; margin: 36px 0 12px; }
  p.lead { color: var(--muted); margin: 0 0 20px; }
  .card { background: var(--card); border: 1px solid var(--line); border-radius: 14px;
          padding: 20px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
  .grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
  @media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }
  .full { grid-column: 1 / -1; }
  label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 4px; }
  input, select { width: 100%; padding: 11px 12px; font: inherit; color: var(--ink);
                  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
  input:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
  .hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }
  button.primary { width: 100%; margin-top: 6px; padding: 13px 16px; font: inherit; font-weight: 700;
                   color: #fff; background: var(--brand); border: 0; border-radius: 10px; cursor: pointer; }
  button.primary:hover { background: var(--brand-dark); }
  #resultado { margin-top: 18px; display: none; }
  .total { font-size: clamp(2rem, 8vw, 2.8rem); font-weight: 800; color: var(--ok); line-height: 1.1; }
  .total small { display: block; font-size: .9rem; font-weight: 500; color: var(--muted); margin-bottom: 4px; }
  table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: .95rem; }
  td { padding: 8px 4px; border-top: 1px solid var(--line); vertical-align: top; }
  td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .notice { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 10px;
            padding: 10px 12px; margin-top: 14px; font-size: .9rem; }
  .error { color: #c0392b; font-weight: 600; margin-top: 10px; display: none; }
  details { border-top: 1px solid var(--line); padding: 12px 0; }
  details:last-of-type { border-bottom: 1px solid var(--line); }
  summary { cursor: pointer; font-weight: 600; }
  details p { margin: 8px 0 0; color: var(--muted); }
  footer { margin-top: 40px; font-size: .85rem; color: var(--muted); }
  footer a { color: var(--muted); }
  .rules li { margin-bottom: 6px; }

  .nav { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
  .nav a { color: var(--ink); text-decoration: none; margin-left: 14px; font-weight: 600; font-size: .95rem; }
  .nav a:hover { color: var(--brand); }
  .nav a.logo { margin-left: 0; font-weight: 700; color: var(--brand); font-size: 1rem; }
  .more a { color: var(--brand); font-weight: 600; }
  .rellenar { background: #fff3a8; color: #3a3000; padding: 0 4px; border-radius: 4px; }
  .legal h2 { font-size: 1.15rem; margin: 28px 0 8px; }
  .legal p, .legal li { color: var(--ink); }
  .legal ul { padding-left: 20px; }
  .cols2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
  @media (max-width: 600px) { .cols2 { grid-template-columns: 1fr; } }
  .sugerencia { background: rgba(31,95,214,.10); border: 1px solid rgba(31,95,214,.35); border-radius: 10px; padding: 10px 12px; margin-top: 8px; font-size: .92rem; }
  .sugerencia a { color: var(--brand); font-weight: 600; }
  .cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .kpis { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-top: 14px; }
  .kpi { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg); }
  .kpi small { display: block; color: var(--muted); font-size: .8rem; }
  .kpi b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
  .tabla-wrap { overflow-x: auto; margin-top: 12px; }
  table.tabla { font-size: .9rem; }
  table.tabla th, table.tabla td { padding: 6px 8px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
  table.tabla th { text-align: right; color: var(--muted); font-weight: 600; border-top: 0; }
  table.tabla th:first-child, table.tabla td:first-child { text-align: left; }
  .chart { width: 100%; height: auto; margin-top: 12px; color: var(--ink); }
  .checks label { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; font-size: .93rem; }
  .checks input { width: auto; margin-top: 5px; }
  .mini { margin-top: 18px; }
  .mini h3 { font-size: 1.02rem; margin: 0 0 10px; }
  .mini .res { margin-top: 10px; font-weight: 700; color: var(--ok); font-variant-numeric: tabular-nums; }
  .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
  .row input { width: 8.5rem; }
  ul.compacta { padding-left: 20px; }
  ul.compacta li { margin-bottom: 6px; }
  .sug { margin-top: 40px; background: linear-gradient(135deg, rgba(31,95,214,.08), transparent 70%), var(--card); }
  .sug h2 { margin: 0 0 6px; }
  .sug .lead { margin-bottom: 14px; }
  .sug textarea { width: 100%; padding: 11px 12px; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; resize: vertical; }
  .sug textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
  .sug .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
  .sug button.primary { margin-top: 14px; }
  .sugEstado { margin-top: 10px; font-weight: 600; font-size: .93rem; }
  .sugEstado.ok { color: var(--ok); } .sugEstado.ko { color: #c0392b; }
  .sug .hint a { color: var(--brand); }
  .res-texto { white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-top: 10px; }
  textarea.grande { width: 100%; padding: 12px; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; min-height: 180px; resize: vertical; }
  .btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
  .btns button, button.sec { padding: 8px 14px; font: inherit; font-weight: 600; color: var(--brand); background: var(--card); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
  .btns button:hover, button.sec:hover { border-color: var(--brand); }
  .barra { height: 10px; border-radius: 6px; overflow: hidden; display: flex; margin-top: 8px; background: var(--line); }
  .barra i { display: block; height: 100%; }
  .inline { display: flex; gap: 8px; }
  .inline input { flex: 1 1 auto; min-width: 0; }
  .inline select { flex: 0 0 auto; width: auto; min-width: 7.5rem; }
  .oculto { display: none; }
  .drop { border: 2px dashed var(--line); border-radius: 14px; padding: 28px 16px; text-align: center; cursor: pointer; background: var(--bg); transition: border-color .15s, background .15s; }
  .drop:hover, .drop:focus, .drop.sobre { border-color: var(--brand); outline: none; background: rgba(31,95,214,.06); }
  .drop strong { display: block; color: var(--brand); font-size: 1.05rem; }
  .drop span { color: var(--muted); font-size: .9rem; }
  .drop input { display: none; }
  .archivos { list-style: none; padding: 0; margin: 14px 0 0; }
  .archivos li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; background: var(--card); }
  .archivos .nom { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: .93rem; }
  .archivos .meta { color: var(--muted); font-size: .82rem; white-space: nowrap; }
  .archivos button { padding: 4px 9px; font: inherit; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
  .archivos button:hover { border-color: var(--brand); }
  .archivos img.mini { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
  a.btn-desc { display: block; margin-top: 10px; padding: 12px 14px; text-align: center; font-weight: 700; color: #fff; background: var(--ok); border-radius: 10px; text-decoration: none; }
  a.btn-desc:hover { filter: brightness(1.08); }
  .res-arch { margin-top: 14px; }
  .priv { font-size: .88rem; color: var(--muted); margin: 10px 0 0; }
  button.primary:disabled { opacity: .55; cursor: not-allowed; }
  input[type=range] { padding: 0; }

  .mas { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }
  .mas h3 { margin: 0 0 4px; font-size: 1.05rem; }
  .mas-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-top: 8px; }
  .mas-grid button { text-align: left; }

/* ===== Diseño multiherramienta: barra superior, portada, tarjetas, buscador ===== */
:root { --shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 14px rgba(16,24,40,.06); --shadow-lg: 0 10px 30px rgba(16,24,40,.14); --brand2: #7c4dff; }
@media (prefers-color-scheme: dark) { :root { --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.25); --shadow-lg: 0 10px 30px rgba(0,0,0,.5); --brand2: #a688ff; } }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body { -webkit-font-smoothing: antialiased; }
h1 { font-weight: 800; letter-spacing: -.02em; }
.card { border-radius: 16px; box-shadow: var(--shadow); }
button.primary { background: linear-gradient(135deg, var(--brand), var(--brand2)); border-radius: 12px; box-shadow: 0 4px 12px rgba(31,95,214,.25); transition: transform .12s, box-shadow .12s, filter .12s; }
button.primary:hover { background: linear-gradient(135deg, var(--brand), var(--brand2)); filter: brightness(1.07); transform: translateY(-1px); }
mark { background: rgba(255,200,0,.38); color: inherit; border-radius: 3px; padding: 0 1px; }

/* Barra superior */
.topbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--card) 88%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topin { max-width: 820px; margin: 0 auto; padding: 9px 16px; display: flex; align-items: center; gap: 14px; }
.home .topin { max-width: 1120px; }
.topbar .logo { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-weight: 800; letter-spacing: -.02em; font-size: 1.05rem; white-space: nowrap; }
.mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: #fff; font-weight: 800; background: linear-gradient(135deg, var(--brand), var(--brand2)); box-shadow: 0 2px 8px rgba(31,95,214,.35); }
.tsp { flex: 1; }
.tnav { display: flex; gap: 4px; margin-left: auto; }
.tnav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem; padding: 7px 11px; border-radius: 999px; }
.tnav a:hover { color: var(--brand); background: var(--bg); }
.tsearch { position: relative; flex: 1 1 auto; max-width: 440px; }
.tsearch input, .herosearch input { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 9px 40px 9px 38px; font-size: .96rem; transition: border-color .15s, box-shadow .15s, background .15s; -webkit-appearance: none; appearance: none; }
.tsearch input:focus, .herosearch input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(31,95,214,.16); background: var(--card); }
.lupa { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: .95rem; opacity: .7; pointer-events: none; }
kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font: 600 .75rem/1 ui-monospace, Menlo, Consolas, monospace; color: var(--muted); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 3px 6px; background: var(--card); pointer-events: none; }
input:focus ~ kbd { opacity: 0; }
.tres { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 8px); margin: 0; padding: 6px; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); max-height: min(70vh, 460px); overflow-y: auto; min-width: min(360px, 92vw); }
.tres li.cab { padding: 8px 10px 4px; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tres li a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--ink); margin: 0; }
.tres li.on a, .tres li a:hover { background: var(--bg); }
.tres li.on a { box-shadow: inset 3px 0 0 var(--brand); }
.tres .tx { min-width: 0; }
.tres .tx strong { display: block; font-size: .95rem; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tres .tx small { display: block; color: var(--muted); font-size: .78rem; }
.tres li.vacio { padding: 14px 12px; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.tres li.vacio a { display: inline; padding: 0; color: var(--brand); font-weight: 600; box-shadow: none; background: none; }
.ic { display: grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; font-size: 1.3rem; line-height: 1; background: hsl(var(--h, 215) 90% 94%); }
.tres .ic { width: 34px; height: 34px; font-size: 1.1rem; border-radius: 10px; }
@media (prefers-color-scheme: dark) { .ic { background: hsl(var(--h, 215) 38% 22%); } }
@media (max-width: 720px) { .tnav a:last-child { display: none; } .topin { gap: 10px; } kbd { display: none; } .tsearch input { padding-right: 14px; } }
@media (max-width: 520px) { body:not(.home) .logo .lt, body:not(.home) .tnav { display: none; } }

/* Migas de pan */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .86rem; color: var(--muted); margin-top: 4px; }
.crumbs a { color: var(--muted); text-decoration: none; font-weight: 600; }
.crumbs a:hover { color: var(--brand); }
header.site { padding-top: 18px; }

/* Portada */
.home .wrap { max-width: 1120px; }
.hero { text-align: center; padding: 54px 0 26px; position: relative; }
.hero::before { content: ""; position: absolute; inset: -20px -40vw 0; z-index: -1; background: radial-gradient(60% 70% at 50% 0%, rgba(124,77,255,.16), transparent 70%), radial-gradient(45% 55% at 12% 20%, rgba(31,95,214,.14), transparent 70%), radial-gradient(40% 50% at 90% 15%, rgba(255,122,69,.12), transparent 70%); }
.eyebrow { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 18px; }
.eyebrow span { font-size: .8rem; font-weight: 700; color: var(--brand); background: rgba(31,95,214,.1); border: 1px solid rgba(31,95,214,.22); border-radius: 999px; padding: 4px 12px; }
.hero h1 { font-size: clamp(2rem, 5.6vw, 3.4rem); line-height: 1.08; max-width: 21ch; margin: 0 auto 14px; }
.hero .lead { max-width: 62ch; margin: 0 auto 26px; font-size: clamp(1rem, 2.4vw, 1.12rem); }
.herosearch { position: relative; max-width: 700px; margin: 0 auto; }
.herosearch input { font-size: 1.08rem; padding: 17px 54px 17px 50px; background: var(--card); border: 2px solid var(--line); box-shadow: var(--shadow-lg); }
.herosearch .lupa { left: 20px; font-size: 1.15rem; }
.herosearch kbd { right: 18px; }
.populares { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 18px auto 0; max-width: 820px; align-items: center; }
.populares > span { color: var(--muted); font-size: .88rem; font-weight: 600; }
.populares a { font-size: .88rem; font-weight: 600; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; transition: border-color .15s, transform .12s; }
.populares a:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 2px 10px; margin: 10px -2px 0; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; font: inherit; font-weight: 600; font-size: .92rem; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; cursor: pointer; white-space: nowrap; transition: border-color .15s, background .15s, color .15s; }
.chip b { font-weight: 700; font-size: .78rem; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 1px 7px; margin-left: 4px; }
.chip:hover { border-color: var(--brand); }
.chip.on { color: #fff; background: var(--brand); border-color: var(--brand); }
.chip.on b { color: var(--brand); background: #fff; }

.grupo { scroll-margin-top: 80px; }
.grupo h2 { display: flex; align-items: center; gap: 10px; margin: 30px 0 14px; font-size: 1.3rem; letter-spacing: -.01em; }
.gic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; font-size: 1.1rem; background: hsl(var(--h, 215) 90% 94%); }
@media (prefers-color-scheme: dark) { .gic { background: hsl(var(--h, 215) 38% 22%); } }
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.cardlink { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; }
.cardlink:hover, .cardlink:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: hsl(var(--h, 215) 70% 55% / .7); outline: none; }
.cardlink .ic { width: 48px; height: 48px; font-size: 1.5rem; border-radius: 14px; }
.cardlink .tx { min-width: 0; }
.cardlink strong { display: block; color: var(--ink); font-size: 1rem; line-height: 1.25; margin-bottom: 2px; }
.cardlink .tx > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: .86rem; line-height: 1.4; }
.sinres { text-align: center; color: var(--muted); padding: 34px 12px; }
.sinres a { color: var(--brand); font-weight: 600; }
#restit { font-size: 1.05rem; color: var(--muted); font-weight: 600; margin-top: 18px; }

/* Pie */
footer { margin-top: 48px; padding-top: 8px; border-top: 1px solid var(--line); }
.fcols { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin: 22px 0; }
.fcols h3 { font-size: .85rem; margin: 0 0 8px; color: var(--ink); }
.fcols ul { list-style: none; margin: 0; padding: 0; }
.fcols li { margin-bottom: 5px; line-height: 1.35; }
.fcols a { text-decoration: none; }
.fcols a:hover { color: var(--brand); text-decoration: underline; }

@media (min-width: 900px) { .chips { flex-wrap: wrap; overflow: visible; } }

/* ===== Editor de PDF y herramientas de archivos ===== */
.tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 8px; }
.tool { font: inherit; font-weight: 600; font-size: .88rem; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 7px 11px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.tool:hover { border-color: var(--brand); }
.tool.on { color: #fff; background: var(--brand); border-color: var(--brand); }
.opts { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 8px 2px; min-height: 42px; font-size: .9rem; }
.opt { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; margin: 0; }
.opt input[type=number] { width: 4.5rem; padding: 6px 8px; }
.opt select { width: auto; padding: 6px 8px; }
.opt input[type=color] { width: 36px; height: 30px; padding: 2px; border-radius: 8px; }
.opt input[type=range] { width: 120px; }
.opt.chk { font-weight: 500; }
.opt.chk input { width: auto; }
.opt.ok { color: var(--ok); }
.mk { font: inherit; font-weight: 600; min-width: 34px; padding: 5px 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; cursor: pointer; margin-left: 4px; }
.mk.on { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(31,95,214,.25); }
.mk.sw { width: 30px; min-width: 30px; height: 26px; padding: 0; }
.pagbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 10px; font-size: .92rem; }
.pagbar .sep { flex: 1; }
.pagbar button:disabled { opacity: .45; cursor: not-allowed; }
.lienzo { position: relative; margin: 0 auto; background: #fff; box-shadow: 0 2px 14px rgba(0,0,0,.22); max-width: 100%; touch-action: pan-y; }
.lienzo canvas { position: absolute; left: 0; top: 0; display: block; }
.lienzo #base { position: relative; }
#capa { touch-action: none; }
#textos { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
#capa { z-index: 3; }
#textos .hit { position: absolute; border-radius: 3px; cursor: text; }
#textos.on .hit:hover { background: rgba(31,95,214,.18); outline: 1.5px solid #1f5fd6; }
#textos.on .hit { background: rgba(31,95,214,.06); }
.txtin { position: absolute; z-index: 5; border: 2px solid #1f5fd6; background: rgba(255,255,255,.95); padding: 0 3px; margin: 0; border-radius: 4px; outline: none; line-height: 1.2; width: auto; box-sizing: content-box; }
.firmapanel { border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 8px 0 12px; background: var(--bg); }
.firmapanel .tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.firmapanel canvas { width: 100%; max-width: 520px; height: auto; background: #fff; border: 1px dashed var(--line); border-radius: 10px; touch-action: none; display: block; }
#firmaVista { margin-top: 8px; }
.firmapanel input[type=text] { max-width: 520px; }
.res-arch .btn-desc { display: block; }
.pgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); margin: 14px 0; }
.pg { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 8px; text-align: center; cursor: grab; }
.pg.del { opacity: .45; border-style: dashed; }
.pg.arrastrando { opacity: .4; }
.pgbox { position: relative; height: 200px; margin: 0 auto 6px; background: repeating-conic-gradient(rgba(127,127,127,.08) 0% 25%, transparent 0% 50%) 50% / 16px 16px; border-radius: 6px; overflow: hidden; }
.pgbox canvas { position: absolute; left: 50%; top: 50%; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.25); }
.pgn { font-size: .82rem; font-weight: 600; color: var(--muted); }
.pgbar { display: flex; justify-content: center; gap: 4px; margin-top: 6px; }
.pgbar button { font: inherit; font-size: .9rem; padding: 4px 8px; min-width: 30px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; cursor: pointer; }
.pgbar button:hover { border-color: var(--brand); color: var(--brand); }
.vista { text-align: center; margin: 8px 0 12px; }
.vista canvas { max-width: 100%; height: auto; background: #fff; box-shadow: 0 1px 8px rgba(0,0,0,.25); border-radius: 2px; }

textarea.txtin { display: block; padding: 0 2px; font-family: inherit; min-height: 1.2em; }

.seguro { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: .88rem; cursor: pointer; }
.seguro input { width: auto; margin-top: 4px; }
.seguro small { color: var(--muted, #667); font-weight: 400; }
