/* UNAMESA - Modo movil (hasta 860 px). Se carga DESPUES de ui-pro.css y solo cambia lo necesario para el dedo:
   barra inferior + menu «Más», botones grandes (48 px), texto de 16 px, ventanas que suben desde abajo. */
#mnav,#msheet,#mtop,#mdrawer{display:none}
@media(max-width:860px){
  :root{--mnav-h:68px}
  html,body{overflow-x:hidden}
  body{font-size:16px;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}
  nav.side{display:none!important}
  main{padding:14px 14px calc(var(--mnav-h) + 24px + env(safe-area-inset-bottom))}

  /* ---------- barra inferior ---------- */
  #mnav{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:40;background:#fff;border-top:1px solid var(--line);padding:6px 6px calc(6px + env(safe-area-inset-bottom));gap:4px;box-shadow:0 -4px 16px rgba(34,37,28,.06)}
  #mnav .mn{flex:1 1 0;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:56px;padding:6px 2px;border-radius:14px;background:none;border:0;color:#5b5f50;font-size:12px;font-weight:600;line-height:1.1}
  #mnav .mn svg{width:25px;height:25px;stroke:currentColor;fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
  #mnav .mn-more svg{fill:currentColor;stroke:none}
  #mnav .mn.on,#mnav .mn.on:hover{background:#f3e0e1;color:var(--granate)}
  #mnav .mn:hover{background:#f6f6ef;color:#5b5f50}
  #mnav .mn:active{background:var(--granate);color:#fff}

  /* ---------- menu «Más» ---------- */
  #msheet{position:fixed;inset:0;z-index:60;background:rgba(34,37,28,.5);align-items:flex-end}
  #msheet:not([hidden]){display:flex}
  html.msheet-open{overflow:hidden}
  .ms-panel{width:100%;max-height:90dvh;overflow:auto;background:#fff;border-radius:22px 22px 0 0;padding:8px 16px calc(18px + env(safe-area-inset-bottom));animation:msUp .22s ease-out}
  @keyframes msUp{from{transform:translateY(40px);opacity:.4}to{transform:none;opacity:1}}
  .ms-grab{width:44px;height:5px;border-radius:3px;background:#d8d9cc;margin:4px auto 12px}
  .ms-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:14px}
  .ms-head b{display:block;font-size:19px;line-height:1.2}.ms-head small{display:block;color:var(--muted);font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:62vw}
  .ms-x{flex:none;width:44px;height:44px;min-height:44px;padding:0;border-radius:12px;background:#f6f6ef;border:1.5px solid var(--line);color:var(--ink);font-size:16px}
  .ms-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .mt{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:10px;min-height:92px;padding:14px;border-radius:16px;background:#fff;border:1.5px solid var(--line);color:var(--ink);font-size:16px;font-weight:600;text-align:left}
  .mt svg{width:28px;height:28px;stroke:var(--olive-d);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
  .mt:hover{background:#f6f8ec;color:var(--ink)}
  .mt.on,.mt.on:hover{background:#f3e0e1;border-color:#d9a3a6;color:var(--granate)}.mt.on svg{stroke:var(--granate)}
  .mt-ia{background:var(--olive);border-color:var(--olive-d);color:#fff}.mt-ia svg{stroke:#fff}.mt-ia:hover{background:var(--olive-d);color:#fff}
  .mt:active{background:var(--granate);border-color:var(--granate);color:#fff}.mt:active svg{stroke:#fff}
  .ms-l{display:block;margin:16px 0 6px;font-size:13px;font-weight:600;color:var(--muted)}
  .ms-acc{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:16px}
  .ms-row{display:flex;align-items:center;justify-content:center;gap:10px;min-height:52px;border-radius:14px;background:#fff;border:1.5px solid #b9bca4;color:#3d4034;font-size:16px;font-weight:600}
  .ms-row svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
  .ms-out{color:var(--granate);border-color:#d9a3a6}.ms-out:hover{background:#fbeeee;color:var(--granate)}

  /* ---------- cabecera: titulo + solo lo que se usa a diario ---------- */
  .topbar{margin-bottom:16px!important;gap:10px}
  .topbar h1{font-size:26px}
  .topbar .who{width:100%;gap:8px}
  .topbar .who>.usr,.topbar .who>[data-tutorial],.topbar .who>[data-logout],.topbar .who>#rsel{display:none!important}
  .tbtn.area{flex:1 1 0;min-height:48px;justify-content:center;font-size:15px}

  /* ---------- botones e inputs hechos para el dedo ---------- */
  .big,.second,.foot button,.actions button,.tbtn,.mini-btn{min-height:50px;font-size:16px}
  .segs button,.mini-segs button,.pc-per button,.cj-tab,.bandbtn{min-height:46px;font-size:15px}
  input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]),select,textarea{min-height:50px;font-size:16px}
  textarea{min-height:90px}
  label{font-size:14px}
  .link,button.link,.cj-link{min-height:44px;padding:0 6px;display:inline-flex;align-items:center}
  details>summary{min-height:50px}
  /* signo ? y flechas: visibles y faciles de tocar */
  .qm{width:32px;height:32px;font-size:16px}
  details.what>summary::after,details.pick>summary::after{width:36px;height:36px;background-size:20px}
  details.what>summary{min-height:50px;font-size:16px}
  .kcard .kcar{width:30px!important;height:30px!important}

  /* ---------- ventanas: suben desde abajo ---------- */
  .modal{align-items:flex-end;padding:0}
  .sheet{width:100%;max-height:92dvh;border-radius:22px 22px 0 0;padding:14px 16px calc(16px + env(safe-area-inset-bottom));animation:msUp .22s ease-out}
  .sheet::before{content:'';display:block;width:44px;height:5px;border-radius:3px;background:#d8d9cc;margin:0 auto 12px}
  .sheet h2{font-size:21px}
  .foot{position:sticky;bottom:-16px;background:#fff;margin-top:16px;padding:10px 0 4px;flex-direction:column-reverse;gap:10px;box-shadow:0 -10px 12px -8px rgba(34,37,28,.12)}
  .foot button{width:100%;flex:none}
  .toast{bottom:calc(var(--mnav-h) + 14px + env(safe-area-inset-bottom))}
}

/* ===== ajustes por pantalla (celular) ===== */
@media(max-width:860px){
  /* Caja: 4 pestañas iguales en una fila y Bloquear aparte, grande */
  .cj-tabs.top{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
  .cj-tabs.top .cj-tab{justify-content:center;text-align:center;padding:0 4px;font-size:14px;min-height:48px}
  .cj-tabs.top .cj-lockbtn{grid-column:1 / -1;min-height:48px;justify-content:center;font-size:15px}
  /* Equipo: acciones como botones, de dos en dos */
  .member{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
  .member .link{flex:1 1 calc(50% - 8px);min-height:46px;justify-content:center;border:1.5px solid #b9bca4;border-radius:12px;background:#fff;color:var(--olive-d);font-weight:600;text-decoration:none;padding:0 12px}
  .member .link[data-remove]{color:var(--granate);border-color:#d9a3a6}
  .member select{min-height:46px}
  /* Mesas y QR: dos por fila, con botones grandes */
  .tables{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  .tcard{padding:12px!important}.tcard canvas{width:100%!important;height:auto!important}
  .tcard .row{display:flex;flex-direction:column;align-items:stretch;gap:8px}
  .tcard .row button{width:100%;min-height:46px;justify-content:center;font-size:14.5px}
  .tcard .row .link{border:1.5px solid #d9a3a6;border-radius:12px;color:var(--granate);text-decoration:none;background:#fff}
  /* Estaciones: la X se puede tocar */
  .stpill .x{width:38px;height:38px;min-height:38px}
  .stpill .st-name{min-height:44px}
  /* Informe: botones de compartir, uno bajo otro, iguales */
  .wk-actions{flex-direction:column}.wk-actions>button{width:100%;min-height:52px;justify-content:center}
  /* Datos: casillas del Excel en dos columnas iguales */
  .ex-pick{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .ex-pick>b{grid-column:1 / -1}
  .ex-pick label{min-height:48px;white-space:normal}
}
@media(max-width:860px){ .cj-tabs.top .cj-lockbtn{width:100%;margin:0;justify-self:stretch} }
@media(max-width:860px){
  /* Turno de caja: las cuatro acciones en cuadricula y Cerrar caja a todo el ancho */
  .cc-acts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .cc-acts button{width:100%;min-height:54px;justify-content:center;text-align:center;line-height:1.2}
  .cc-acts .cc-close{grid-column:1 / -1;margin:4px 0 0}
}

/* ===== texto mas oscuro y legible en el celular ===== */
@media(max-width:860px){
  :root{--muted:#42463a;--ink:#1b1e15}
  body{color:var(--ink)}
  ::placeholder{color:#62665a!important;opacity:1}
  /* textos secundarios: casi el color del texto principal y un poco mas grandes */
  small,.hint,.sub,.subt,.empty,.mt-head,.cc-others,.cj-sub,.al-row .nm span,.pc-sum span,.pc-cl small,.ms-head small,.ms-l,.kcard .kt small,.kcard .kd,.wk-sub,.rk-t,label{color:#3b3f33}
  .kcard .kd.up{color:var(--olive-d)}.kcard .kd.down{color:var(--granate)}
  small,.hint,.sub,.subt{font-size:13.5px}
  .kcard .kt small{font-size:12px;font-weight:700}
  .tbtn.quiet{color:#3d4034}
  .qm-box,details.what>p{color:#22251c;font-size:14.5px}
  .chip{font-size:13px}
}
/* el texto pequeño dentro de botones hereda el color del boton (blanco sobre verde o rojo) */
@media(max-width:860px){
  button small,.big small,.second small,button .sub,button em{color:inherit}
  button.big small,.big small{opacity:.95}
}
@media(max-width:860px){ [data-al-parse],[data-al-addline],.al-testbtn{width:100%} .al-mic{min-height:56px;font-size:17px} }

/* ===== Ajustes en el celular ===== */
@media(max-width:860px){
  .set-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .set-tab{min-height:50px;justify-content:center;font-size:15px}
  .set-tabs .set-tab:last-child:nth-child(odd){grid-column:1 / -1}
  .set-bar{bottom:calc(var(--mnav-h) + env(safe-area-inset-bottom) + 6px)}
  .set-bar .big{flex:1}
  .cc-reg .cc-rn{flex:1 1 100%;max-width:none}
  .cc-reg .second{flex:1 1 calc(50% - 8px)}
}

@media(max-width:860px){
  /* ---------- barra superior: menú hamburguesa + logo ---------- */
  #mtop{display:flex;align-items:center;gap:12px;position:sticky;top:0;z-index:35;margin:0 0 12px;padding:8px 14px;min-height:64px;background:#fff;border-bottom:1px solid var(--line);box-shadow:0 2px 10px rgba(34,37,28,.05)}
  #mtop .mt-burger{flex:none;width:50px;height:50px;min-height:50px;padding:0;display:flex;align-items:center;justify-content:center;border-radius:14px;background:#fff;border:2px solid var(--olive-d)}
  #mtop .mt-burger svg{width:28px;height:28px;stroke:var(--olive-d);fill:none;stroke-width:2.4;stroke-linecap:round}
  #mtop .mt-burger:hover{background:#f6f8ec}
  #mtop .mt-burger:active{background:var(--olive);border-color:var(--olive)}#mtop .mt-burger:active svg{stroke:#fff}
  #mtop .mt-logo{height:36px;width:auto;flex:none}
  #mtop .mt-id{margin-left:auto;min-width:0;max-width:46vw;display:flex;flex-direction:column;align-items:flex-end;gap:3px}
  #mtop .mt-view{display:inline-block;padding:3px 10px;border-radius:999px;background:var(--granate);color:#fff;font-size:13px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;line-height:1.3;white-space:nowrap}
  #mtop .mt-view[data-role="storekeeper"],#mtop .mt-view[data-role="kitchen"]{background:var(--olive-d)}
  #mtop .mt-rest{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:700;color:#2a2d22}

  /* ---------- panel lateral con todas las funciones ---------- */
  #mdrawer{position:fixed;inset:0;z-index:70;background:rgba(34,37,28,.5)}
  #mdrawer:not([hidden]){display:block}
  html.mdrawer-open{overflow:hidden}
  .md-panel{position:absolute;left:0;top:0;bottom:0;width:min(88vw,360px);background:#fff;display:flex;flex-direction:column;padding:12px 14px calc(14px + env(safe-area-inset-bottom));overflow-y:auto;animation:mdIn .2s ease-out;box-shadow:6px 0 24px rgba(34,37,28,.25)}
  @keyframes mdIn{from{transform:translateX(-30px);opacity:.4}to{transform:none;opacity:1}}
  .md-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
  .md-logo{height:38px;width:auto}
  .md-who{padding:10px 12px;border-radius:12px;background:#f6f6ef;margin-bottom:8px}
  .md-view{display:inline-block;margin-bottom:6px;padding:3px 10px;border-radius:999px;background:var(--granate);color:#fff;font-size:12.5px;font-weight:800;letter-spacing:.05em;text-transform:uppercase}
  .md-who b{display:block;font-size:17px;line-height:1.25}.md-who small{display:block;font-size:13.5px;color:#2a2d22;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .md-list{display:flex;flex-direction:column;gap:6px;margin:10px 0}
  .md-item{display:flex;align-items:center;gap:14px;min-height:56px;padding:0 14px;border-radius:14px;background:#fff;border:1.5px solid var(--line);color:var(--ink);font-size:17px;font-weight:700;text-align:left;position:relative}
  .md-item svg{flex:none;width:26px;height:26px;stroke:var(--olive-d);fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
  .md-item:hover{background:#f6f8ec;color:var(--ink)}
  .md-item.on,.md-item.on:hover{background:#f3e0e1;border-color:#d9a3a6;color:var(--granate)}.md-item.on svg{stroke:var(--granate)}
  .md-item.md-ia{background:var(--olive);border-color:var(--olive-d);color:#fff}.md-item.md-ia svg{stroke:#fff}
  .md-item:active{background:var(--granate);border-color:var(--granate);color:#fff}.md-item:active svg{stroke:#fff}
  .md-item .bdg{margin-left:auto}
  .md-acc{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:auto;padding-top:8px}
  #mdrawer select{width:100%;margin-bottom:6px}
}

/* ---- Caja: pestañas grandes con icono, título y estado (fáciles de ver en el móvil) ---- */
.cj-helprow{margin:0 0 8px}
.cj-tu{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:44px;padding:0 12px;background:#fff;color:var(--olive-d);border:2px solid var(--olive-d);border-radius:8px;font-size:15px;font-weight:700}
.cj-tabs.top{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
@media(min-width:861px){.cj-tabs.top{grid-template-columns:repeat(auto-fit,minmax(190px,1fr))}}
.cj-tabs.top .cj-tab{display:flex;align-items:center;justify-content:flex-start;gap:10px;min-height:68px;padding:8px 12px;text-align:left;border-radius:10px;background:#fff;border:2px solid #b7bd8a;color:var(--ink);box-shadow:none}
.cj-tabs.top .cj-tab svg{flex:none;width:28px;height:28px;fill:none;stroke:var(--olive-d);stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.cj-tabs.top .cj-tab .tt{display:flex;flex-direction:column;min-width:0;line-height:1.2}
.cj-tabs.top .cj-tab .tt b{font-size:16px;font-weight:700}
.cj-tabs.top .cj-tab .tt small{font-size:13px;color:#3d4034;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cj-tabs.top .cj-tab.on{background:#eef0dc;border-color:#5d6329;box-shadow:inset 0 0 0 1px #5d6329}
.cj-tabs.top .cj-tab.an,.cj-tabs.top .cj-tab.an.on{background:#fff;color:var(--ink);border-color:#b7bd8a}
.cj-tabs.top .cj-tab.an.on{background:#eef0dc;border-color:#5d6329}
.cj-tabs.top .cj-tab.st-open .tt small{color:#5d6329;font-weight:800}
.cj-tabs.top .cj-tab.st-closed{border-color:#a51f25}.cj-tabs.top .cj-tab.st-closed .tt small{color:#a51f25;font-weight:800}.cj-tabs.top .cj-tab.st-closed svg{stroke:#a51f25}
.cj-tabs.top .cj-tab:not(.on):hover{background:#f6f8ec;color:var(--ink);border-color:#8f9560}
.cj-tabs.top .cj-lockbtn{grid-column:1 / -1;min-height:44px;justify-content:center;font-size:15px;background:#fff;color:#a51f25;border:2px solid #a51f25;border-radius:8px;font-weight:700}

.cj-tabs.top .cj-tab .tt small{white-space:normal}

.cj-coach{display:flex;gap:12px;align-items:flex-start;background:#fff;border:2px solid #5d6329;border-left-width:10px;border-radius:10px;padding:12px 14px;margin:0 0 10px;font-size:16.5px;line-height:1.35;font-weight:700;color:var(--ink)}
.cj-coach i{flex:none;width:30px;height:30px;border-radius:50%;background:#5d6329;color:#fff;font:800 17px/30px Arial,sans-serif;text-align:center;font-style:normal}

.cc-prev{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;background:#eef0dc;border:2px solid #5d6329;border-radius:10px;padding:10px 14px;margin:0 0 10px}
.cc-prev span{font-weight:700;font-size:15px}.cc-prev b{font-size:24px;color:#3d4a14}.cc-prev small{flex:1 1 100%;color:#3d4034;font-size:13.5px}
