/* ==========================================================================
   Diseño institucional UCV — replica el diseño de referencia (a.html)
   Paleta: azul #233559 · rojo #E30512 · acento #1D71B8 · fondo claro #f2f2f2
   Los nombres de clase se conservan porque assets/js/*.js dependen de ellos.
   ========================================================================== */
:root {
  --blue:#233559; --blue-hover:#1e3a8a; --red:#E30512; --red-hover:#b91c1c; --accent:#1D71B8; --accent-hover:#155a96;
  --page:#f2f2f2; --ok:#2e7d32;
  --g50:#f9fafb; --g100:#f3f4f6; --g200:#e5e7eb; --g300:#d1d5db; --g400:#9ca3af; --g500:#6b7280; --g600:#4b5563; --g700:#374151; --g900:#111827;
  --sh-sm:0 1px 2px 0 rgba(0,0,0,.05);
  --sh-md:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);
  --sh-lg:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);
  --sh-xl:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);
  /* Área de trabajo: un único ancho fijo compartido por cabecera, contenido y barra inferior */
  --container:1280px; --gutter:24px;
}
@media (min-width:1024px) { :root { --gutter:48px; } }
@media (max-width:640px)  { :root { --gutter:16px; } }
* { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body { margin:0; min-height:100vh; display:flex; flex-direction:column; background:var(--blue); color:var(--g900);
       font:16px/1.5 "Inter",ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif; -webkit-font-smoothing:antialiased; }
::selection { background:#ef4444; color:#fff; }
h1,h2,h3,p { margin:0; }
img { display:block; max-width:100%; }
button, input, select, textarea { font:inherit; color:inherit; }
button { cursor:pointer; }
[hidden] { display:none !important; }
::-webkit-scrollbar { width:8px; height:8px; }
::-webkit-scrollbar-track { background:#f2f2f2; }
::-webkit-scrollbar-thumb { background:#c1c1c1; border-radius:4px; }
::-webkit-scrollbar-thumb:hover { background:#a8a8a8; }
@keyframes fadeIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }

/* ---------- Cabecera corporativa ---------- */
.hero { position:relative; overflow:hidden; background:var(--blue); padding:32px 0 80px; }
.hero-in { position:relative; z-index:10; width:100%; max-width:calc(var(--container) + 2 * var(--gutter)); padding:0 var(--gutter); margin:16px auto 0; display:flex; flex-direction:column; }
.brand { display:flex; flex-direction:column; align-items:flex-start; gap:24px; width:100%; margin-bottom:32px; }
.brand-logo { height:48px; width:auto; object-fit:contain; flex:none; }
.brand-sep { display:none; width:1px; height:40px; background:rgba(255,255,255,.3); flex:none; }
.brand-title { display:flex; align-items:center; gap:16px; }
.brand-ico { width:40px; height:40px; object-fit:contain; flex:none; }
.hero h1 { font-size:20px; line-height:1.25; font-weight:700; letter-spacing:-.025em; color:#fff; }
.hero p { margin-top:4px; font-size:12px; line-height:16px; font-weight:400; color:rgba(255,255,255,.8); }
@media (min-width:768px) {
  .brand { flex-direction:row; align-items:center; gap:32px; }
  .brand-logo { height:56px; } .brand-sep { display:block; height:48px; } .brand-ico { width:48px; height:48px; }
  .hero h1 { font-size:24px; line-height:32px; } .hero p { font-size:14px; line-height:20px; }
}
@media (min-width:1024px) { .brand-logo { height:64px; } .hero h1 { font-size:30px; line-height:36px; } }

.steps { display:flex; align-items:center; flex-wrap:wrap; gap:16px; }
.step { line-height:20px; display:flex; align-items:center; gap:12px; padding:8px 20px; border-radius:999px; font-size:14px; font-weight:500;
        background:rgba(255,255,255,.1); color:rgba(255,255,255,.6); transition:background-color .3s,color .3s; }
.step .sn { width:28px; height:28px; border-radius:50%; display:flex; align-items:center; justify-content:center;
            font-size:14px; font-weight:700; background:rgba(255,255,255,.2); color:rgba(255,255,255,.8); }
.step.on { background:#fff; color:var(--blue); box-shadow:var(--sh-md); }
.step.on .sn { background:var(--red); color:#fff; }
.step.done { background:transparent; border:1px solid rgba(255,255,255,.2); }
.step.done .sn { width:auto; height:auto; background:none; color:#4ade80; }

/* ---------- Contenedor principal (vista clara) ---------- */
.main { flex:1 1 auto; width:100%; position:relative; background:var(--page); box-shadow:inset 0 2px 4px 0 rgba(0,0,0,.05); }
.wrap { position:relative; z-index:20; width:100%; max-width:calc(var(--container) + 2 * var(--gutter)); margin:-64px auto 0; padding:0 var(--gutter) 48px; overflow-wrap:anywhere; }
.wrap > * { min-width:0; max-width:100%; }
.wrap.wide { padding-bottom:160px; }
.card { background:#fff; border:1px solid var(--g200); border-radius:12px; box-shadow:var(--sh-xl); }
.card h2 { font-size:20px; line-height:28px; font-weight:700; color:var(--blue); margin-bottom:8px; }
.card .lead { font-size:14px; line-height:20px; color:var(--g600); }
.alert { display:flex; gap:8px; align-items:flex-start; background:#fef2f2; border:1px solid #fecaca; color:#991b1b; padding:12px 16px;
         border-radius:8px; margin-bottom:16px; font-size:14px; box-shadow:var(--sh-md); }
.alert i { margin-top:3px; }
.muted { color:var(--g500); font-size:14px; }

/* ---------- Paso 1: subir ---------- */
.card.up { overflow:hidden; }
.card-head { padding:32px 32px 24px; border-bottom:1px solid var(--g200); }
.card-head h2 { margin-bottom:8px; }
.card-body { padding:32px; }
.drop { display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; width:100%; cursor:pointer;
        padding:64px 24px; border:2px dashed var(--g300); border-radius:12px; background:var(--g50); transition:all .3s; }
.drop:hover { background:var(--g100); }
.drop.over { border-color:var(--red); background:rgba(254,242,242,.5); }
.drop img { width:64px; height:64px; object-fit:contain; margin-bottom:16px; transition:transform .3s; }
.drop:hover img { transform:scale(1.1); }
.drop h3 { font-size:18px; line-height:28px; font-weight:700; color:var(--blue); margin-bottom:8px; }
.drop .d1 { font-size:14px; line-height:20px; color:var(--g500); margin-bottom:8px; }
.drop .d2 { font-size:12px; line-height:16px; font-weight:500; color:var(--g400); }
.drop input { display:none; }
.files { list-style:none; margin:24px 0 0; padding:0; display:flex; flex-direction:column; gap:8px; }
.files:empty { display:none; }
.files li { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:16px; background:var(--g50);
            border:1px solid var(--g200); border-radius:8px; box-shadow:var(--sh-sm); }
.files .fi { display:flex; align-items:center; gap:12px; min-width:0; }
.files .fi > i { font-size:24px; line-height:1; flex:none; }
.files .fn { display:flex; flex-direction:column; min-width:0; text-align:left; }
.files .fn b { font-size:14px; font-weight:500; color:var(--blue); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.files .fn span { font-size:12px; color:var(--g500); }
.files .fx { border:0; background:none; padding:8px; color:var(--g400); font-size:18px; line-height:1; transition:color .15s; }
.files .fx:hover { color:var(--red); }
.keyinfo { display:flex; gap:8px; align-items:center; margin-top:16px; padding:12px 16px; font-size:14px; color:var(--blue);
           background:#eff6ff; border:1px solid #bfdbfe; border-radius:8px; }
.keyinfo i { color:var(--accent); }
.prog { height:8px; margin-top:24px; background:var(--g200); border-radius:999px; overflow:hidden; }
.prog i { display:block; height:100%; width:0; background:var(--red); transition:width .25s; }
.ptxt { text-align:center; margin-top:8px; }
.center { display:flex; justify-content:center; margin-top:40px; }

/* ---------- Botones ---------- */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; border:0; border-radius:8px; padding:10px 20px;
       font-size:14px; font-weight:500; line-height:1.25; color:#fff; background:var(--blue); box-shadow:var(--sh-sm); white-space:nowrap; transition:all .15s; }
.btn:hover { background:var(--blue-hover); }
.btn:disabled { cursor:not-allowed; }
.btn.sm { padding:6px 16px; border-radius:4px; }
.btn.red { background:var(--red); font-weight:500; box-shadow:var(--sh-lg); padding:10px 24px; }
.btn.red:hover { background:var(--red-hover); box-shadow:var(--sh-xl); }
.btn.info { background:var(--accent); }
.btn.info:hover { background:var(--accent-hover); }
.btn.grey { border-width:1px; border-style:solid; background:#fff; color:var(--g700); border-color:var(--g300); box-shadow:none; padding:10px 16px; border-radius:8px; }
.btn.grey:hover { background:var(--g50); }
.btn.grey i { color:var(--g500); }
.btn.ghost { border-width:1px; border-style:solid; background:#fff; color:var(--accent); border-color:#bfdbfe; padding:8px 16px; border-radius:8px; }
.btn.ghost:hover { background:rgba(239,246,255,.6); border-color:var(--accent); box-shadow:var(--sh-md); }
.btn.soft { border-width:1px; border-style:solid; background:#f0f4f8; color:var(--blue); border-color:#d0dbe7; border-radius:6px; padding:8px 16px; font-size:12px; font-weight:600; }
.btn.soft:hover { background:#e1e8f0; }
.btn.go { padding:12px 32px; font-size:16px; line-height:24px; font-weight:600; background:var(--red); box-shadow:var(--sh-lg); }
.btn.go:hover { background:var(--red-hover); }
.btn.go i { font-size:14px; }
.btn.go:disabled { background:var(--g200); color:var(--g400); box-shadow:none; }
.btn img { width:16px; height:16px; object-fit:contain; filter:brightness(0) invert(1); }
.btn.zip img { filter:none; }

/* ---------- Paso 2: resumen y filtros ---------- */
.card.pad { padding:24px; margin-bottom:24px; box-shadow:var(--sh-lg); }
.card.pad .lead { margin-bottom:24px; }
.stats { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin-bottom:24px; }
.stat { display:flex; flex-direction:column; justify-content:center; padding:16px; background:var(--g50); border:1px solid var(--g200); border-radius:8px; }
.stat b { display:block; font-size:30px; line-height:36px; font-weight:700; color:var(--blue); margin-bottom:4px; }
.stat span { font-size:12px; font-weight:500; color:var(--g500); }
.stat.w { grid-column:span 2; }
#stUnsure { color:#1D71B8; }
@media (min-width:768px) { .stats { grid-template-columns:repeat(3,minmax(0,1fr)); } .stat.w { grid-column:span 3; } }
@media (min-width:1024px) { .stats { grid-template-columns:repeat(6,minmax(0,1fr)); } }
.tabs { display:flex; flex-wrap:wrap; gap:8px; }
.tab { display:inline-flex; align-items:center; gap:8px; padding:6px 16px; border-radius:999px; font-size:14px; font-weight:500; line-height:20px;
       background:#fff; color:var(--g600); border:1px solid var(--g300); transition:color .15s,border-color .15s,background-color .15s; }
.tab:hover { color:var(--blue); border-color:var(--blue); }
.tab.on { background:var(--blue); color:#fff; border-color:var(--blue); box-shadow:var(--sh-sm); }
.tab img { width:16px; height:16px; object-fit:contain; }

/* ---------- Unidades ---------- */
.unit { background:#fff; border:1px solid var(--g200); border-radius:12px; box-shadow:var(--sh-lg); overflow:hidden; margin-bottom:32px; animation:fadeIn .25s ease-in-out; }
.unit-head { display:flex; flex-direction:column; align-items:flex-start; justify-content:space-between; gap:16px; padding:16px; background:var(--g50); border-bottom:1px solid var(--g200); }
@media (min-width:768px) { .unit-head { flex-direction:row; align-items:center; } }
.u-left { display:flex; align-items:center; gap:12px; min-width:0; }
.u-toggle { flex:none; width:32px; height:32px; display:flex; align-items:center; justify-content:center; border:0; border-radius:4px; background:var(--g200); color:var(--g600); font-size:16px; transition:background-color .15s; }
.u-toggle:hover { background:var(--g300); }
.u-toggle i { transition:transform .15s; }
.unit.collapsed .u-toggle i { transform:rotate(-90deg); }
.unit.collapsed .qlist, .unit.collapsed .addbar { display:none; }
.u-title { display:flex; align-items:center; gap:8px; font-size:18px; line-height:28px; font-weight:700; color:var(--blue); }
.u-edit { border:0; background:none; padding:2px; font-size:12px; color:var(--g400); transition:color .15s; }
.u-edit:hover { color:var(--blue); }
.u-sub, .u-info { display:flex; align-items:center; flex-wrap:wrap; font-size:12px; color:var(--g500); margin-top:4px; }
.u-sub b { font-weight:600; color:var(--g700); margin:0 4px; }
.u-info { margin-top:2px; }
.u-info i { color:var(--accent); margin-right:6px; }
.u-warn { color:var(--red); }
.unit-head > .btn { flex:none; padding:10px 20px; }

.qlist { display:flex; flex-direction:column; gap:24px; padding:24px; }
.addbar { display:flex; flex-direction:column; justify-content:space-between; gap:16px; padding:20px 24px; background:rgba(249,250,251,.8); border-top:1px dashed var(--g200); }
@media (min-width:1280px) { .addbar { flex-direction:row; align-items:center; } }
.add-group { display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
.addbar .btn.ghost i { font-size:12px; }
.support { display:flex; align-items:center; min-height:20px; padding-left:12px; border-left:1px solid var(--g400); font-size:12px; color:var(--g500); }
.support a { color:var(--accent); margin-left:4px; text-decoration:none; }
.support a:hover { text-decoration:underline; }

/* ---------- Preguntas ---------- */
.qrow { display:flex; flex-direction:column; gap:12px; padding:16px; background:#fff; border:1px solid rgba(229,231,235,.9); border-radius:12px; box-shadow:var(--sh-sm); transition:all .15s; }
.qrow:hover { border-color:var(--g300); }
.qrow.unsure { background:rgba(254,242,242,.5); border-color:#fecaca; }
.qrow.fresh { animation:pop .5s ease; }
@keyframes pop { from { background:#dbeafe; } }
.qhead { display:flex; flex-direction:column; align-items:flex-start; justify-content:space-between; gap:16px; }
@media (min-width:1024px) { .qhead { flex-direction:row; } }
.q-main { display:flex; align-items:flex-start; gap:8px; flex:1 1 auto; width:100%; min-width:0; }
.num { padding-top:6px; font-size:15px; font-weight:700; color:var(--g900); user-select:none; }
.num::after { content:"."; }
.qtext { width:100%; padding:6px; font-size:15px; font-weight:600; line-height:1.5; color:var(--g900); background:transparent;
         border:1px solid transparent; border-radius:4px; resize:vertical; outline:none; transition:border-color .15s; }
.qtext:hover { border-color:var(--g300); }
.qtext:focus { border-color:var(--blue); }
.q-tools { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:8px; flex:none; align-self:flex-end; }
@media (min-width:1024px) { .q-tools { flex-wrap:nowrap; align-self:flex-start; } }
.badge { display:inline-flex; align-items:center; gap:4px; padding:4px 8px; border:1px solid transparent; border-radius:999px; font-size:12px; font-weight:500; line-height:16px; white-space:nowrap; }
.b-info { color:#2563eb; background:#eff6ff; border-color:#bfdbfe; }
.b-ok { color:#15803d; background:#f0fdf4; border-color:#bbf7d0; }
.b-warn { color:#a16207; background:#fef9c3; border-color:#fde047; }
.b-warn::before { content:"\f071"; font-family:"Font Awesome 6 Free"; font-weight:900; font-size:11px; }
select { padding:4px 10px; font-size:14px; color:var(--g700); background:#fff; border:1px solid var(--g300); border-radius:4px; outline:none; cursor:pointer; }
select:focus { border-color:var(--blue); }
.pt { display:flex; align-items:center; gap:4px; padding:4px 8px; font-size:12px; font-weight:500; color:var(--g500); background:#fff; border:1px solid var(--g300); border-radius:4px; }
.pt:focus-within { border-color:var(--blue); }
.ptin { width:40px; padding:0; font-size:14px; font-weight:600; text-align:center; color:#1f2937; background:transparent; border:0; outline:none; -moz-appearance:textfield; appearance:textfield; }
.ptin::-webkit-outer-spin-button, .ptin::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.delq { padding:8px; border:0; border-radius:8px; background:none; color:var(--g400); font-size:16px; line-height:1; transition:all .15s; }
.delq:hover { background:#fef2f2; color:var(--red); }

/* opción múltiple */
.opts { display:flex; flex-wrap:wrap; align-items:center; column-gap:16px; padding-left:24px; margin-top:4px; }
.opt { position:relative; flex:0 0 100%; display:flex; align-items:center; gap:12px; margin-bottom:8px; padding:10px; color:var(--g700);
       background:#fff; border:1px solid var(--g200); border-radius:8px; transition:all .15s; }
.opt:hover { border-color:var(--g300); }
.opt:has(.pick:checked) { background:#e8f5e9; border-color:#c8e6c9; color:var(--ok); }
.opt .pick { position:absolute; opacity:0; width:1px; height:1px; pointer-events:none; }
.opt .l { flex:none; width:28px; height:28px; display:flex; align-items:center; justify-content:center; border-radius:50%;
          font-size:12px; font-weight:700; text-transform:uppercase; color:var(--g600); background:var(--g100); cursor:pointer; user-select:none; transition:all .15s; }
.opt .l:hover { background:var(--g200); }
.opt .pick:focus-visible ~ .l { outline:2px solid var(--accent); outline-offset:2px; }
.opt .pick:checked ~ .l { font-size:0; color:#fff; background:var(--ok); box-shadow:var(--sh-sm); }
.opt .pick:checked ~ .l::after { content:"\f00c"; font-family:"Font Awesome 6 Free"; font-weight:900; font-size:12px; }
.opt .optin { flex:1; min-width:0; padding:0; font-size:14px; font-weight:500; color:inherit; background:transparent; border:0; outline:none; }
.opt .optin:focus { color:var(--g900); }
.opt .oprev { display:inline-flex; align-items:center; }
.opt .mark { flex:none; padding:4px 8px; border-radius:4px; font-size:12px; font-weight:600; color:var(--g400); cursor:pointer; transition:all .15s; }
.opt .mark::before { content:"Hacer correcta"; }
.opt .mark:hover { color:#16a34a; }
.opt .pick:checked ~ .mark { color:#15803d; background:#dcfce7; }
.opt .pick:checked ~ .mark::before { content:"Correcta"; }
.opt .rm { flex:none; padding:4px; border:0; background:none; color:var(--g400); transition:color .15s; }
.opt .rm:hover { color:var(--red); }
.th { vertical-align:middle; max-height:60px; max-width:100%; background:#fff; border-radius:4px; }
.opt .th { max-height:34px; }
.opts .addopt { margin-top:8px; }
.chk { display:flex; align-items:center; gap:8px; margin-top:8px; font-size:12px; color:var(--g600); cursor:pointer; }
.chk input { width:14px; height:14px; accent-color:var(--blue); }

/* respuesta corta, ensayo, retroalimentación */
.hint { margin:0 0 8px 24px; font-size:12px; color:var(--g500); }
.gi { width:calc(100% - 24px); margin-left:24px; padding:12px; font-size:14px; color:var(--g700); background:rgba(249,250,251,.5);
      border:1px dashed var(--g300); border-radius:8px; outline:none; transition:border-color .15s; }
.gi:focus { border-color:var(--blue); }
.gi.solid { padding:10px 12px; font-weight:500; background:#fff; border:1px solid var(--g200); }
.gi.solid:focus { border-color:var(--blue); }
.ctxbox { margin:0 0 0 24px; font-size:13px; color:var(--g500); }
.ctxbox summary { cursor:pointer; }
.ctxbox summary i { margin-right:6px; }
.ctxta { width:100%; margin-top:8px; padding:8px 10px; font-size:14px; color:var(--g700); background:#fff; border:1px solid var(--g200); border-radius:8px; resize:vertical; outline:none; }
.ctxta:focus { border-color:var(--blue); }
.prev { margin-left:24px; padding:8px 12px; font-size:14px; background:var(--g50); border:1px solid var(--g200); border-radius:8px; }

/* emparejamiento */
.pairs { display:flex; flex-direction:column; gap:8px; width:100%; padding-left:24px; margin-top:4px; }
.pairrow { display:flex; flex-direction:column; align-items:center; gap:8px; width:100%; }
.pbox { flex:1; width:100%; display:flex; align-items:center; justify-content:space-between; padding:10px; background:#fff; border:1px solid var(--g200); border-radius:8px; transition:border-color .15s; }
.pbox:hover { border-color:var(--g300); }
.pbox input { width:100%; padding:0; font-size:14px; font-weight:500; color:var(--g700); background:transparent; border:0; outline:none; }
.pairrow .arrow { display:none; flex:none; padding:0 4px; font-size:12px; color:var(--g400); }
.rmpair { flex:none; margin-left:8px; padding:4px; border:0; background:none; color:var(--g400); transition:color .15s; }
.rmpair:hover { color:var(--red); }
.pairs .addpair { align-self:flex-start; margin-top:4px; }
@media (min-width:768px) { .pairrow { flex-direction:row; } .pairrow .arrow { display:block; } }

/* ---------- Aviso flotante (toast) ---------- */
.toast { position:fixed; top:24px; right:24px; z-index:120; max-width:calc(100% - 48px); display:flex; align-items:center; gap:12px; padding:12px 20px;
         font-size:14px; line-height:20px; font-weight:500; color:#fff; background:var(--g900); border-radius:8px; box-shadow:var(--sh-xl);
         transform:translateY(-100px); opacity:0; pointer-events:none; transition:all .3s cubic-bezier(.4,0,.2,1); }
.toast.show { transform:translateY(0); opacity:1; }
.toast i.ok { color:#4ade80; }
.toast i.warn { color:#facc15; }

/* ---------- Filtro sin resultados ---------- */
.qempty { padding:32px; text-align:center; color:var(--g500); }
.qempty i { display:block; margin-bottom:8px; font-size:30px; line-height:36px; color:var(--g400); }
.qempty p { font-size:14px; line-height:20px; font-weight:500; }

/* ---------- Barra inferior fija ---------- */
.bar { position:fixed; left:0; bottom:0; z-index:50; width:100%; padding:16px var(--gutter); background:#fff; border-top:1px solid var(--g200); box-shadow:0 -10px 30px rgba(0,0,0,.08); }
.bar-in { max-width:var(--container); margin:0 auto; display:flex; flex-direction:column; align-items:center; justify-content:space-between; gap:16px; }
@media (min-width:768px) { .bar-in { flex-direction:row; } }
.bar-l { display:flex; flex-wrap:wrap; align-items:center; gap:12px; font-size:14px; color:var(--g600); }
.bar-l .lbl { font-weight:500; }
.bar-l .sm-l { font-size:12px; color:var(--g500); }
.bulk { width:56px; padding:4px 8px; font-size:14px; text-align:center; color:var(--g900); background:var(--g50); border:1px solid var(--g300); border-radius:4px; outline:none; }
.bulk:focus { border-color:var(--blue); }
.saved { display:none; align-items:center; margin-left:8px; font-size:12px; color:#16a34a; }
.saved.busy { color:var(--g500); }
.saved.err { display:inline-flex; color:#dc2626; font-weight:600; }
@media (min-width:1024px) { .saved { display:inline-flex; } }
.bar-r { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:12px; width:100%; }
@media (min-width:768px) { .bar-r { width:auto; } }
@media (min-width:1024px) { .bar-r { flex-wrap:nowrap; } }
.bar-r .btn { padding:10px 20px; }

/* ---------- Ventanas modales ---------- */
.modal-back { position:fixed; inset:0; z-index:100; display:flex; align-items:center; justify-content:center; padding:16px; background:rgba(17,24,39,.5); backdrop-filter:blur(4px); animation:mfade .15s ease; }
.modal { width:90%; max-width:448px; padding:24px; color:var(--g900); background:#fff; border:1px solid var(--g200); border-radius:12px; box-shadow:0 25px 50px -12px rgba(0,0,0,.25); animation:mrise .18s ease; }
.modal.small { max-width:384px; }
.modal .m-ico { width:48px; height:48px; display:flex; align-items:center; justify-content:center; margin-bottom:16px; font-size:24px; color:var(--accent); background:#eff6ff; border-radius:50%; }
.modal.danger .m-ico { color:var(--red); background:#fef2f2; }
.modal.edit .m-ico { color:var(--blue); font-size:20px; }
.modal h3 { margin-bottom:8px; font-size:18px; line-height:28px; font-weight:700; color:var(--blue); }
.modal p { margin-bottom:16px; font-size:14px; color:var(--g600); }
.modal .m-quote { padding:12px; font-size:14px; font-weight:500; color:var(--g700); background:var(--g50); border-left:4px solid var(--red); border-radius:0 6px 6px 0;
                  word-break:break-word; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.modal .m-input { width:100%; padding:10px; font-size:14px; border:1px solid var(--g300); border-radius:8px; outline:none; }
.modal .m-input:focus { border-color:var(--blue); box-shadow:0 0 0 1px var(--blue); }
.modal .m-actions { display:flex; justify-content:flex-end; gap:12px; margin-top:24px; }
.modal .m-actions .btn { padding:8px 24px; font-weight:600; box-shadow:none; }
.modal .m-actions .btn.grey { padding:8px 16px; font-weight:500; }
.modal .m-actions .btn.red { box-shadow:var(--sh-md); }
@keyframes mfade { from { opacity:0; } to { opacity:1; } }
@keyframes mrise { from { transform:translateY(10px); opacity:0; } to { transform:none; opacity:1; } }

@media (max-width:640px) {
  .card-head, .card-body { padding:20px; }
  .drop { padding:40px 16px; }
  .opts, .pairs { padding-left:0; }
  .gi { width:100%; margin-left:0; }
  .hint, .ctxbox, .prev { margin-left:0; }
  .opt .mark { display:none; }
}
