/* Majestic Internal V2 1.27.16 — Mobile workspace ONLY.
   Deliberately scoped to screen sizes; print/PDF and desktop >= 1051px are untouched. */
.mobile-menu-toggle12716,.mobile-menu-close12716,.mobile-menu-backdrop12716,.mobile-summary-controls12716{display:none}
@media screen and (max-width:1050px){
  html,body{width:100%;max-width:100%;overflow-x:clip;-webkit-text-size-adjust:100%}
  body,button,input,select,textarea{font-size:14px}
  button,.btn,.icon-btn,.nav-btn{touch-action:manipulation}
  .app-shell{display:block!important;grid-template-columns:none!important;width:100%;min-width:0!important;max-width:100%}
  .main,.majestic-executive119 .main{width:100%;max-width:100%;min-width:0;margin:0}
  .sidebar,.majestic-executive119 .sidebar,.alpha121 .sidebar{
    position:fixed!important;left:0;top:0;bottom:0;z-index:920!important;
    width:min(310px,86vw)!important;height:100dvh!important;max-height:100dvh;
    padding:16px 12px!important;overflow-y:auto;overflow-x:hidden;
    transform:translateX(-110%);transition:transform .2s ease;
    box-shadow:16px 0 32px rgba(15,35,65,.16)!important;
  }
  body.mobile-nav-open12716 .sidebar{transform:translateX(0)}
  .sidebar .side-bottom{margin-top:18px}
  .sidebar .nav-btn,.alpha121 .nav-btn{font-size:14px!important;min-height:44px;margin:2px 0;width:100%}
  .mobile-menu-backdrop12716{display:block;position:fixed;inset:0;background:rgba(10,24,45,.46);z-index:910;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .2s,visibility .2s}
  body.mobile-nav-open12716 .mobile-menu-backdrop12716{opacity:1;visibility:visible;pointer-events:auto}
  body.mobile-nav-open12716{overflow:hidden}
  .mobile-menu-toggle12716{display:inline-flex;flex:none;align-items:center;justify-content:center;border:1px solid #e1e5ef;background:#f4f2fc;color:#20365b;border-radius:11px;min-width:42px;height:42px;font-size:23px;font-weight:700;padding:0}
  .mobile-menu-close12716{display:inline-flex;align-items:center;justify-content:center;position:absolute;top:17px;right:11px;width:36px;height:36px;border:1px solid rgba(255,255,255,.23);border-radius:10px;background:rgba(255,255,255,.13);color:white;font-size:22px;z-index:2}
  .side-logo{padding-right:35px!important}
  .topbar,.majestic-executive119 .topbar{position:sticky;top:0;z-index:100;height:60px;min-height:60px;padding:0 11px!important;gap:8px;display:flex;align-items:center}
  .topbar h1{min-width:0;max-width:100%;font-size:16px!important;line-height:1.15;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}
  .top-actions{display:flex;flex:0 0 auto;min-width:0;gap:6px!important;max-width:51%}
  .top-actions #saveState{display:block;max-width:76px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:10px!important}
  .top-actions .btn[data-action="newQuote"]{font-size:11px!important;padding:9px 8px!important;white-space:nowrap;min-height:36px}
  .topbar .executive-top-tools,.topbar .profile119,.topbar .notify119{display:none!important}
  .content,.majestic-executive119 .content{padding:12px 11px 36px!important;width:100%;max-width:100%;min-width:0;margin:0}
  .view,.view.active,.editor-main,.editor-main>.card,.editor-pane,.editor-pane.active{max-width:100%;min-width:0}
  .card,.majestic-executive119 .card{padding:13px!important;max-width:100%;min-width:0;border-radius:13px!important}
  .card-head{flex-wrap:wrap;gap:9px;margin-bottom:12px}
  .card-head h3{font-size:18px!important}
  .card-head>.btn,.card-head>div:last-child:not(:first-child){max-width:100%}
  .hero-strip{display:grid;gap:13px;padding:18px!important;border-radius:14px}
  .hero-strip h2{font-size:23px!important}
  .hero-strip .btn{width:100%}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px}
  .stat{padding:12px}.stat strong{font-size:23px}
  .dashboard-grid,.exec-dashboard119,.settings-split,.proposal-grid120,.template-grid{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:12px!important}
  .exec-dashboard119>*{grid-column:auto!important;min-width:0}
  .template-actions,.template-admin-actions{display:flex;flex-wrap:wrap;gap:8px}
  .template-card,.template-group,.template-group-head{min-width:0;max-width:100%}
  .editor-layout{display:flex!important;flex-direction:column;align-items:stretch;gap:11px!important;min-width:0;max-width:100%}
  .editor-main{order:2;display:grid;grid-template-columns:minmax(0,1fr);gap:10px;width:100%;max-width:100%}
  .sticky-summary{order:1;position:static!important;top:auto!important;width:100%;max-width:100%;min-width:0;z-index:auto!important}
  .sticky-summary>.card{padding:12px!important}
  .sticky-summary .card-head{margin-bottom:8px}
  .sticky-summary .card-head h3{font-size:16px!important}
  .sticky-summary .summary-total{border-radius:11px;padding:11px 14px}
  .sticky-summary .summary-total strong{font-size:26px!important;line-height:1.16}
  .mobile-summary-controls12716{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;margin-top:9px}
  .mobile-summary-controls12716 .btn{min-height:42px;font-size:13px;padding:9px}
  .sticky-summary:not(.mobile-details-open12716) .money-lines,
  .sticky-summary:not(.mobile-details-open12716) #paymentLines12712,
  .sticky-summary:not(.mobile-details-open12716) #calcLines,
  .sticky-summary:not(.mobile-details-open12716) .summary-actions{display:none!important}
  .sticky-summary.mobile-details-open12716 .money-lines{display:grid}
  .sticky-summary .summary-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .sticky-summary .summary-actions .btn{white-space:normal;min-height:43px;padding:10px 7px;font-size:12px}
  .sticky-summary .summary-actions #saveQuoteBtn{grid-column:1/-1}
  .money-line{font-size:12px;gap:8px}.money-line span{min-width:0}
  #paymentLines12712,#calcLines{overflow-wrap:anywhere}
  .section-title{display:grid;grid-template-columns:1fr;gap:7px}
  .section-title h3{font-size:18px!important}
  .editor-tabs{display:flex!important;flex-wrap:nowrap!important;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;gap:7px!important;padding:7px!important;margin-bottom:12px;-webkit-overflow-scrolling:touch;scrollbar-width:thin}
  .editor-tabs>.editor-tab{flex:0 0 auto;white-space:nowrap;scroll-snap-align:start;padding:10px 12px!important;min-height:41px;font-size:12px!important}
  .editor-refresh-row{display:flex;flex-wrap:wrap;gap:8px}.editor-refresh-row span{flex:1;min-width:170px}.editor-refresh-row .btn{flex:1;min-height:40px}
  .grid-2,.grid-3,.grid-4,.service-grid,.inline-controls{grid-template-columns:minmax(0,1fr)!important}
  .field,.repeat-row,.service-card,.template-day-editor,.a2-workspace1279{min-width:0;max-width:100%}
  .field input,.field select,.field textarea,.field .control,input,select,textarea{max-width:100%;min-width:0}
  input:not([type="checkbox"]):not([type="radio"]),select,textarea{font-size:16px!important;min-height:41px}
  input[type="checkbox"],input[type="radio"]{width:auto;max-width:22px;flex:0 0 auto}
  .check-row{align-items:flex-start}.check-row span{min-width:0}
  .row-actions,.confirmation-actions,.modal-actions,.bridge-actions120{display:flex;flex-wrap:wrap;gap:8px}
  .row-actions>* ,.confirmation-actions>*,.modal-actions>*{min-height:41px;max-width:100%}
  .modal-backdrop{z-index:1200!important;padding:8px!important;align-items:flex-start!important;padding-top:max(10px,env(safe-area-inset-top))!important}
  .modal{width:100%!important;max-width:100%!important;max-height:calc(100dvh - 22px)!important;overflow:auto;overscroll-behavior:contain;padding:14px!important;border-radius:14px!important}
  .modal h3{font-size:20px!important}
  .modal-wide,.modal-wide>*,.modal .cardish120,.modal .bridge-settings120{min-width:0;max-width:100%}
  .modal-close1277{min-height:34px;min-width:34px}
  .web-gallery-slots128,.web-gallery-editor1276 .web-gallery-slots128{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .web-gallery-editor128,.web-gallery-editor1276{padding:11px!important;max-width:100%;min-width:0}
  .web-gallery-slot128{min-width:0}
  .gallery-inherit-preview1279 img{width:65px;height:55px}
  .a2-workspace-tabs1279{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:6px}.a2-workspace-tabs1279 button{flex:0 0 auto!important;white-space:nowrap}
  .a2-head121{padding:13px!important}.a2-head121 h2{font-size:21px!important}
  .a2-shell121,.a2-master-cover1277,.content-master-grid,.a2-workspace-stage1279{min-width:0;max-width:100%}
  .a2-module-title121{display:block}.a2-module-title121 h3{font-size:20px!important}
  .circuit-grid121,.recommendation-library122,.train-library122,.alpha122 .train-library122{grid-template-columns:1fr!important}
  .train-media122{display:flex;flex-direction:column;align-items:stretch}.train-media122 img{width:100%;height:150px}
  .route-point-editor-grid,.maj-activity-row1281{grid-template-columns:1fr!important}
  .a2-workspace-head1279{display:grid;gap:9px}.a2-workspace-head1279 label{min-width:0}
  .a2-all-days-actions1281,.a2-activities1281{max-width:100%}
  .document-wrap{padding:7px!important;border-radius:8px;overflow-x:auto;max-width:100%}
  /* Keep documents A4 at their original scale; only the preview can scroll horizontally.
     This intentionally does not affect @media print or PDF generation. */
  #documentsView .card-head{display:grid;gap:9px}
  #documentsView .card-head>div:last-child{display:flex;flex-wrap:wrap;gap:7px}
  #documentsView .card-head .btn{flex:1;min-height:43px}
  #quotesTable .table-wrap,#recentQuotes .table-wrap{overflow:visible;border:0}
  #quotesTable table,#recentQuotes table,#quotesTable tbody,#recentQuotes tbody{display:block;width:100%;max-width:100%}
  #quotesTable thead,#recentQuotes thead{display:none}
  #quotesTable tr,#recentQuotes tr{display:block;min-width:0;border:1px solid #e6e3f0;border-radius:12px;background:#fff;padding:9px 11px;margin-bottom:10px;box-shadow:0 5px 15px rgba(30,48,70,.04)}
  #quotesTable td,#recentQuotes td{display:flex;justify-content:space-between;align-items:flex-start;gap:11px;width:100%;padding:7px 0;border-bottom:1px solid #f0eef6;min-width:0;overflow-wrap:anywhere;line-height:1.4}
  #quotesTable td:last-child,#recentQuotes td:last-child{border-bottom:0;display:block}
  #quotesTable td::before,#recentQuotes td::before{content:"";flex:0 0 81px;font-size:10px;font-weight:850;text-transform:uppercase;color:#647587;letter-spacing:.02em;padding-top:3px}
  #quotesTable td:nth-child(1)::before,#recentQuotes td:nth-child(1)::before{content:"Código"}
  #quotesTable td:nth-child(2)::before,#recentQuotes td:nth-child(2)::before{content:"Inicio"}
  #quotesTable td:nth-child(3)::before,#recentQuotes td:nth-child(3)::before{content:"Viaje"}
  #quotesTable td:nth-child(4)::before,#recentQuotes td:nth-child(4)::before{content:"Estado"}
  #quotesTable td:nth-child(5)::before{content:"Responsable"}
  #quotesTable td:nth-child(6)::before{content:"";display:none}
  #quotesTable td:nth-child(6) .icon-btn{min-height:40px;padding:9px 11px;margin:3px 4px 3px 0}
  #quotesTable td:nth-child(6){display:flex;flex-wrap:wrap;gap:4px}
  #quotesTable .table-link,#recentQuotes .table-link{font-size:13px;overflow-wrap:anywhere}
  #quotesTable .subtle,#recentQuotes .subtle{font-size:11px}
  .table-wrap{max-width:100%}
  table{max-width:100%}
  .topbar,.sidebar,.sticky-summary{contain:none}
}
@media screen and (max-width:380px){
  .topbar{padding:0 8px!important;gap:5px}.topbar h1{font-size:14px!important}.top-actions .btn[data-action="newQuote"]{font-size:10px!important;padding:7px!important}
  .top-actions #saveState{max-width:50px}
  .content,.majestic-executive119 .content{padding:9px 8px 28px!important}
  .stats{gap:7px}.stat{padding:10px}.stat strong{font-size:20px}
  #quotesTable td::before,#recentQuotes td::before{flex-basis:69px}
}
@media screen and (prefers-reduced-motion:reduce){
  .sidebar,.mobile-menu-backdrop12716{transition:none!important}
}
/* Login on small screens: a compact visual masthead, then a full-width form. */
@media screen and (max-width:1050px){
  .login119-page{display:flex!important;flex-direction:column;min-height:100dvh;width:100%;max-width:100%;grid-template-columns:none!important}
  .login119-visual{min-height:205px!important;height:205px!important;flex:0 0 205px;overflow:hidden}
  .login119-media{width:100%;height:100%;object-fit:cover}
  .login119-topline{top:17px;left:17px;right:17px;font-size:9px;gap:12px;letter-spacing:.07em}
  .login119-private{display:none}
  .login119-copy{left:18px;right:18px;bottom:17px}
  .login119-copy h1{font-size:28px!important;line-height:1.04;margin:5px 0}
  .login119-copy p{font-size:12px!important;line-height:1.35;margin:5px 0 0}
  .login119-features{display:none!important}
  .login119-panel{width:100%;min-height:auto!important;flex:1;padding:20px 20px 36px!important;align-items:flex-start}
  .login119-card{width:100%;max-width:480px;margin:14px auto 0}
  .login119-card h2{font-size:29px!important}
  .login119-logo{max-width:160px;max-height:65px}
  .login119-lang{right:18px;top:12px}
  .login119-footer{font-size:9px;text-align:center}
  .login119-control{min-width:0;width:100%}
  .login119-control input{min-width:0;flex:1}
}
