/* Phone and tablet rescue layout for the owner portal. Desktop remains unchanged. */
#ordersView .auto-assignment-panel,#liveAutomationPanel.auto-assignment-panel{display:none!important}
/* Menu labels remain legible with every custom theme. */
body.shop-authenticated .sidebar .nav-item,body.shop-authenticated .sidebar .nav-item :is(span,strong,small){color:#fff!important;text-shadow:0 1px 2px #0008!important}
.delivery-board-toolbar{display:flex;align-items:center;justify-content:space-between;gap:9px}.automation-settings-hint{color:#73858c;font-size:9px;font-weight:800;white-space:nowrap}.menu-delivery-settings-hint{display:block;margin:0 0 10px;color:#73858c;font-size:11px;font-weight:750}.menu-delivery-settings-hint button{padding:0;border:0;background:transparent;color:#166c55;font:inherit;font-weight:950;text-decoration:underline;cursor:pointer}.delivery-board .delivery-board-section--future{border-color:#9dc7ef!important;background:#eef6ff!important}.delivery-board .delivery-board-section--future>header{background:#dceeff!important}.delivery-board .delivery-board-section--future>header>b{background:#156bb6!important;color:#fff!important}.delivery-board .delivery-board-section--completed{border-color:#a8d8b8!important;background:#effaf3!important}.delivery-board .delivery-board-section--completed>header{background:#d9f2e1!important}.delivery-board .delivery-board-section--completed>header>b{background:#168354!important;color:#fff!important}
@media (max-width:760px) and (orientation:portrait){
  html,body,body.shop-authenticated{max-width:100%;overflow-x:hidden}
  body.shop-authenticated .sidebar{position:fixed!important;inset:0 auto 0 0!important;width:58px!important;height:100dvh!important;padding:10px 6px!important;z-index:110!important}
  body.shop-authenticated .sidebar .main-nav{gap:3px!important;margin-top:9px!important}
  body.shop-authenticated .sidebar .nav-item{min-height:38px!important;padding:6px 0!important}
  body.shop-authenticated .sidebar .nav-icon{font-size:22px!important}
  body.shop-authenticated .sidebar .nav-item,body.shop-authenticated .sidebar .nav-item :is(span,strong,small){color:#fff!important;text-shadow:0 1px 2px #0008!important}
  body.shop-authenticated .main-content{width:calc(100% - 58px)!important;margin-left:58px!important;min-width:0!important}
  body.shop-authenticated .topbar{min-width:0!important;padding:0 10px!important}
  body.shop-authenticated .view{min-width:0!important;padding:15px 10px 95px!important}
  body.shop-authenticated .view>*{min-width:0}
  body.shop-authenticated .page-intro{margin-bottom:12px!important}
  body.shop-authenticated .page-intro h1{font-size:25px!important;line-height:1.08!important}
  body.shop-authenticated .page-intro p{font-size:11px!important;line-height:1.35!important}
  body.shop-authenticated :is(.panel,.quick-panel,.riders-toolbar,.finance-card,.return-qr-banner,.workload-summary){min-width:0!important}
  body.shop-authenticated :is(h1,h2,h3,p,span,strong,small,button,label,a){overflow-wrap:normal;word-break:normal}
  body.shop-authenticated .intro-actions,.toolbar-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important}
  body.shop-authenticated .intro-actions .button,.toolbar-actions .button{min-width:0!important;min-height:36px!important;padding:7px 8px!important;font-size:10px!important;white-space:nowrap}
  body.shop-authenticated .stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}
  body.shop-authenticated .stat-card{min-height:0!important;padding:9px!important}
  body.shop-authenticated .stat-card__label{font-size:8px!important;line-height:1.15!important}
  body.shop-authenticated .stat-number{margin-top:5px!important;font-size:20px!important}

  /* Live orders: a narrow horizontal strip instead of oversized vertical cards. */
  body.shop-authenticated .delivery-board--stream .delivery-board-cards{grid-template-columns:1fr!important;padding:5px!important;gap:5px!important}
  body.shop-authenticated .delivery-board-toolbar{align-items:flex-start!important;flex-direction:column!important;gap:3px!important}.automation-settings-hint{font-size:8px!important}
  body.shop-authenticated .delivery-board--stream .dispatch-card{display:grid!important;grid-template-columns:82px minmax(0,1fr) auto!important;column-gap:6px!important;padding:6px!important;margin:0!important;min-width:0!important}
  body.shop-authenticated .delivery-board--stream .dispatch-top{display:contents!important}
  body.shop-authenticated .delivery-board--stream .dispatch-top>strong{grid-column:1!important;grid-row:1!important;font-size:12px!important;white-space:nowrap}
  body.shop-authenticated .delivery-board--stream .dispatch-card h2{grid-column:1!important;grid-row:2!important;font-size:10px!important;line-height:1.15!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  body.shop-authenticated .delivery-board--stream .dispatch-card h2+p{grid-column:1!important;grid-row:3!important;font-size:8px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  body.shop-authenticated .delivery-board--stream .dispatch-card>ul{grid-column:2!important;grid-row:1 / span 3!important;display:grid!important;grid-template-columns:1fr!important;gap:1px!important;margin:0!important;padding:2px 5px!important;font-size:9px!important;line-height:1.15!important}
  body.shop-authenticated .delivery-board--stream .dispatch-top>.order-status{grid-column:3!important;grid-row:1!important;font-size:7px!important;white-space:nowrap}
  body.shop-authenticated .delivery-board--stream .dispatch-schedule{grid-column:3!important;grid-row:2!important;justify-self:end!important;white-space:nowrap}
  body.shop-authenticated .delivery-board--stream .dispatch-rider-banner,body.shop-authenticated .delivery-board--stream .dispatch-payment-banner{grid-column:3!important;grid-row:3!important;max-width:108px!important;margin:0!important;padding:3px 4px!important;font-size:7px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  body.shop-authenticated .delivery-board--stream .dispatch-rider-banner span,body.shop-authenticated .delivery-board--stream .dispatch-payment-banner span{display:none!important}
  body.shop-authenticated .delivery-board--stream .dispatch-buttons{grid-column:1/-1!important;grid-row:4!important;display:flex!important;gap:4px!important;margin:3px 0 0!important}
  body.shop-authenticated .delivery-board--stream .dispatch-buttons button{flex:1 1 0!important;min-height:24px!important;padding:3px 4px!important;font-size:8px!important;white-space:nowrap}

  /* Keep product lines separate from timing and payment labels on phones. */
  body.shop-authenticated .delivery-board--stream .dispatch-card{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr)!important;column-gap:7px!important;row-gap:2px!important}
  body.shop-authenticated .delivery-board--stream .dispatch-top>.order-status{grid-column:2!important;grid-row:1!important;justify-self:end!important;font-size:7px!important;padding:2px 4px!important}
  body.shop-authenticated .delivery-board--stream .dispatch-schedule{grid-column:1/-1!important;grid-row:2!important;display:flex!important;justify-content:flex-start!important;gap:3px!important;max-width:100%!important;overflow:hidden!important}
  body.shop-authenticated .delivery-board--stream .dispatch-schedule-row{flex:none!important;padding:2px 4px!important}
  body.shop-authenticated .delivery-board--stream .dispatch-schedule-row span,body.shop-authenticated .delivery-board--stream .dispatch-schedule-row strong{font-size:8px!important;line-height:1!important}
  body.shop-authenticated .delivery-board--stream .dispatch-card h2{grid-column:1!important;grid-row:3!important}
  body.shop-authenticated .delivery-board--stream .dispatch-card h2+p{grid-column:1!important;grid-row:4!important}
  body.shop-authenticated .delivery-board--stream .dispatch-card>ul{grid-column:2!important;grid-row:3 / span 2!important;align-self:start!important;min-width:0!important}
  body.shop-authenticated .delivery-board--stream .dispatch-meta{display:block!important;grid-column:1!important;grid-row:5!important;margin:2px 0!important;font-size:8px!important;align-self:center!important}
  body.shop-authenticated .delivery-board--stream .dispatch-rider-banner{grid-column:2!important;grid-row:5!important;justify-self:end!important;max-width:100%!important}
  body.shop-authenticated .delivery-board--stream .dispatch-payment-banner{grid-column:1/-1!important;grid-row:6!important;justify-self:start!important;max-width:100%!important}
  body.shop-authenticated .delivery-board--stream .dispatch-buttons{grid-row:7!important}
  body.shop-authenticated .delivery-board--stream .dispatch-rider-banner strong,body.shop-authenticated .delivery-board--stream .dispatch-payment-banner strong{font-size:8px!important;line-height:1.1!important}

  /* The workday controls and trip guide stay deliberately light and compact. */
  body.shop-authenticated :is(#dashboardView,#liveView) :is(.intro-actions,.toolbar-actions){grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:4px!important}
  body.shop-authenticated :is(#dashboardView,#liveView) :is(.intro-actions,.toolbar-actions) .button{min-height:30px!important;padding:5px 4px!important;font-size:8px!important;letter-spacing:0!important}
  body.shop-authenticated .trip-tools{padding:7px 8px!important;margin:6px 0!important;border-radius:9px!important}
  body.shop-authenticated .trip-tools :is(p,small,.trip-selection){margin:2px 0!important;font-size:8px!important;line-height:1.2!important}
  body.shop-authenticated .trip-tools button{min-height:26px!important;margin:2px!important;padding:4px 6px!important;font-size:8px!important}

  /* QR and rider settings stay horizontal and use the full available width. */
  body.shop-authenticated .return-qr-banner{display:grid!important;grid-template-columns:40px minmax(0,1fr)!important;gap:8px!important;padding:10px!important;align-items:start!important}
  body.shop-authenticated .return-qr-banner__icon{width:36px!important;height:36px!important;font-size:20px!important}
  body.shop-authenticated .return-qr-banner>div:nth-child(2){min-width:0!important}
  body.shop-authenticated .return-qr-banner h2{font-size:14px!important;line-height:1.15!important}
  body.shop-authenticated .return-qr-banner p{font-size:10px!important;line-height:1.3!important}
  body.shop-authenticated .return-qr-banner .button{grid-column:1/-1!important;width:100%!important;margin:0!important;min-height:34px!important;padding:6px!important;font-size:10px!important}
  body.shop-authenticated .return-qr-toggle{grid-column:1/-1!important;display:flex!important;max-width:none!important;width:100%!important;min-height:42px!important;padding:7px!important}
  body.shop-authenticated .return-qr-toggle b{font-size:10px!important;white-space:nowrap}
  body.shop-authenticated .return-qr-toggle small{font-size:8px!important;line-height:1.2!important}

  /* Tables are deliberately scrollable rather than crushing every word vertically. */
  body.shop-authenticated .analysis-panel,.analysis-panel,.table-wrap,.workload-table{overflow-x:auto!important;overscroll-behavior-x:contain}
  body.shop-authenticated .analysis-table{width:690px!important;min-width:690px!important;table-layout:auto!important;font-size:10px!important}
  body.shop-authenticated .analysis-table th,body.shop-authenticated .analysis-table td{padding:8px 7px!important;white-space:normal!important;overflow-wrap:normal!important;word-break:normal!important}
  body.shop-authenticated .settlement-actions{display:grid!important;grid-template-columns:1fr 1fr!important;min-width:128px!important;gap:3px!important}
  body.shop-authenticated .settlement-actions button{min-height:28px!important;padding:4px!important;font-size:8px!important;line-height:1.05!important;white-space:normal!important}

  /* Menu editor: no squeezed controls and no obsolete full-width preview tab. */
  body.shop-authenticated #menuView .menu-editor-tabs{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:5px!important}
  body.shop-authenticated #menuView .menu-editor-tabs button{min-width:0!important;padding:8px 4px!important;font-size:10px!important}
  body.shop-authenticated #menuView .product-editor{grid-template-columns:1fr!important;padding:10px!important;gap:7px!important}
  body.shop-authenticated #menuView .product-editor>*{grid-column:1!important;min-width:0!important}
  body.shop-authenticated #menuView .product-category-quick{display:block!important;width:100%!important}
  body.shop-authenticated #menuView .product-category-quick label,body.shop-authenticated #menuView .product-category-quick select{display:block!important;width:100%!important;min-width:0!important}
  body.shop-authenticated #menuView .product-editor :is(input,select,textarea){min-height:34px!important;font-size:11px!important}
  body.shop-authenticated #menuView .product-editor>h2{font-size:18px!important}
  body.shop-authenticated #menuView .product-editor-lead{font-size:10px!important;line-height:1.3!important}
  body.shop-authenticated #menuView .product-editor .product-ingredients,body.shop-authenticated #menuView .product-editor .product-allergens{padding:7px!important}

  body.shop-authenticated #ridersView .riders-grid{grid-template-columns:1fr!important;gap:7px!important}
  body.shop-authenticated #ridersView .rider-card{grid-template-columns:minmax(0,1fr) auto!important;align-items:start!important;padding:8px!important}
  body.shop-authenticated #ridersView .invite-box{grid-column:1/-1!important}
  body.shop-authenticated #ridersView .whatsapp-invite{display:flex!important;align-items:center!important;min-height:30px!important;white-space:nowrap}
}

/* Console live e Consegne: codice e orario richiesto sono le informazioni principali. */
body.shop-authenticated .delivery-board--stream .dispatch-top>strong{
  font-size:20px!important;
  line-height:1!important;
  font-variant-numeric:tabular-nums;
}
body.shop-authenticated .delivery-board--stream .dispatch-schedule{
  display:flex!important;
  align-items:center!important;
  gap:6px!important;
}
body.shop-authenticated .delivery-board--stream :is(#delivery-kitchen,#delivery-future,#delivery-live,#delivery-completed) .dispatch-schedule-row--due,
body.shop-authenticated .delivery-board--stream :is(#delivery-kitchen,#delivery-future,#delivery-live,#delivery-completed) .dispatch-schedule-row--prep{
  display:flex!important;
}
body.shop-authenticated .delivery-board--stream .dispatch-schedule-row--due{
  order:2!important;
  padding:4px 8px!important;
}
body.shop-authenticated .delivery-board--stream .dispatch-schedule-row--prep{order:1!important}
body.shop-authenticated .delivery-board--stream .dispatch-schedule-row--due span{font-size:9px!important}
body.shop-authenticated .delivery-board--stream .dispatch-schedule-row--due strong{
  font-size:24px!important;
  line-height:1!important;
  font-variant-numeric:tabular-nums;
}
@media(max-width:650px){
  body.shop-authenticated .delivery-board--stream .dispatch-top>strong{font-size:15px!important}
  body.shop-authenticated .delivery-board--stream .dispatch-schedule-row--due{padding:3px 5px!important}
  body.shop-authenticated .delivery-board--stream .dispatch-schedule-row--due span{font-size:7px!important}
  body.shop-authenticated .delivery-board--stream .dispatch-schedule-row--due strong{font-size:17px!important}
  body.shop-authenticated .delivery-board--stream .dispatch-schedule-row--prep :is(span,strong){font-size:8px!important}
}

@media (min-width:761px) and (max-width:1024px) and (orientation:portrait){
  body.shop-authenticated .sidebar{width:70px!important;padding:12px 7px!important}
  body.shop-authenticated .sidebar .brand-lockup>div:last-child,body.shop-authenticated .sidebar .nav-item span:not(.nav-icon),body.shop-authenticated .sidebar-bottom{display:none!important}
  body.shop-authenticated .main-content{width:calc(100% - 70px)!important;margin-left:70px!important}
  body.shop-authenticated .view{padding:18px 18px 42px!important}
  body.shop-authenticated .delivery-board--stream .delivery-board-cards{grid-template-columns:1fr!important}
  body.shop-authenticated .analysis-table{min-width:760px!important}
}

/* Secondary management pages use the same compact density as the live console. */
body.shop-authenticated :is(#profileView,#supportView,#workforceView,#workArchiveView,#customersView,#analysisView) .panel{padding:12px!important}
body.shop-authenticated :is(#profileView,#supportView,#workforceView,#workArchiveView,#customersView,#analysisView) .panel-header{padding:10px 12px 8px!important}
body.shop-authenticated :is(#profileView,#supportView,#workforceView,#workArchiveView,#customersView,#analysisView) :is(.panel-header h2,.panel h2){font-size:16px!important;line-height:1.15!important}
body.shop-authenticated :is(#profileView,#supportView,#workforceView,#workArchiveView,#customersView,#analysisView) :is(.panel p,.panel small){font-size:11px!important;line-height:1.3!important}
body.shop-authenticated :is(#profileView,#supportView,#workforceView,#workArchiveView,#customersView,#analysisView) .page-intro{margin-bottom:12px!important}
body.shop-authenticated :is(#profileView,#supportView,#workforceView,#workArchiveView,#customersView,#analysisView) .page-intro h1{font-size:24px!important;line-height:1.05!important;margin:0!important}
body.shop-authenticated :is(#profileView,#supportView,#workforceView,#workArchiveView,#customersView,#analysisView) .page-intro p{font-size:12px!important;line-height:1.3!important;margin:5px 0 0!important}
body.shop-authenticated #supportView :is(.support-hero,.support-card){padding:12px!important}
body.shop-authenticated #supportView .support-card{min-height:0!important}
body.shop-authenticated #workforceView :is(.period-panel,.workforce-panel){padding:12px!important}
body.shop-authenticated #workArchiveView :is(.archive-revenue-summary,.archive-day-card){padding:12px!important}

/* Turn planning stays information-rich, but no longer uses oversized daily cards. */
body.shop-authenticated #workforceView .requirements-table.rider-only-requirements{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:7px!important}
body.shop-authenticated #workforceView .requirement-day.rider-only{grid-template-columns:1fr!important;gap:5px!important;padding:8px!important;border-radius:10px!important}
body.shop-authenticated #workforceView .requirement-day h3{padding:0!important;font-size:13px!important}
body.shop-authenticated #workforceView .requirement-role.role-rider{grid-template-columns:1fr!important;gap:4px!important;padding:6px!important}
body.shop-authenticated #workforceView .requirement-role.role-rider strong{font-size:10px!important}
body.shop-authenticated #workforceView .requirement-role.role-rider label{gap:2px!important;font-size:9px!important}
body.shop-authenticated #workforceView .requirement-role.role-rider select{height:30px!important;font-size:12px!important}
body.shop-authenticated #workforceView .mini-calendar{gap:4px!important}
body.shop-authenticated #workforceView .calendar-day{min-height:48px!important;padding:5px!important;border-radius:8px!important}
body.shop-authenticated #workforceView .calendar-day strong{font-size:15px!important}
body.shop-authenticated #workforceView .calendar-day small,body.shop-authenticated #workforceView .calendar-day span{font-size:8px!important}
body.shop-authenticated #workforceView .schedule-day{margin:0 0 8px!important}
body.shop-authenticated #workforceView .schedule-day h3{font-size:14px!important;margin:0!important}
body.shop-authenticated #workforceView .schedule-day-title button{padding:5px 7px!important;font-size:9px!important}
body.shop-authenticated #workforceView .schedule-shift{grid-template-columns:100px 1fr!important;gap:7px!important;margin:4px 0!important;padding:7px!important;border-radius:8px!important}
body.shop-authenticated #workforceView .schedule-shift :is(b,span){font-size:10px!important}
body.shop-authenticated #workforceView .schedule-names{gap:4px!important}
body.shop-authenticated #workforceView .schedule-names :is(span,strong){padding:3px 5px!important;font-size:9px!important}
@media (max-width:760px){
  body.shop-authenticated :is(#profileView,#supportView,#workforceView,#workArchiveView,#customersView,#analysisView) .panel{padding:9px!important}
  body.shop-authenticated :is(#profileView,#supportView,#workforceView,#workArchiveView,#customersView,#analysisView) .panel-header{padding:8px 9px 6px!important}
  body.shop-authenticated :is(#profileView,#supportView,#workforceView,#workArchiveView,#customersView,#analysisView) :is(.panel-header h2,.panel h2){font-size:14px!important}
  body.shop-authenticated :is(#profileView,#supportView,#workforceView,#workArchiveView,#customersView,#analysisView) .page-intro h1{font-size:20px!important}
  body.shop-authenticated :is(#profileView,#supportView,#workforceView,#workArchiveView,#customersView,#analysisView) .page-intro p{font-size:11px!important}
  body.shop-authenticated #supportView :is(.support-hero,.support-card),body.shop-authenticated #workforceView :is(.period-panel,.workforce-panel),body.shop-authenticated #workArchiveView :is(.archive-revenue-summary,.archive-day-card){padding:9px!important}
  body.shop-authenticated #workforceView .requirements-table.rider-only-requirements{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.shop-authenticated #workforceView .schedule-shift{grid-template-columns:84px 1fr!important}
}
