/* ============================================================
   V9.9.58 · REDISEÑO EXCLUSIVO DE ESCRITORIO / PC
   Se activa SOLO desde 1024px. No modifica móvil ni tablet estrecha.
   Objetivo: robots compactos, menos scroll, controles visibles y
   distribución horizontal premium en las pantallas principales.
   ============================================================ */
@media (min-width:1024px){
  :root{--desktop-content:1280px}

  body:not(.home-screen) .layout{grid-template-columns:260px minmax(0,1fr)}
  body:not(.home-screen) .sidebar{width:260px;padding:20px 16px}
  body:not(.home-screen) .main{
    width:100%;max-width:none;min-width:0;padding:24px 30px 34px;
    background:linear-gradient(180deg,#f6f9fd 0%,#eef4fa 100%);
  }
  body:not(.home-screen) .view{width:min(100%,var(--desktop-content));margin:0 auto}
  body:not(.home-screen) .mobile-head,body:not(.home-screen) .mobile-nav{display:none!important}

  /* Encabezados generales: más contenidos y menos altos */
  .topbar{margin-bottom:14px}
  .topbar h2{font-size:34px;line-height:1.05;margin:3px 0 6px}
  .lead{font-size:15px}

  /* ============================================================
     HERO PREMIUM COMPARTIDO: PROGRESO / BUSCAR / DOCUMENTOS /
     ESQUEMAS / FUENTES. Imagen pequeña a la derecha.
     ============================================================ */
  .premium-refresh .premium-hero{
    grid-template-columns:minmax(0,1fr) 220px!important;
    min-height:168px!important;gap:22px!important;padding:18px 22px!important;
    margin-bottom:14px!important;border-radius:24px!important;align-items:center!important;
  }
  .premium-refresh .premium-hero-copy h2{font-size:42px!important;margin-bottom:8px!important}
  .premium-refresh .premium-hero-copy p{font-size:15px!important;line-height:1.45!important;max-width:720px!important}
  .premium-refresh .premium-hero-copy .eyebrow{font-size:11px!important;margin-bottom:6px!important}
  .premium-refresh .premium-hero-robot{
    width:210px!important;height:142px!important;max-width:210px!important;
    object-fit:cover!important;border-radius:18px!important;justify-self:end!important;
    box-shadow:0 10px 22px rgba(17,38,74,.08)!important;
  }

  /* Controles compactos en una sola fila cuando procede */
  .premium-control-card{padding:14px!important;border-radius:22px!important;gap:12px!important;margin-bottom:14px!important}
  .premium-select-row{padding:10px 12px!important;border-radius:16px!important;gap:5px!important;min-width:0}
  .premium-select-row>span{font-size:12px!important}
  .premium-select-row select{font-size:15px!important;padding-right:32px!important}
  .premium-main-action{min-height:54px!important;border-radius:16px!important;font-size:16px!important}

  /* Progreso */
  #progreso .premium-control-card{grid-template-columns:1fr 1fr 240px;align-items:end}
  #progreso .premium-main-action{height:100%}
  #progressResultsPage .premium-progress-summary{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}

  /* Buscar */
  #buscar .search-premium-card{
    grid-template-columns:minmax(340px,1.35fr) minmax(220px,.72fr) minmax(220px,.72fr) 180px;
    align-items:end;
  }
  #buscar .premium-search-box{margin:0!important;min-height:58px}
  #buscar .premium-search-box input{min-width:0}
  #buscar .premium-main-action{height:58px}
  #buscar .premium-inline-hint{grid-column:1/-1;margin:0}
  #searchResultsPage .search-results{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}

  /* Documentos */
  #documentos .premium-choice-row{grid-template-columns:repeat(2,minmax(0,1fr));max-width:720px}
  #documentos #courseDocumentsBrowser{grid-template-columns:1fr 1fr 220px;align-items:end}
  #documentos .premium-choice-card{min-height:74px}

  /* Esquemas */
  #esquemas .premium-control-card{grid-template-columns:1fr 1fr 220px;align-items:end}

  /* Fuentes */
  #fuentes .premium-control-card{grid-template-columns:minmax(360px,1fr) 220px;align-items:end}

  /* Pantallas de resultado */
  .premium-content-page{max-width:1180px!important}
  .premium-content-head{padding:18px 20px!important;border-radius:22px!important}
  .premium-content-head h2{font-size:34px!important}
  .premium-back-btn{margin-bottom:12px!important}

  /* ============================================================
     MÓDULOS: robot pequeño + controles horizontales
     ============================================================ */
  #modulos .modules-topbar-clean{margin-bottom:10px}
  #modulos .module-browser-robot{
    display:grid!important;grid-template-columns:230px minmax(0,1fr)!important;
    grid-template-areas:"robot intro" "robot panel"!important;
    align-items:center!important;padding:16px!important;gap:8px 20px!important;border-radius:24px!important;
  }
  #modulos .module-robot-hero{grid-area:robot!important;padding:0!important;background:transparent!important}
  #modulos .module-robot-hero img{
    width:220px!important;height:180px!important;object-fit:cover!important;border-radius:20px!important;
  }
  #modulos .module-browser-intro-robot{grid-area:intro!important;padding:0!important}
  #modulos .module-browser-intro-robot .module-browser-copy h4{font-size:22px!important}
  #modulos .module-browser-intro-robot .module-browser-copy p{font-size:14px!important;line-height:1.4!important}
  #modulos .module-browser-panel-robot{
    grid-area:panel!important;margin:0!important;padding:12px!important;
    grid-template-columns:1fr 1fr 200px!important;gap:12px!important;border-radius:18px!important;align-items:end!important;
  }
  #modulos .module-browser-field span{font-size:13px!important}
  #modulos .module-browser-field select{font-size:15px!important;padding:12px 38px 12px 12px!important;border-radius:14px!important}
  #modulos .module-browser-open{min-height:50px!important;min-width:0!important;border-radius:14px!important}

  /* ============================================================
     APUNTES: hero compacto y navegador visible sin scroll excesivo
     ============================================================ */
  #apuntes{display:none}
  #apuntes.active{display:grid!important;grid-template-columns:240px minmax(0,1fr);grid-template-areas:
      "title title" "hero tabs" "hero panel";gap:12px 18px;align-items:start}
  #apuntes .notes-topbar-clean{grid-area:title;margin-bottom:0}
  #apuntes .notes-hero-card{grid-area:hero;margin:0!important;border-radius:22px!important;position:sticky;top:20px}
  #apuntes .notes-hero-card img{width:100%!important;height:220px!important;object-fit:cover!important}
  #apuntes .notes-private-tabs{grid-area:tabs;margin:0!important}
  #apuntes #courseNotesPanel,#apuntes #personalNotesPanel{grid-area:panel}
  #apuntes .course-notes-browser-card{grid-template-columns:1fr 1fr 210px;align-items:end;padding:14px!important}
  #apuntes .private-notes-workspace{grid-template-columns:320px minmax(0,1fr)!important}

  /* ============================================================
     TESTS: robot reducido y configuración en línea
     ============================================================ */
  #tests .tests-showcase{grid-template-columns:minmax(0,1fr) 210px!important;gap:24px!important;margin-bottom:12px!important}
  #tests .tests-showcase-copy h2{font-size:42px!important}
  #tests .tests-showcase-copy p{font-size:15px!important;margin-top:10px!important}
  #tests .tests-showcase-chips{margin-top:10px!important}
  #tests .tests-showcase-robot img{width:200px!important;max-height:180px!important}
  #tests .tests-launcher-premium{border-radius:22px!important}
  #tests .tests-premium-panel{grid-template-columns:1fr 1fr 220px!important;align-items:end!important}
  #tests .tests-premium-copy{padding:14px 16px 0!important}
  #tests .tests-premium-copy p{font-size:14px!important}
  #tests .tests-hero-card{display:none!important}

  /* ============================================================
     VÍDEOS: robot/cámara pequeño a la izquierda, selects a la derecha
     ============================================================ */
  #videos .video-browser-camera{
    display:grid!important;grid-template-columns:230px minmax(0,1fr)!important;
    grid-template-areas:"camera copy" "camera panel"!important;
    gap:8px 20px!important;padding:16px!important;border-radius:24px!important;
  }
  #videos .video-camera-hero{grid-area:camera!important;padding:0!important;background:transparent!important;align-self:center}
  #videos .video-camera-hero img{width:220px!important;height:180px!important;object-fit:cover!important;border-radius:20px!important}
  #videos .video-premium-copy-camera{grid-area:copy!important;padding:0!important}
  #videos .video-premium-copy-camera h4{font-size:22px!important}
  #videos .video-premium-copy-camera p{font-size:14px!important}
  #videos .video-premium-panel-camera{grid-area:panel!important;margin:0!important;padding:12px!important;grid-template-columns:1fr 1fr!important;border-radius:18px!important}
  #videos .video-field select{font-size:15px!important;padding:12px 38px 12px 12px!important;border-radius:14px!important}

  /* ============================================================
     OFICINA: robot pequeño, filtros en horizontal
     ============================================================ */
  #simulador .office-reference-screen{border-radius:24px!important;padding-bottom:14px!important}
  #simulador .office-reference-hero{grid-template-columns:minmax(0,1fr) 220px!important;gap:22px!important;padding:16px 18px 10px!important}
  #simulador .office-reference-copy h2{font-size:40px!important}
  #simulador .office-reference-copy p{font-size:15px!important}
  #simulador .office-reference-robot img{width:210px!important;height:150px!important;max-width:210px!important;border-radius:18px!important}
  #simulador .office-reference-filters{grid-template-columns:1fr 1fr 1fr 210px!important;align-items:end!important;margin:0 16px!important;padding:12px!important;border-radius:18px!important}
  #simulador .office-filter-row{min-height:66px!important;padding:8px 10px!important;border-radius:15px!important}
  #simulador .office-filter-icon{width:40px!important;height:40px!important;flex-basis:40px!important;font-size:19px!important}
  #simulador .office-filter-copy b{font-size:12px!important}
  #simulador .office-filter-copy select{font-size:14px!important}
  #simulador .office-reference-start{min-height:66px!important;height:100%!important;font-size:16px!important}
  #simulador .office-summary-only{grid-column:1/-1!important;margin-top:0!important}

  /* ============================================================
     MODO EXAMEN: hero y formulario muy compactos
     ============================================================ */
  #examen .exam-premium-hero{grid-template-columns:minmax(0,1fr) 220px!important;gap:22px!important;padding:8px 0 12px!important}
  #examen .exam-premium-copy h2{font-size:42px!important}
  #examen .exam-premium-copy p{font-size:15px!important}
  #examen .exam-premium-robot img{width:210px!important;max-width:210px!important;height:155px!important;border-radius:18px!important}
  #examen .exam-premium-card{padding:16px!important;gap:14px!important;border-radius:24px!important}
  #examen .exam-premium-intro{display:none!important}
  #examen .exam-premium-fields{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:12px!important}
  #examen .exam-premium-field select{font-size:15px!important;padding:12px 40px 12px 12px!important}
  #examen .exam-premium-summary{grid-template-columns:repeat(3,minmax(0,1fr))!important;padding:8px!important}
  #examen .exam-premium-start{min-height:56px!important;font-size:17px!important}

  /* ============================================================
     PROFESOR IA: dos tarjetas en columnas y robots más pequeños
     ============================================================ */
  #profesor.professor-premium-v995{max-width:1280px!important}
  #profesor .professor-titlebar{margin-bottom:14px!important}
  #profesor .professor-titlebar h2{font-size:36px!important}
  #profesor .professor-premium-layout{grid-template-columns:minmax(360px,.86fr) minmax(480px,1.14fr)!important;gap:16px!important;align-items:start!important}
  #profesor .teacher-card{padding:18px!important;border-radius:24px!important}
  #profesor .professor-identity{grid-template-columns:150px minmax(0,1fr)!important;column-gap:18px!important}
  #profesor .professor-robot-voice{width:150px!important;height:150px!important;object-fit:cover!important;border-radius:24px!important}
  #profesor .professor-identity h3{font-size:27px!important}
  #profesor .status-pill{font-size:13px!important;padding:9px 12px!important}
  #profesor .professor-mode-button{min-height:78px!important;padding:12px 16px!important;border-radius:19px!important}
  #profesor .professor-mode-icon{width:50px!important;height:50px!important;font-size:23px!important}
  #profesor .professor-mode-copy strong{font-size:21px!important}
  #profesor .professor-mode-copy small{font-size:13px!important}
  #profesor .professor-write-head{grid-template-columns:150px 1fr!important;gap:16px!important}
  #profesor .professor-robot-write{width:150px!important;height:130px!important;object-fit:cover!important;border-radius:22px!important}
  #profesor .professor-write-copy h3{font-size:26px!important}
  #profesor .professor-write-copy p{font-size:14px!important}
  #profesor .professor-composer{min-height:138px!important;border-radius:20px!important}
  #profesor .professor-composer textarea{min-height:138px!important;font-size:16px!important;padding:18px 76px 56px 18px!important}

  /* ============================================================
     AULA IA / HABLAR: escritorio en dos columnas, avatar no gigante
     ============================================================ */
  #aula-ia-vivo{max-width:1280px!important}
  #aula-ia-vivo .live-ai-shell{display:grid!important;grid-template-columns:minmax(0,1.4fr) minmax(340px,.6fr)!important;gap:16px!important;align-items:start!important}
  #aula-ia-vivo .live-ai-stage{grid-column:1!important}
  #aula-ia-vivo .live-ai-control{grid-column:2!important;grid-row:1!important}
  #aula-ia-vivo .live-transcript-panel{grid-column:1/-1!important}
  #aula-ia-vivo .live-avatar-scene{min-height:320px!important;max-height:360px!important}
  #aula-ia-vivo .live-avatar{max-height:290px!important}

  /* Página de contenidos: más anchura útil */
  .module-content-page,.note-content-page,.exam-run-page-v9955,.office-case-page-v9952{max-width:1180px!important}
}

/* Portátiles de altura reducida: mantiene todo visible sin inflar imágenes */
@media (min-width:1024px) and (max-height:760px){
  body:not(.home-screen) .main{padding-top:16px;padding-bottom:20px}
  .premium-refresh .premium-hero{min-height:140px!important;padding:14px 18px!important}
  .premium-refresh .premium-hero-robot{height:118px!important;max-width:180px!important}
  #modulos .module-robot-hero img,#videos .video-camera-hero img{height:150px!important;width:190px!important}
  #apuntes .notes-hero-card img{height:180px!important}
  #tests .tests-showcase-robot img{max-height:145px!important;width:170px!important}
  #simulador .office-reference-robot img,#examen .exam-premium-robot img{height:125px!important;max-width:180px!important}
}
