/* ===== Modo móvil (≤760px) — mismo Windows 98, pensado para el pulgar ===== */
html,body{overscroll-behavior:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
@media (max-width:760px), (pointer:coarse) and (max-height:520px){
  body.mob{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
  .mob input,.mob textarea,.mob select{font-size:16px!important;-webkit-user-select:text;user-select:text}
  .mob #desktop{bottom:calc(38px + env(safe-area-inset-bottom))}
  .mob #taskbar{height:calc(38px + env(safe-area-inset-bottom));padding:3px 2px calc(2px + env(safe-area-inset-bottom))}
  .mob #startmenu{bottom:calc(38px + env(safe-area-inset-bottom));max-height:calc(100dvh - 44px - env(safe-area-inset-bottom));overflow-y:auto;left:0;right:auto}
  .mob #startbtn{min-height:32px;padding:0 8px}
  .mob #quick button{width:32px;height:32px}
  .mob .task{min-width:36px;max-width:120px;height:32px;flex:0 1 auto}
  .mob .task:not(.on) span{display:none}
  .mob .task.on span{display:inline}
  .mob .tb-grip{display:none}
  .mob #tray{height:32px;padding:0 6px}
  .mob #tray-icons .tray-ic{padding:6px 4px}

  /* escritorio: cuadrícula amplia */
  .mob #icons{padding:10px 4px 0;right:0}
  .mob .dicon{width:25vw;height:94px;padding-top:6px}
  .mob .dicon .ico,.mob .dicon .ico img{width:40px;height:40px}
  .mob .dicon .ico img.lnk{width:16px;height:16px}
  .mob .dicon span{font-size:12px;line-height:14px;max-width:24vw}

  /* ventanas: pantalla completa, como una app */
  .mob .w98win.mfull{left:0!important;top:0!important;width:100%!important;height:100%!important;max-width:none;box-shadow:none}
  .mob .w98win.mfull .rz{display:none}
  .mob .rz{touch-action:none}
  .mob .rz-se{width:32px;height:32px;right:0;bottom:0;background:linear-gradient(135deg,transparent 0 55%,#808080 55% 60%,transparent 60% 70%,#808080 70% 75%,transparent 75% 85%,#808080 85% 90%,transparent 90%)}
  .mob .rz-e,.mob .rz-w{width:16px}
  .mob .rz-n,.mob .rz-s{height:16px}
  .mob .w98win:not(.mfull):not(.dlg){box-shadow:3px 3px 0 rgba(0,0,0,.35)}
  .mob .w98win .title-bar{height:28px;touch-action:none}
  .mob .w98win .title-bar-text{font-size:13px}
  .mob .w98win .title-bar-controls button{width:26px;height:22px;min-width:26px}
  .mob .w98win.dlg{max-width:96vw;max-height:calc(100dvh - 48px);overflow:auto}
  .mob .menubar .mi{padding:7px 9px}
  .mob .menu98 .mi{height:34px;font-size:13px}
  .mob .menu98 .sep{margin:4px 1px}
  .mob .menu98 .mi.has-sub{flex-wrap:wrap;height:auto;min-height:34px}
  .mob .menu98 .mi.has-sub>.mi-ic,.mob .menu98 .mi.has-sub>.mi-l{height:34px;display:flex;align-items:center}
  .mob .menu98 .mi.has-sub>.mi-l{flex:1}
  .mob .menu98 .sub{flex:0 0 100%;width:100%;box-sizing:border-box}
  .mob .menu98 .has-sub::after{top:12px}
  .mob .menu98 .sub{position:static;display:none;box-shadow:none;padding:0 0 0 14px;background:#c0c0c0;border-left:1px solid #808080;margin-left:8px}
  .mob .menu98 .has-sub.sub-open>.sub{display:block}
  .mob .menu98 .has-sub:hover>.sub{display:none}
  .mob .menu98 .has-sub.sub-open:hover>.sub{display:block}
  .mob #startmenu>.menu98{min-width:min(78vw,300px)}
  .mob #startmenu .mi{height:38px}
  .mob .menu98 .mi:hover{background:none;color:#000}
  .mob .menu98 .mi:active{background:#000080;color:#fff}
  .mob .menu98.popup,.mob .menu98.dropdown{max-height:70dvh;overflow-y:auto}

  /* botones y campos con tamaño táctil */
  .mob button{min-height:28px}
  .mob .dlg-btns button{min-height:32px;min-width:84px}
  .mob .dlg-body{padding:12px 12px 4px}
  .mob .tabs98 button{height:28px;padding:0 10px}
  .mob .lbi,.mob .hi,.mob .tn{height:28px}

  /* Explorador */
  .mob .exp-tree,.mob .exp-web{display:none}
  .mob .exp-list.v-large .xi{width:25%}
  .mob .exp-list.v-large .xi-l{max-width:none;font-size:12px}
  .mob .xs{width:50%;height:30px}
  .mob .exp-dt td,.mob .exp-dt thead th{height:30px}
  .mob .exp-dt td:nth-child(n+3),.mob .exp-dt th:nth-child(n+3){display:none}
  .mob .exp-tb button{min-width:44px}

  /* Calculadora a pantalla completa */
  .mob .calc{height:100%;display:flex;flex-direction:column;padding:10px}
  .mob .calc-disp{height:56px;font-size:28px;line-height:52px}
  .mob .calc-top{height:44px}
  .mob .calc-m,.mob .calc-row2 button{height:44px}
  .mob .calc-grid{flex:1;grid-auto-rows:1fr;gap:6px}
  .mob .calc-grid button{height:auto;font-size:18px}

  /* MS-DOS y Bloc de notas */
  .mob .dos{font-size:13px}
  .mob .np{font-size:15px;line-height:18px}

  /* Inversor / Vantora: lista arriba, gráfico debajo */
  .mob .iv-main{flex-direction:column;overflow:auto}
  .mob .iv-left{width:auto;flex:none;max-height:190px}
  .mob .iv-right{flex:none;min-height:230px}
  .mob .iv-bottom{height:auto;min-height:150px;flex:none}
  .mob .iv-win .w98client{overflow:auto}
  .mob .iv-ctrl{flex-wrap:wrap}

  /* Umbral: escena a lo ancho */
  .mob .um-stage{max-width:100%}

  /* Ayuda / Buscar */
  .mob .hlp-b{flex-direction:column}
  .mob .hlp-l{width:auto;max-height:110px;flex:none}
  .mob .field-row label{width:auto!important}
}
@media (max-height:520px) and (orientation:landscape){
  .mob .dicon{width:16vw;height:82px}
  .mob .dicon span{max-width:15vw}
}
@media (max-width:760px), (pointer:coarse) and (max-height:520px){
  .mob #tip{bottom:calc(46px + env(safe-area-inset-bottom));right:8px;left:8px;max-width:none;font-size:13px;line-height:17px;padding:8px 10px}
}
