/* TR Locali: navigazione e servizio da telefono. */
.mobile-nav,.sidebar-close{display:none}
.app-shell,.main-shell,main#main-content{min-width:0}
.quantity-stepper{display:flex;align-items:center;gap:5px}
.quantity-stepper button{display:grid;place-items:center;width:36px;height:36px;background:#eff4e7;border:1px solid #dfe7d3;border-radius:7px;font-size:20px}
.quantity-stepper input{text-align:center}
.nav-open,.modal-open{overflow:hidden}
.room-view-panel[hidden]{display:none!important}
.room-view-toggle{display:none}

@media(max-width:850px){
  .room-view-toggle{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;padding:18px;background:#fff;border:1px solid #e8ece5;border-radius:16px;margin-bottom:20px}
  .room-view-toggle strong{display:block;font-size:15px;color:#172b25}
  .room-view-toggle small{display:block;font-size:12px;color:#627367;margin-top:5px}
  .room-view-toggle>.btn{min-height:48px}
  .room-view-toggle>p{grid-column:1/-1;margin:0;font-size:13px;line-height:1.65;color:#627367}
  .room-view-toggle>.room-collapsed-dirty{color:#895d16;background:#fff6dc;border-radius:8px;padding:10px 12px}
  .sidebar{width:min(320px,calc(100vw - 32px));padding:24px 18px max(20px,env(safe-area-inset-bottom));overscroll-behavior:contain}
  .sidebar-close{position:absolute;top:18px;right:14px;display:grid;place-items:center;width:44px;height:44px;color:#d7e5db;border:1px solid #45624e;border-radius:10px}
  .sidebar .brand{padding-right:42px}
  .sidebar .workspace-tag{padding-top:26px;font-size:11px}
  .sidebar .venue-select{margin-inline:0;padding:13px}
  .sidebar .venue-select>span:last-child{min-width:0;flex:1}
  .sidebar .venue-select select{width:100%;max-width:100%;font-size:16px;min-height:34px}
  .sidebar .venue-select small{font-size:12px}
  .sidebar .nav-item{min-height:48px;font-size:14px;gap:12px;margin-bottom:5px}
  .sidebar .nav-item .icon{width:20px;height:20px}
  .sidebar .profile strong{font-size:13px}
  .sidebar .profile small{font-size:11px}
  .sidebar .demo-card{display:none}
  .sidebar-bottom>.btn{min-height:44px;font-size:14px}
  .mobile-toggle{width:44px;height:44px;padding:0;border:1px solid #dfe6d9;border-radius:10px;flex-shrink:0}
  .mobile-toggle .icon{width:22px;height:22px}
  .topbar{position:sticky;top:0;z-index:40;background:#fffdf8f5;backdrop-filter:blur(12px)}
  .breadcrumb{min-width:0}
  .breadcrumb strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
}

@media(max-width:650px){
  .room-view-toggle{grid-template-columns:minmax(0,1fr)}
  .room-view-toggle>.btn{width:100%;justify-content:center}
  .app-shell{min-height:100dvh}
  .main-shell{padding-bottom:calc(74px + env(safe-area-inset-bottom))}
  main#main-content{padding:22px 16px 18px}
  .topbar{height:calc(68px + env(safe-area-inset-top));padding:0 16px;gap:12px;padding-top:env(safe-area-inset-top)}
  .topbar-right>.btn{width:44px;height:44px;min-height:44px;border:1px solid #dfe6d9;border-radius:10px}
  .page-head{gap:14px;margin-bottom:22px}
  .page-head h1{font-size:28px;line-height:1.2}
  .description{font-size:13px;line-height:1.65;max-width:100%}
  .eyebrow{font-size:10px}
  .head-actions{display:flex;width:100%;flex-wrap:wrap;gap:8px;margin-top:0}
  .head-actions .btn{flex:1 1 140px;font-size:13px;min-height:46px;white-space:normal;padding:12px}
  .btn,.btn.small,.icon-button,.text-link,.category-tabs button,.service-filter{min-height:44px}
  .btn,.btn.small{font-size:13px;padding:11px 14px;white-space:normal}
  .btn .icon{width:18px;height:18px}
  .icon-button{width:44px;height:44px;flex-shrink:0}
  .icon-button .icon{width:19px;height:19px}
  .text-link{font-size:13px;padding:10px 0}
  input:not([type=checkbox]):not([type=radio]),select,textarea,
  .modal-form input,.modal-form select,.modal-form textarea,
  .settings-form input,.settings-form select,.settings-form textarea,
  .room-controls input,.room-controls select,.searchbox input,.date-filter input,
  .chat-input input,.guest-cart input,.guest-cart select,.guest-cart textarea,
  .auth-card input,.admin-card input,.admin-card select,.telegram-guide-panel input:not([type=checkbox]){
    font-size:16px;min-height:44px;min-width:0;max-width:100%
  }
  .modal-form label,.settings-form label,.room-controls label,.guest-cart form label{font-size:13px;color:#586f4c}
  .form-grid,.form-grid.three,.settings-form>.form-grid{grid-template-columns:minmax(0,1fr);gap:16px}
  .form-grid>label{min-width:0}
  .metric-top{font-size:12px;line-height:1.4;align-items:flex-start}
  .metric>strong{font-size:27px;overflow-wrap:anywhere}
  .metric>small{font-size:11px;line-height:1.5}
  .panel-head{padding:18px 16px;gap:12px;flex-wrap:wrap}
  .panel-head h2{font-size:16px}
  .panel-head p{font-size:12px;line-height:1.5}
  .panel-head .text-link{margin-left:auto}
  .service-demo-banner{padding:16px;align-items:flex-start;gap:12px;flex-direction:column}
  .service-demo-banner p{font-size:13px;overflow-wrap:anywhere}
  .service-demo-banner>div:last-child{width:100%}
  .service-demo-banner .btn{flex:1}
  .service-priorities{gap:8px}
  .service-priorities>button{padding:14px 9px;display:block;min-height:100px}
  .service-priorities b{display:block;font-size:26px;margin-bottom:7px}
  .service-priorities span{font-size:12px;line-height:1.4;gap:4px}
  .service-priorities small{font-size:10px;line-height:1.5}
  .toolbar,.toolbar-right{width:100%;min-width:0}
  .toolbar .searchbox{width:100%;min-width:0;max-width:100%;padding:8px 12px}
  .date-filter{min-height:48px;width:100%;padding:5px 12px}
  .date-filter input{flex:1;max-width:100%;width:100%}
  .segmented{max-width:100%;flex-wrap:wrap}
  .toolbar>.segmented button,.segmented button{min-height:44px;font-size:12px;flex:1;justify-content:center;padding:10px}
  .segmented button b{font-size:10px}
  .service-filters,.category-tabs{flex-wrap:nowrap;overflow-x:auto;max-width:100%;padding-bottom:5px;overscroll-behavior-inline:contain}
  .service-filter,.category-tabs button{flex:0 0 auto;font-size:13px;white-space:nowrap}
  .table-wrap:has(table[data-mobile-cards]){overflow:visible}
  .table-wrap table[data-mobile-cards]{display:block;white-space:normal;font-size:14px}
  .table-wrap table[data-mobile-cards]>thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .table-wrap table[data-mobile-cards]>tbody{display:grid;gap:12px;padding:0 14px 16px}
  .table-wrap table[data-mobile-cards]>tbody>tr{display:block;min-width:0;border:1px solid #e2e8dc;border-radius:12px;padding:6px 14px;background:#fbfcf8}
  .table-wrap table[data-mobile-cards]>tbody>tr>td{display:grid;grid-template-columns:minmax(72px,.8fr) minmax(0,1.4fr);align-items:center;gap:8px;padding:10px 0;font-size:14px;white-space:normal;overflow-wrap:anywhere;border-bottom:1px solid #e8eddf}
  .table-wrap table[data-mobile-cards]>tbody>tr>td::before{content:attr(data-label);font-size:11px;font-weight:600;color:#718265}
  .table-wrap table[data-mobile-cards]>tbody>tr>td:first-child{font-weight:650;color:#294c32}
  .table-wrap table[data-mobile-cards]>tbody>tr>td small{font-size:12px;line-height:1.5;grid-column:2;margin:0}
  .table-wrap table[data-mobile-cards]>tbody>tr>td>strong{font-size:14px}
  .table-wrap table[data-mobile-cards]>tbody>tr>td:last-child{border-bottom:0}
  .table-wrap table[data-mobile-cards]>tbody>tr>td[data-label=""]{display:flex;flex-wrap:wrap;justify-content:flex-end}
  .table-wrap table[data-mobile-cards]>tbody>tr>td[data-label=""]::before{display:none}
  .badge{font-size:11px;justify-self:start;padding:6px 8px}
  .booking-name{min-width:0}
  .booking-name strong{font-size:14px;overflow-wrap:anywhere}
  .booking-name small{font-size:12px;line-height:1.5}
  .booking-time{font-size:14px}
  .booking-row{min-height:70px}
  .quick-actions button{min-height:48px;font-size:14px}
  .live-kanban{grid-template-columns:minmax(0,1fr);overflow:visible}
  .order-card{padding:18px}
  .order-card h3{font-size:16px;overflow-wrap:anywhere}
  .order-card-head,.order-items p,.order-note,.order-card-total{font-size:13px}
  .order-card-head small,.order-age,.wait-badge{font-size:12px}
  .order-card .channel{font-size:12px}
  .order-card-total strong{font-size:18px}
  .order-card-actions{flex-wrap:wrap}
  .order-card-actions>.btn,.live-kanban .order-card-actions .btn{font-size:13px;min-height:46px}
  .order-card-actions>.icon-button{width:44px}
  .modal-backdrop{align-items:flex-end;padding:12px 0 0;overscroll-behavior:contain}
  .modal{width:100%;max-height:calc(100dvh - 12px);border-radius:20px 20px 0 0;overscroll-behavior:contain}
  .modal-head{padding:14px 18px;gap:12px}
  .modal-head h2{font-size:19px;line-height:1.25}
  .modal-form{padding:20px 18px 0;gap:18px}
  .modal-footer{position:sticky;bottom:0;background:#fff;z-index:2;padding:14px 0 max(16px,env(safe-area-inset-bottom));gap:10px}
  .modal-footer>.btn{flex:1;min-height:48px;font-size:14px}
  .detail-body{padding:22px 18px;overflow-wrap:anywhere}
  .detail-actions{display:flex;flex-wrap:wrap;gap:8px}
  .detail-actions .btn{flex:1 1 140px;font-size:13px}
  .order-picker{max-height:none;overflow:visible}
  .order-picker label{gap:12px;padding:14px 12px;flex-wrap:wrap}
  .order-picker label>span{min-width:0;flex:1 1 130px}
  .order-picker strong{font-size:14px;line-height:1.4}
  .order-picker small{font-size:12px;line-height:1.5}
  .quantity-stepper{display:flex;align-items:center;gap:4px}
  .quantity-stepper button{display:grid;place-items:center;width:44px;height:44px;border:1px solid #dfe7d3;border-radius:8px;background:#eff4e7;font-size:23px;color:#2d5438}
  .order-picker .quantity-stepper input{width:48px!important;text-align:center;padding:8px 2px;-moz-appearance:textfield}
  .quantity-stepper input::-webkit-inner-spin-button,.quantity-stepper input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
  .product-title h3,.product-title strong{font-size:15px}
  .product-info>p{font-size:12px;line-height:1.6;min-height:0}
  .product-meta,.product-bottom>span{font-size:11px;line-height:1.6}
  .product-bottom .btn{font-size:12px;min-height:44px;padding:10px;gap:6px}
  .availability-toggle{top:8px;right:8px;width:48px;min-width:48px;height:44px;min-height:44px;background:#b4bda4e8;border:6px solid #fff;border-radius:22px;padding:5px}
  .availability-toggle.on{background:#6c8a4d}
  .availability-toggle.on span{margin-left:auto}
  .product-category{font-size:10px;max-width:calc(100% - 70px);white-space:normal}
  .room-scene-top{padding:16px;gap:14px}
  .room-scene-top>div:first-child{flex-basis:100%;min-width:0}
  .room-scene-top small{font-size:12px;line-height:1.5}
  .room-view-switch{width:100%}
  .room-view-switch .btn{flex:1;font-size:15px;min-height:46px}
  .room-view-switch .btn span{display:inline;font-size:12px}
  .room-scene-top .room-view-tools{display:grid;grid-template-columns:1fr 44px 44px;width:100%;gap:6px}
  .room-view-tools .btn{font-size:12px;min-height:44px;padding:8px;white-space:normal}
  .room-view-tools .btn:first-child{grid-column:1}
  .room-view-tools .btn:nth-child(4){grid-column:1/3}
  .room-canvas-wrap{height:clamp(280px,52svh,420px)}
  .room-edit-tools{padding:12px;gap:10px}
  .room-edit-tools>div:first-child{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;gap:5px}
  .room-edit-tools .btn,.room-element-list .btn{min-height:44px;font-size:12px;padding:10px 8px;white-space:normal}
  .room-history{margin-left:auto}
  .room-edit-tools .room-add-elements{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  .room-scene-bottom{padding:16px;font-size:12px;line-height:1.6}
  .room-controls{padding:20px 16px}
  .room-controls .settings-form{padding-inline:0}
  .room-controls h3{font-size:17px}
  .room-controls .detail-actions .btn,.room-controls .settings-form>.btn{font-size:13px;min-height:46px;padding:12px}
  .room-help,.room-editor-head p,.room-save-bar p{font-size:13px;line-height:1.6}
  .room-vertices .btn,.room-measures summary{min-height:44px;font-size:12px}
  .room-save-bar{padding:14px 0 4px;bottom:calc(74px + env(safe-area-inset-bottom));z-index:5}
  .room-save-bar .btn{min-height:48px;font-size:14px}
  .room-table-list .live-table{min-height:100px}
  .live-table span,.live-table small{font-size:12px}
  .chat-panel{min-height:0}
  .chat-messages{min-height:230px;max-height:55svh}
  .chat-message p,.assistant-guide p,.assistant-guide li{font-size:14px}
  .chat-suggestions button{font-size:12px;min-height:44px;line-height:1.5}
  .chat-input{padding:12px;position:sticky;bottom:calc(74px + env(safe-area-inset-bottom))}
  .chat-input button{min-width:44px;min-height:44px}
  .telegram-workspace{padding:20px 16px}
  .telegram-guide-panel{padding:24px 18px}
  .telegram-step-tabs button{min-height:48px;font-size:13px}
  .telegram-health strong{overflow-wrap:anywhere}
  .report-summary strong{overflow-wrap:anywhere}
  .activity-list>div{font-size:12px;flex-wrap:wrap}
  .activity-list small{font-size:11px}
  .app-footer{font-size:11px;padding:8px 16px 20px;line-height:1.6;flex-wrap:wrap}
  .app-footer a{min-height:44px;display:flex;align-items:center}
  .mobile-nav{position:fixed;inset:auto 0 0;z-index:50;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;padding:7px 8px max(8px,env(safe-area-inset-bottom));background:#fffdf8f5;border-top:1px solid #dfe7d7;backdrop-filter:blur(16px)}
  .mobile-nav button{position:relative;min-width:0;min-height:54px;padding:7px 2px;border-radius:10px;display:flex;align-items:center;justify-content:center;gap:5px;flex-direction:column;color:#647a58;font-size:10px;line-height:1.3;font-weight:600}
  .mobile-nav .icon{width:22px;height:22px}
  .mobile-nav button.active,.mobile-nav button[aria-expanded=true]{background:#eaf3dd;color:#224c35}
  .mobile-nav b{position:absolute;top:3px;right:7px;min-width:17px;padding:2px 4px;border-radius:12px;background:#2f6653;color:#fff;font-size:9px;line-height:1.2}
  #toast{bottom:calc(86px + env(safe-area-inset-bottom));left:16px;right:16px;max-width:calc(100% - 32px);font-size:14px;line-height:1.5;transform:translateY(15px);white-space:normal}
  #toast.visible{transform:translateY(0)}
  .auth-page{padding:24px 16px max(24px,env(safe-area-inset-bottom))}
  .auth-card{padding:24px;margin:16px auto}
  .auth-card label{font-size:14px}
  .auth-card .btn{width:100%;min-height:48px;font-size:15px}
  .auth-card p,.auth-back{font-size:14px}
  .admin-head,.admin-card{overflow-wrap:anywhere}
  .admin-card .actions .btn{min-height:44px}
  .guest-shell>main{padding-inline:16px}
  .guest-product h3{font-size:16px}
  .guest-product p,.guest-product small{font-size:13px;line-height:1.5}
  .guest-product>div>strong{font-size:16px}
  .guest-product .icon-button,.qty-controls button{width:44px;min-width:44px;height:44px;min-height:44px}
  .guest-service{flex-wrap:wrap}
  .guest-service>.segmented{width:100%}
  .guest-service .segmented button{font-size:14px;min-height:44px;padding:10px}
  .cart-line{gap:12px;flex-wrap:wrap}
  .cart-line strong{font-size:14px}
  .cart-line small{font-size:12px}
  .guest-cart .panel-head{padding:20px}
}

@media(max-width:420px){
  .product-grid{grid-template-columns:minmax(0,1fr)}
  .product-art{height:180px}
  .product-info{padding:18px}
  .product-title{flex-direction:row;align-items:flex-start;gap:12px}
  .product-title h3{min-height:0}
  .product-meta{flex-direction:row;flex-wrap:wrap;gap:10px;margin-block:12px}
  .product-bottom{flex-direction:row;align-items:center;gap:8px}
  .product-bottom .btn{flex:1}
  .guest-product{flex-wrap:wrap}
  .guest-product-art{width:80px;height:80px}
  .guest-product>div:not(.guest-product-art){min-width:0;flex:1}
}

@media(max-height:500px) and (max-width:850px){
  .room-canvas-wrap{height:280px}
  .sidebar{padding-top:16px}
  .sidebar .workspace-tag{padding-top:18px}
}
