/* IAPG CMS — Inicio compacto y Modo rápido (celular) */
.qk { display: none; }

@media (max-width: 860px) {
  /* ===== Inicio: una sola pantalla, sin scroll, sin barra inferior ===== */
  body.m-on-home .m-tabbar { display: none !important; }
  #editorCol.is-home, #editorCol[data-sec="home"] { overflow: hidden !important; padding: 0 !important; }
  .hm { box-sizing: border-box; height: calc(100dvh - 64px); display: flex; flex-direction: column; gap: 22px;
    padding: 22px 16px calc(14px + env(safe-area-inset-bottom)); color: #f8fafc; font-family: 'Inter', sans-serif; }
  .hm-brand { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
  .hm-brand img { width: 54px; height: 54px; border-radius: 14px; flex: 0 0 auto; }
  .hm-brand h1 { margin: 0; font: 800 21px/1.15 'Inter', sans-serif; }
  .hm-brand p { margin: 4px 0 0; font: 500 13px/1.3 'Inter', sans-serif; color: #94a3b8; }

  .hm-hero { position: relative; flex: 0 0 auto; padding: 20px 18px 18px; border-radius: 20px; background: linear-gradient(150deg, #12304f 0%, #131d33 70%); border: 1px solid #24415f;
    box-shadow: 0 14px 30px -18px rgba(2,132,199,.7); }
  .hm-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .hm-hero-k { font: 700 11px 'Inter', sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #38bdf8; }
  .hm-other-btn { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid #35476b; background: rgba(255,255,255,.04);
    color: #cbd5e1; font: 700 12px 'Inter', sans-serif; }
  .hm-other-btn svg { width: 14px; height: 14px; transition: transform .2s; }
  .hm-hero.show-others .hm-other-btn svg { transform: rotate(180deg); }
  .hm-hero h2 { margin: 12px 0 4px; font: 800 20px/1.2 'Inter', sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hm-hero p { margin: 0; font: 500 13px/1.35 'Inter', sans-serif; color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hm-hero-empty p { white-space: normal; }
  .hm-hero-btns { display: grid; grid-template-columns: 1.1fr 1fr; gap: 10px; margin-top: 20px; }
  .hm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; border-radius: 13px; border: 1px solid #35476b;
    background: rgba(255,255,255,.04); color: #f8fafc; font: 700 13.5px 'Inter', sans-serif; padding: 0 6px; white-space: nowrap; }
  .hm-btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
  .hm-btn.pri { background: linear-gradient(160deg, #0ea5e9, #0369a1); border-color: transparent; box-shadow: 0 10px 20px -10px rgba(2,132,199,.9); }
  .hm-btn:active, .hm-act:active, .hm-item:active { transform: scale(.98); }

  /* Otros programas: lista desplegable sobre la tarjeta */
  .hm-others { display: none; position: absolute; left: 10px; right: 10px; top: 52px; z-index: 5; padding: 8px; border-radius: 16px; background: #0e172b; border: 1px solid #35476b;
    box-shadow: 0 20px 40px -12px rgba(0,0,0,.7); flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
  .hm-hero.show-others .hm-others { display: flex; }
  .hm-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 54px; padding: 0 14px; border-radius: 12px; border: 1px solid #24324f;
    background: #131d33; color: #f8fafc; text-align: left; }
  .hm-item span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .hm-item b { font: 700 14px 'Inter', sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hm-item em { font: 500 12px 'Inter', sans-serif; font-style: normal; color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hm-item svg { width: 18px; height: 18px; color: #64748b; flex: 0 0 auto; }

  /* 4 accesos cuadrados (2 arriba, 2 abajo) */
  .hm-grid { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 12px;
    max-height: calc(100vw - 32px + 2px); }
  .hm-act { min-height: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 16px; border-radius: 20px;
    border: 1px solid #24324f; background: #131d33; color: #f8fafc; text-align: left; overflow: hidden; }
  .hm-act b { font: 800 15.5px/1.2 'Inter', sans-serif; margin-top: auto; }
  .hm-act small { font: 500 12px/1.3 'Inter', sans-serif; color: #94a3b8; margin-top: 4px; }
  .hm-ic { width: 48px; height: 48px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
  .hm-ic svg { width: 24px; height: 24px; }
  .hm-ic.b { background: rgba(14,165,233,.16); color: #38bdf8; } .hm-ic.g { background: rgba(16,185,129,.16); color: #34d399; }
  .hm-ic.p { background: rgba(139,92,246,.18); color: #a78bfa; } .hm-ic.c { background: rgba(6,182,212,.16); color: #22d3ee; }

  /* Pie: logo de la organización + copyright */
  .hm-foot { flex: 0 0 auto; margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
  .hm-foot img { height: 30px; max-width: 70%; object-fit: contain; }
  .hm-foot span { font: 500 11px/1.35 'Inter', sans-serif; color: #64748b; }
}
@media (max-width: 860px) and (max-height: 760px) {
  .hm { gap: 14px; padding-top: 14px; }
  .hm-brand img { width: 46px; height: 46px; } .hm-brand h1 { font-size: 19px; }
  .hm-hero { padding: 16px; } .hm-hero h2 { margin-top: 8px; } .hm-hero-btns { margin-top: 14px; } .hm-btn { height: 48px; }
  .hm-act { padding: 12px; } .hm-ic { width: 40px; height: 40px; } .hm-act small { display: none; }
  .hm-foot img { height: 24px; }
}
@media (max-width: 860px) and (max-height: 660px) {
  .hm-brand p, .hm-hero p, .hm-foot span { display: none; }
  .hm-act b { font-size: 14px; }
}

/* ===== Modo rápido ===== */
@media (max-width: 860px) {
  body.qk-open { overflow: hidden; }
  .qk { position: fixed; inset: 0; z-index: 200; background: #0b1222; color: #f8fafc; font-family: 'Inter', sans-serif; display: none; flex-direction: column; }
  .qk.open { display: flex; }
  .qk-bar { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; border-bottom: 1px solid #1c2944; background: #0e172b; }
  .qk-ttl { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .qk-ttl b { font: 800 16px/1.2 'Inter', sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .qk-ttl span { font: 600 11.5px 'Inter', sans-serif; color: #38bdf8; margin-top: 2px; }
  .qk-ic { width: 44px; height: 44px; border-radius: 12px; border: 1px solid #24324f; background: #131d33; color: #e2e8f0; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
  .qk-ic svg { width: 20px; height: 20px; } .qk-ic.sm { width: 38px; height: 38px; }
  .qk-body { flex: 1; overflow-y: auto; padding: 14px 14px calc(96px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; -webkit-overflow-scrolling: touch; }

  .qk-seg { display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px; border-radius: 14px; background: #0a1020; border: 1px solid #24324f; flex: 0 0 auto; }
  .qk-seg button { height: 42px; border: 0; border-radius: 10px; background: transparent; color: #94a3b8; font: 700 14px 'Inter', sans-serif; }
  .qk-seg button.on { background: linear-gradient(160deg, #0ea5e9, #0369a1); color: #fff; }
  .qk-days { display: flex; gap: 8px; overflow-x: auto; flex: 0 0 auto; padding-bottom: 2px; }
  .qk-days button { height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid #24324f; background: #131d33; color: #cbd5e1; font: 700 13px 'Inter', sans-serif; white-space: nowrap; }
  .qk-days button.on { background: #0284c7; border-color: transparent; color: #fff; }

  .qk-row { display: flex; align-items: stretch; gap: 12px; width: 100%; min-height: 64px; padding: 10px 12px; border-radius: 14px; border: 1px solid #24324f; background: #131d33;
    color: #f8fafc; text-align: left; border-left: 4px solid var(--c, #64748b); flex: 0 0 auto; }
  .qk-row.brk { background: #0f1830; opacity: .9; }
  .qk-row:active { background: #172544; }
  .qk-time { display: flex; flex-direction: column; justify-content: center; min-width: 48px; font: 800 14px 'Inter', sans-serif; font-variant-numeric: tabular-nums; }
  .qk-time i { font: 600 12px 'Inter', sans-serif; font-style: normal; color: #64748b; margin-top: 2px; }
  .qk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
  .qk-main b { font: 700 14.5px/1.3 'Inter', sans-serif; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .qk-main em { font: 500 12.5px 'Inter', sans-serif; font-style: normal; color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .qk-main small { display: inline-flex; align-items: center; gap: 4px; font: 600 11.5px 'Inter', sans-serif; color: #38bdf8; }
  .qk-main small svg { width: 12px; height: 12px; }
  .qk-av { width: 42px; height: 42px; border-radius: 50%; background: rgba(14,165,233,.16); color: #38bdf8; display: inline-flex; align-items: center; justify-content: center; align-self: center; font: 800 16px 'Inter', sans-serif; flex: 0 0 auto; }
  .qk-row.ppl { border-left-width: 1px; }
  .qk-empty { text-align: center; padding: 36px 16px; border-radius: 14px; border: 1px dashed #24324f; color: #94a3b8; font: 500 13.5px/1.5 'Inter', sans-serif; }

  .qk-fab { position: fixed; left: 14px; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 3; height: 54px; border: 0; border-radius: 16px;
    background: linear-gradient(160deg, #d4145a, #a80f47); color: #fff; font: 800 15px 'Inter', sans-serif; display: flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 16px 30px -12px rgba(212,20,90,.8); }
  .qk-fab svg { width: 20px; height: 20px; }

  .qk-card { padding: 14px; border-radius: 16px; border: 1px solid #24324f; background: #131d33; display: flex; flex-direction: column; gap: 12px; flex: 0 0 auto; }
  .qk-ctitle { font: 800 13px 'Inter', sans-serif; color: #94a3b8; letter-spacing: .06em; text-transform: uppercase; }
  .qk-f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
  .qk-f > span { font: 700 12px 'Inter', sans-serif; color: #94a3b8; }
  .qk input, .qk select { box-sizing: border-box; width: 100%; height: 50px; padding: 0 14px; border-radius: 12px; border: 1px solid #35476b; background: #0a1020; color: #f8fafc; font: 500 16px 'Inter', sans-serif; min-width: 0; }
  .qk input:focus, .qk select:focus { outline: 2px solid #0284c7; outline-offset: 0; }
  .qk-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

  .qk-scrim { position: absolute; inset: 0; z-index: 8; background: rgba(2,6,15,.6); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .qk.sheet .qk-scrim { opacity: 1; pointer-events: auto; }
  .qk-sheet { position: absolute; z-index: 9; left: 0; right: 0; bottom: 0; max-height: 88%; overflow-y: auto; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); background: #131d33;
    border-radius: 22px 22px 0 0; border-top: 1px solid #35476b; transform: translateY(100%); transition: transform .24s cubic-bezier(.2,.7,.2,1); display: flex; flex-direction: column; gap: 14px; }
  .qk.sheet .qk-sheet { transform: none; }
  .qk-grab { width: 40px; height: 4px; border-radius: 4px; background: #35476b; margin: 2px auto 0; flex: 0 0 auto; }
  .qk-sh-h { display: flex; align-items: center; justify-content: space-between; }
  .qk-sh-h b { font: 800 17px 'Inter', sans-serif; }
  .qk-spk { display: grid; grid-template-columns: 1fr 44px; gap: 8px; margin-bottom: 8px; }
  .qk-sw { display: flex; align-items: center; justify-content: space-between; height: 52px; padding: 0 14px; border-radius: 12px; border: 1px solid #35476b; background: #0a1020; font: 600 14.5px 'Inter', sans-serif; }
  .qk-sw input { width: 24px; height: 24px; accent-color: #0284c7; }
  .qk-acts { margin-top: 2px; }
  .qk-btn { height: 52px; border-radius: 14px; border: 1px solid #35476b; background: rgba(255,255,255,.04); color: #f8fafc; font: 700 15px 'Inter', sans-serif; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
  .qk-btn svg { width: 18px; height: 18px; }
  .qk-btn.pri { background: linear-gradient(160deg, #0ea5e9, #0369a1); border-color: transparent; }
  .qk-btn.danger { color: #fb7185; border-color: rgba(251,113,133,.4); }
  .qk-toast { position: absolute; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translate(-50%, 10px); padding: 10px 16px; border-radius: 999px; background: #059669; color: #fff; font: 700 13px 'Inter', sans-serif; opacity: 0; pointer-events: none; transition: .2s; z-index: 12; }
  .qk-toast.on { opacity: 1; transform: translate(-50%, 0); }
}


/* ---- Accesos del Inicio: ícono centrado, grande y sin contenedor ---- */
@media (max-width: 860px) {
  .hm-act { align-items: center !important; justify-content: center !important; text-align: center !important; gap: 0; }
  .hm-act .hm-ic { width: auto !important; height: auto !important; background: none !important; border-radius: 0 !important; margin-bottom: 14px; }
  .hm-act .hm-ic svg { width: 52px !important; height: 52px !important; stroke-width: 1.7; }
  .hm-act b { margin-top: 0 !important; }
}
@media (max-width: 860px) and (max-height: 760px) {
  .hm-act .hm-ic { margin-bottom: 10px; }
  .hm-act .hm-ic svg { width: 42px !important; height: 42px !important; }
}

/* ---- Modo rápido: buscador, fotos, confirmación de borrado ---- */
@media (max-width: 860px) {
  .qk-ic[disabled] { opacity: .35; }
  .qk-search { position: relative; display: block; flex: 0 0 auto; }
  .qk-search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: #64748b; pointer-events: none; }
  .qk .qk-search input { padding-left: 42px; height: 48px; border-radius: 14px; background: #131d33; border-color: #24324f; }
  .qk-list { display: flex; flex-direction: column; gap: 10px; }
  .qk-main small.qk-dl { color: #94a3b8; text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; }
  .qk-av { overflow: hidden; }
  .qk-av img { width: 100%; height: 100%; object-fit: cover; }
  .qk-av.lg { width: 76px; height: 76px; font-size: 24px; }
  .qk-photo { display: flex; align-items: center; gap: 14px; }
  .qk-photo-btns { flex: 1; display: grid; gap: 8px; }
  .qk-photo-btns .qk-btn { height: 44px; font-size: 14px; }
  .qk-btn.wide { width: 100%; }
  .qk-btn.danger.armed { background: #e11d48; border-color: transparent; color: #fff; }
  .qk-toast.warn { background: #b45309; }
  .qk-note { margin: 0; text-align: center; font: 500 12px 'Inter', sans-serif; color: #64748b; }
  .qk-sh-h { gap: 10px; } .qk-sh-h b { flex: 1; }
  .hm-foot span { color: #8291a8; }
}

@media (max-width: 860px) {
  .qk.sheet .qk-toast { bottom: auto; top: calc(14px + env(safe-area-inset-top)); transform: translate(-50%, -10px); }
  .qk.sheet .qk-toast.on { transform: translate(-50%, 0); }
  .qk-btn span { white-space: nowrap; }
}
