*{box-sizing:border-box}
@media (max-width:768px){
  html,body,.header,.container,.panel-header,.cards-grid,.panel-card,.hero-card,.form-card,.apd-soft-card,.apd-plan-card,.apd-benefit-card,.apd-extra-card,.apd-status-card,.apd-roadmap-step{max-width:100%;min-width:0}
  .panel-card,.hero-card,.form-card,.apd-soft-card,.apd-plan-card,.apd-benefit-card,.apd-extra-card,.apd-status-card,.apd-roadmap-step,.alerta-floating,.historico-box,.radar-box,.backfill-box,.banner-card{overflow:hidden}
  .top-nav,.nav-group,.panel-actions,.hero-actions,.hero-features,.soft-actions,.apd-mini-actions,.apd-quick-strip,.apd-plan-cta,.mini-group,.card-lbl-row,.historico-head,.sec-head{min-width:0}
  .apd-plan-grid,.apd-benefit-grid,.apd-status-grid,.apd-roadmap-grid,.apd-extra-grid{grid-template-columns:1fr!important}
  .apd-top-launch,.apd-top-launch.alt,.apd-nav-launch,.soft-action{width:100%;max-width:100%;justify-content:center}
  .brand-title,.brand-sub,.hero-title,.hero-desc,.card-lbl,.panel-sub,.apd-soft-title,.apd-soft-text,.apd-soft-sub,.apd-plan-card h4,.apd-plan-list li,.apd-benefit-card p,.apd-extra-card p,.apd-status-card p,.apd-roadmap-step p,.btn,.mini-btn,.hfeat,.apd-pill,.apd-channel-chip,.apd-extra-chip{overflow-wrap:anywhere;word-break:break-word}
}
@media (max-width:540px){
  .brand-sub{max-width:none}
  .apd-pill,.apd-channel-chip,.apd-extra-chip{max-width:100%;white-space:normal}
}

.apd-theme-toggle{position:fixed;right:16px;bottom:16px;z-index:99999;border:1px solid rgba(15,52,96,.22);border-radius:999px;padding:10px 14px;background:#ffffff;color:#0f3460;box-shadow:0 8px 24px rgba(15,52,96,.18);font:700 13px 'DM Sans',system-ui,sans-serif;cursor:pointer}.apd-theme-toggle:hover{filter:brightness(.98);transform:translateY(-1px)}
body.apd-dark{--azul:#071a33;--azul-mid:#0d2b50;--azul-claro:#76adff;--azul-light:#14345c;--verde:#5ee59a;--verde-bg:#123a25;--rojo:#ff9999;--rojo-bg:#3a1717;--gris-bg:#0b1524;--gris-card:#12243a;--gris-b:#31455f;--gris-b2:#263950;--texto:#f2f7ff;--texto-mid:#d6e2f2;--texto-sub:#aec0d4;--sombra:0 2px 18px rgba(0,0,0,.34);--sombra-md:0 10px 34px rgba(0,0,0,.42);background:#0b1524!important;color:#f2f7ff!important;color-scheme:dark}
body.apd-dark .header{background:#071a33!important;border-bottom:1px solid #244060}body.apd-dark .hero-card{background:linear-gradient(135deg,#071a33 0%,#0d2b50 100%)!important;border:1px solid #2d4d72}
body.apd-dark .form-card,body.apd-dark .panel-card,body.apd-dark .stat-box,body.apd-dark .soft-item,body.apd-dark .alerta-floating,body.apd-dark .alerta-row,body.apd-dark .alerta-meta-item,body.apd-dark .historico-box,body.apd-dark .historico-offer,body.apd-dark .ac-list,body.apd-dark .channel-pref-box{background:#12243a!important;color:#f2f7ff!important;border-color:#31455f!important}
body.apd-dark .form-card-hdr{background:#071a33!important;border-bottom:1px solid #31455f}body.apd-dark input[type="text"],body.apd-dark input[type="email"],body.apd-dark input[type="password"],body.apd-dark select,body.apd-dark textarea{background:#0d1d31!important;color:#f2f7ff!important;border-color:#405873!important}body.apd-dark input::placeholder,body.apd-dark textarea::placeholder{color:#9cafc5!important}
body.apd-dark label,body.apd-dark .panel-sub,body.apd-dark .ph,body.apd-dark .prefs-hint,body.apd-dark .plan-note,body.apd-dark .form-foot,body.apd-dark .separator,body.apd-dark .hist-list li,body.apd-dark .alerta-subtitle,body.apd-dark .alerta-key,body.apd-dark .alerta-meta-k,body.apd-dark .historico-note,body.apd-dark .historico-updated{color:#aec0d4!important}
body.apd-dark .panel-header h2,body.apd-dark .card-lbl,body.apd-dark .plan-title,body.apd-dark .alerta-title,body.apd-dark .soft-title,body.apd-dark .historico-box h4,body.apd-dark .stat-n,body.apd-dark #panel-datos-docente strong,body.apd-dark #panel-preferencias-resumen strong{color:#f2f7ff!important}body.apd-dark .card-lbl{opacity:.86}
body.apd-dark .btn-secondary,body.apd-dark .mini-btn{background:#1a304a!important;color:#f2f7ff!important;border-color:#405873!important}body.apd-dark .btn-outline{color:#b8d6ff!important;border-color:#76adff!important;background:transparent!important}body.apd-dark .btn-outline:hover,body.apd-dark .mini-btn:hover{background:#14345c!important}body.apd-dark .btn-primary{background:#2d7dff!important;color:#fff!important}
body.apd-dark .ac-item{background:#12243a!important;color:#d6e2f2!important;border-color:#263950!important}body.apd-dark .ac-item:hover,body.apd-dark .ac-item.is-active{background:#14345c!important;color:#ffffff!important}body.apd-dark .msg-info{background:#14345c!important;color:#d1e4ff!important}body.apd-dark .msg-ok{background:#123a25!important;color:#a8f5c9!important}body.apd-dark .msg-error{background:#3a1717!important;color:#ffc2c2!important}
body.apd-dark .alerta-progress{background:#1a304a!important}body.apd-dark .alerta-progress-bar{background:linear-gradient(90deg,#76adff,#2d7dff)!important}body.apd-dark .tag-nivel,body.apd-dark .plan-pill{background:#14345c!important;color:#d1e4ff!important}body.apd-dark .plan-pill-neutral,body.apd-dark .historico-chip{background:#1a304a!important;color:#d6e2f2!important;border-color:#405873!important}body.apd-dark .google-wrap iframe{filter:brightness(.92)}body.apd-dark .apd-theme-toggle{background:#12243a;color:#f2f7ff;border-color:#405873;box-shadow:0 8px 24px rgba(0,0,0,.45)}

/* Ajustes extra de contraste para bloques que seguían claros en modo oscuro */
body.apd-dark .plan-card,body.apd-dark .plan-option,body.apd-dark .plan-option-card,body.apd-dark .plan-box,body.apd-dark .repo-shell,body.apd-dark .repo-panel,body.apd-dark .repo-table-wrap,body.apd-dark .repo-drive-box,body.apd-dark .pid-shell,body.apd-dark .pid-panel,body.apd-dark .pid-table-wrap,body.apd-dark .pid-result-box,body.apd-dark .pid-summary-box,body.apd-dark .white-card,body.apd-dark .light-card,body.apd-dark .surface-light,body.apd-dark .apd-plan-card,body.apd-dark .apd-soft-card,body.apd-dark .apd-status-card,body.apd-dark .apd-extra-card,body.apd-dark .apd-benefit-card,body.apd-dark .apd-roadmap-step,body.apd-dark .repositorio-card,body.apd-dark .repo-card,body.apd-dark .pid-card,body.apd-dark .listados-card{background:#12243a!important;border-color:#31455f!important;color:#f2f7ff!important}
body.apd-dark .plan-card h1,body.apd-dark .plan-card h2,body.apd-dark .plan-card h3,body.apd-dark .plan-card h4,body.apd-dark .plan-card h5,body.apd-dark .plan-card h6,body.apd-dark .plan-option h1,body.apd-dark .plan-option h2,body.apd-dark .plan-option h3,body.apd-dark .plan-option h4,body.apd-dark .repo-panel h1,body.apd-dark .repo-panel h2,body.apd-dark .repo-panel h3,body.apd-dark .repo-panel h4,body.apd-dark .pid-panel h1,body.apd-dark .pid-panel h2,body.apd-dark .pid-panel h3,body.apd-dark .pid-panel h4,body.apd-dark .plan-card p,body.apd-dark .plan-option p,body.apd-dark .repo-panel p,body.apd-dark .pid-panel p,body.apd-dark .plan-card li,body.apd-dark .plan-option li,body.apd-dark .repo-panel li,body.apd-dark .pid-panel li,body.apd-dark .plan-card span,body.apd-dark .plan-option span,body.apd-dark .repo-panel span,body.apd-dark .pid-panel span,body.apd-dark .plan-card strong,body.apd-dark .plan-option strong,body.apd-dark .repo-panel strong,body.apd-dark .pid-panel strong,body.apd-dark .plan-card small,body.apd-dark .plan-option small,body.apd-dark .repo-panel small,body.apd-dark .pid-panel small,body.apd-dark .apd-plan-card *,body.apd-dark .repo-card *,body.apd-dark .repositorio-card *,body.apd-dark .pid-card *,body.apd-dark .listados-card *{color:#f2f7ff!important}
body.apd-dark .plan-note,body.apd-dark .muted,body.apd-dark .subtle,body.apd-dark .soft,body.apd-dark .prefs-hint,body.apd-dark .panel-sub,body.apd-dark .historico-note,body.apd-dark .historico-updated{color:#aec0d4!important}
body.apd-dark table{background:#12243a!important;color:#f2f7ff!important}body.apd-dark thead,body.apd-dark thead tr,body.apd-dark thead th{background:#0d1d31!important;color:#f2f7ff!important;border-color:#31455f!important}body.apd-dark tbody tr{background:#12243a!important}body.apd-dark tbody tr:nth-child(even){background:#102035!important}body.apd-dark td,body.apd-dark th{color:#f2f7ff!important;border-color:#31455f!important}body.apd-dark .plan-pill,body.apd-dark .tag,body.apd-dark .badge,body.apd-dark .chip{background:#14345c!important;color:#d9e9ff!important;border-color:#406287!important}body.apd-dark .apd-plan-card .btn-primary,body.apd-dark .plan-card .btn-primary,body.apd-dark .plan-option .btn-primary{background:#2d7dff!important;color:#fff!important}body.apd-dark .apd-plan-card .btn-secondary,body.apd-dark .plan-card .btn-secondary,body.apd-dark .plan-option .btn-secondary{background:#1a304a!important;color:#f2f7ff!important;border-color:#405873!important}

/* Capa final: tarjetas y paneles generados dinámicamente */
body.apd-dark [class*="card"],body.apd-dark [class*="panel"],body.apd-dark [class*="box"],body.apd-dark [class*="table-wrap"],body.apd-dark [class*="result"],body.apd-dark [class*="summary"]{border-color:#31455f!important}
body.apd-dark [class*="card"]:not(.btn):not(button),body.apd-dark [class*="box"]:not(.btn):not(button),body.apd-dark [class*="panel"]:not(.btn):not(button),body.apd-dark [class*="table-wrap"],body.apd-dark [class*="result"],body.apd-dark [class*="summary"]{background-color:#12243a!important;color:#f2f7ff!important}
body.apd-dark [style*="background:#fff"],body.apd-dark [style*="background: #fff"],body.apd-dark [style*="background:white"],body.apd-dark [style*="background: white"],body.apd-dark [style*="background-color:#fff"],body.apd-dark [style*="background-color: #fff"],body.apd-dark [style*="background-color:white"],body.apd-dark [style*="background-color: white"]{background:#12243a!important;color:#f2f7ff!important;border-color:#31455f!important}
body.apd-dark [class*="card"] h1,body.apd-dark [class*="card"] h2,body.apd-dark [class*="card"] h3,body.apd-dark [class*="card"] h4,body.apd-dark [class*="panel"] h1,body.apd-dark [class*="panel"] h2,body.apd-dark [class*="panel"] h3,body.apd-dark [class*="panel"] h4{color:#f2f7ff!important}
body.apd-dark [class*="card"] p,body.apd-dark [class*="card"] li,body.apd-dark [class*="panel"] p,body.apd-dark [class*="panel"] li{color:#d6e2f2!important}
body.apd-dark .footer{background:#071a33!important;border-top:1px solid #244060!important;color:#aec0d4!important}body.apd-dark .footer a{color:#b8d6ff!important}

/* APD VISUAL V2 - capa segura, solo estética */
body:not(.apd-dark){background:linear-gradient(180deg,#f2f7ff 0%,#ffffff 44%,#f7fbff 100%)!important;color:#0d1b35!important}
body:not(.apd-dark) .header{background:linear-gradient(135deg,#071b3a 0%,#0b2c5f 100%)!important;box-shadow:0 18px 42px rgba(7,27,58,.18)!important;border-bottom:1px solid rgba(255,255,255,.08)}
body:not(.apd-dark) .header-inner{padding:16px 24px!important}
body:not(.apd-dark) .brand-icon{border-radius:15px!important;background:rgba(255,255,255,.14)!important;box-shadow:inset 0 0 0 1px rgba(255,255,255,.08)}
body:not(.apd-dark) .brand-title{letter-spacing:-.55px!important;font-weight:900!important}
body:not(.apd-dark) .btn{border-radius:14px!important;font-weight:800!important}
body:not(.apd-dark) .btn-primary{background:#2448f2!important;color:#fff!important;border:1px solid #2448f2!important;box-shadow:0 12px 28px rgba(36,72,242,.20)!important}
body:not(.apd-dark) .btn-outline{background:#fff!important;color:#2448f2!important;border:1px solid #dbe7f5!important;box-shadow:0 10px 24px rgba(16,36,61,.05)!important}
body:not(.apd-dark) #inicio .container{max-width:1180px!important}
body:not(.apd-dark) .hero-card{position:relative!important;overflow:hidden!important;background:linear-gradient(135deg,#ffffff 0%,#f7fbff 52%,#eaf3ff 100%)!important;color:#0d1b35!important;border:1px solid #dbe7f5!important;border-radius:28px!important;box-shadow:0 22px 60px rgba(36,72,242,.09)!important;text-align:left!important;padding:42px!important;min-height:430px;display:grid;grid-template-columns:minmax(0,1.05fr) minmax(280px,.95fr);gap:26px;align-items:center}
body:not(.apd-dark) .hero-card:after{content:'🔔';position:absolute;right:90px;top:70px;width:76px;height:76px;border-radius:22px;display:grid;place-items:center;background:linear-gradient(135deg,#2448f2,#6678ff);color:#fff;font-size:34px;box-shadow:0 18px 42px rgba(36,72,242,.28);z-index:0}
body:not(.apd-dark) .hero-card:before{content:'💻\A 📚';white-space:pre;position:absolute;right:120px;bottom:46px;font-size:86px;line-height:.95;filter:drop-shadow(0 18px 22px rgba(16,36,61,.18));z-index:0;opacity:.96}
body:not(.apd-dark) .hero-card>*{position:relative;z-index:1;grid-column:1}
body:not(.apd-dark) .hero-eyebrow{background:#edf4ff!important;color:#0f4fb8!important;border:1px solid #cfe1fa!important;border-radius:999px!important;font-weight:900!important;letter-spacing:.08em;text-transform:uppercase;margin-bottom:14px!important}
body:not(.apd-dark) .hero-title{font-size:clamp(40px,6vw,70px)!important;line-height:.96!important;letter-spacing:-.065em!important;font-weight:900!important;margin-bottom:16px!important;color:#0d1b35!important;max-width:640px}
body:not(.apd-dark) .hero-title br{display:none}
body:not(.apd-dark) .hero-desc{margin:0 0 22px!important;color:#40536b!important;font-size:18px!important;line-height:1.58!important;max-width:620px!important}
body:not(.apd-dark) .hero-actions{justify-content:flex-start!important;margin-bottom:0!important;gap:12px!important}
body:not(.apd-dark) .hero-features{grid-column:1 / -1!important;margin-top:14px!important;padding-top:20px!important;border-top:1px solid #e5edf8!important;display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:14px!important}
body:not(.apd-dark) .hfeat{background:#fff!important;border:1px solid #dbe7f5!important;border-radius:20px!important;padding:16px!important;color:#10243d!important;box-shadow:0 10px 28px rgba(16,36,61,.05)!important;align-items:flex-start!important;flex-direction:column!important;gap:8px!important}
body:not(.apd-dark) .hfeat-icon{width:44px;height:44px;border-radius:15px;background:#eef6ff;display:grid;place-items:center;font-size:23px;color:#2448f2}
body:not(.apd-dark) .hero-card>div[style*='margin-top']{grid-column:1 / -1!important;justify-content:flex-start!important;margin-top:2px!important;font-size:14px!important}
body:not(.apd-dark) .hero-card>div[style*='margin-top'] a{display:inline-flex!important;align-items:center!important;gap:7px!important;padding:10px 13px!important;border:1px solid #dbe7f5!important;border-radius:999px!important;background:#fff!important;color:#0f4fb8!important;text-decoration:none!important;font-weight:900!important;box-shadow:0 8px 20px rgba(15,79,184,.06)!important}
body:not(.apd-dark) .panel-header h2{font-size:28px!important;letter-spacing:-.04em!important;color:#0f3460!important}
body:not(.apd-dark) .panel-card,body:not(.apd-dark) .form-card{border:1px solid #dbe7f5!important;border-radius:22px!important;box-shadow:0 12px 28px rgba(16,36,61,.06)!important;background:#fff!important}
body:not(.apd-dark) .panel-tab-btn{border-radius:999px!important;padding:10px 16px!important;font-weight:900!important;box-shadow:0 8px 18px rgba(16,36,61,.04)}
body:not(.apd-dark) .panel-tab-btn.is-active{background:#0f3460!important;color:#fff!important}
body:not(.apd-dark) .footer{background:#071b3a!important;margin-top:42px!important;padding:28px 0!important}
body:not(.apd-dark) .footer-inner{color:#dbeafe!important;line-height:1.8}
body:not(.apd-dark) .footer-inner a{color:#b9d7ff!important;font-weight:800;text-decoration:none!important}
@media(max-width:980px){body:not(.apd-dark) .hero-card{grid-template-columns:1fr!important;text-align:left!important;min-height:auto}body:not(.apd-dark) .hero-card:before,body:not(.apd-dark) .hero-card:after{display:none}body:not(.apd-dark) .hero-features{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:620px){body:not(.apd-dark) .hero-card{padding:24px!important}body:not(.apd-dark) .hero-title{font-size:38px!important}body:not(.apd-dark) .hero-features{grid-template-columns:1fr!important}}
