/* RCO mobile layout demo. Enabled only by ?layout-cellulare-dimostrativo=1 */
html.rco-mobile-layout-demo .mobile-menu-toggle{display:none}
html.rco-mobile-layout-demo .mobile-menu-toggle{width:44px;height:44px;flex:0 0 44px;padding:0;border:1px solid #d9e0e7;border-radius:13px;background:#fff;color:#234d6c;display:none;place-content:center;gap:5px}
html.rco-mobile-layout-demo .mobile-menu-toggle span{display:block;width:19px;height:2px;border-radius:2px;background:currentColor}
@media (max-width:620px), (min-width:621px) and (max-width:1100px) and (orientation:portrait){
  html.rco-mobile-layout-demo .topbar{position:fixed;top:0;left:0;right:0;z-index:70;min-height:64px;padding:9px 13px;display:flex;align-items:center;gap:11px}
  html.rco-mobile-layout-demo .mobile-menu-toggle{display:grid}
  html.rco-mobile-layout-demo .brand-block{min-width:0;flex:1}
  html.rco-mobile-layout-demo .brand-block h1{font-size:16px;line-height:1.2}
  html.rco-mobile-layout-demo .brand-block p{display:none}
  html.rco-mobile-layout-demo .brand-mark{display:grid;width:36px;height:36px;flex:0 0 36px}
  html.rco-mobile-layout-demo .userbar{gap:7px}
  html.rco-mobile-layout-demo .userbar #realtimeBadge,
  html.rco-mobile-layout-demo .userbar #envBadge,
  html.rco-mobile-layout-demo .userbar #currentUser{display:none}
  html.rco-mobile-layout-demo .userbar #logoutBtn{min-height:40px;padding:8px 11px}
  html.rco-mobile-layout-demo .layout{display:block;position:relative;min-height:0;width:100%;max-width:100%;padding-top:64px;overflow-x:clip}
  html.rco-mobile-layout-demo .sidebar{display:none;position:fixed;top:calc(64px + env(safe-area-inset-top));left:12px;z-index:80;width:min(340px,calc(100vw - 24px));height:auto;max-height:calc(100dvh - 88px);overflow:auto;overscroll-behavior:contain;flex-direction:column;align-items:stretch;gap:4px;padding:12px;border:1px solid #dfe5eb;border-radius:16px;background:#fff;box-shadow:0 16px 40px #14283b30}
  html.rco-mobile-layout-demo .sidebar.mobile-menu-open{display:flex}
  html.rco-mobile-layout-demo .sidebar .nav-section-label{display:block;margin:10px 10px 4px;color:#718096;font-size:11px;letter-spacing:.09em;text-transform:uppercase}
  html.rco-mobile-layout-demo .sidebar button{width:100%;min-width:0;min-height:48px;flex:none;display:flex;align-items:center;gap:11px;padding:10px 12px;text-align:left;border-radius:11px}
  html.rco-mobile-layout-demo .sidebar button>span:last-child{min-width:0}
  html.rco-mobile-layout-demo .sidebar .nav-icon{width:24px;height:24px;flex:0 0 24px}
  html.rco-mobile-layout-demo main{width:100%;max-width:100%;min-width:0;padding:20px 14px calc(28px + env(safe-area-inset-bottom));overflow-x:clip}
  html.rco-mobile-layout-demo,html.rco-mobile-layout-demo body{width:100%;max-width:100%;overflow-x:clip;overscroll-behavior-x:none;touch-action:pan-y}
  html.rco-mobile-layout-demo .layout,html.rco-mobile-layout-demo main{max-width:100%;overflow-x:hidden}
  html.rco-mobile-layout-demo #calendar .modern-calendar{max-width:100%;overflow-x:hidden}
  html.rco-mobile-layout-demo #calendar.rco-mobile-month-view .month-calendar{min-width:0;width:100%;padding:6px}
  html.rco-mobile-layout-demo #calendar.rco-mobile-month-view .month-weekdays,html.rco-mobile-layout-demo #calendar.rco-mobile-month-view .month-days{gap:3px}
  html.rco-mobile-layout-demo .view-title{font-size:clamp(25px,7vw,32px)}
  html.rco-mobile-layout-demo .view-subtitle{font-size:15px;line-height:1.5}
  html.rco-mobile-layout-demo button,
  html.rco-mobile-layout-demo input,
  html.rco-mobile-layout-demo select,
  html.rco-mobile-layout-demo textarea{touch-action:manipulation}
  html.rco-mobile-layout-demo .property-modal,
  html.rco-mobile-layout-demo .agenda-modal{padding:0}
  html.rco-mobile-layout-demo .property-modal-panel,
  html.rco-mobile-layout-demo .agenda-modal-panel{width:100%;height:100%;max-height:100dvh;border:0;border-radius:0}
  html.rco-mobile-layout-demo .property-modal-head,
  html.rco-mobile-layout-demo .agenda-modal-head{position:sticky;top:0;z-index:2;background:#fff;padding:calc(12px + env(safe-area-inset-top)) 16px 12px}
  html.rco-mobile-layout-demo .property-modal-body,
  html.rco-mobile-layout-demo .agenda-modal-body{padding:16px 16px calc(22px + env(safe-area-inset-bottom))}
}
@media(max-width:430px){
  html.rco-mobile-layout-demo .topbar{gap:8px;padding-right:10px;padding-left:10px}
  html.rco-mobile-layout-demo .brand-block{gap:8px}
  html.rco-mobile-layout-demo .brand-block h1{font-size:14px}
  html.rco-mobile-layout-demo .brand-mark{width:32px;height:32px;flex-basis:32px}
  html.rco-mobile-layout-demo .userbar #logoutBtn{font-size:13px;padding:7px 9px}
  html.rco-mobile-layout-demo main{padding-right:11px;padding-left:11px}
}
@media(orientation:landscape) and (max-height:520px) and (max-width:1100px){
  html.rco-mobile-layout-demo .sidebar{max-height:calc(100dvh - 78px)}
}


/* Second pass: increase readability and let the phone viewport drive the layout. */
@media (max-width:620px), (min-width:621px) and (max-width:1100px) and (orientation:portrait){
  html.rco-mobile-layout-demo body{font-size:18px;line-height:1.5}
  html.rco-mobile-layout-demo main{width:100%;max-width:none;padding:22px 16px calc(32px + env(safe-area-inset-bottom));font-size:18px}
  html.rco-mobile-layout-demo main :is(p,li,label,.muted,.section-kicker,.view-eyebrow,.section-status,.save-status,.badge,.empty-state,.form-hint,.helper-text){font-size:16px!important;line-height:1.5}
  html.rco-mobile-layout-demo main :is(button,.btn,input,select,textarea){font-size:17px!important;line-height:1.35}
  html.rco-mobile-layout-demo main :is(button,.btn){min-height:52px;padding:12px 15px}
  html.rco-mobile-layout-demo main :is(input,select){height:54px;padding:10px 13px}
  html.rco-mobile-layout-demo main textarea{min-height:112px;padding:12px 13px}
  html.rco-mobile-layout-demo main :is(h2,h3,h4){line-height:1.25}
  html.rco-mobile-layout-demo main .view-title{font-size:clamp(32px,7vw,40px)!important;line-height:1.12}
  html.rco-mobile-layout-demo main .view-subtitle{font-size:17px!important;line-height:1.5}
  html.rco-mobile-layout-demo main .panel-head h3,
  html.rco-mobile-layout-demo main .card h3,
  html.rco-mobile-layout-demo main .section-heading{font-size:22px!important}
  html.rco-mobile-layout-demo main .dashboard-kpi strong{font-size:29px}
  html.rco-mobile-layout-demo main .dashboard-kpi span,
  html.rco-mobile-layout-demo main .dashboard-kpi small{font-size:15px}
  html.rco-mobile-layout-demo main :is(.card,.panel,.editor-card,.registry-card,.issue-inbox-card,.issue-archive-card){padding:18px;border-radius:17px}
  html.rco-mobile-layout-demo main :is(.grid,.form-grid,.management-layout,.assistance-layout){grid-template-columns:minmax(0,1fr)}
  html.rco-mobile-layout-demo main :is(.actions,.view-heading-actions,.form-actions){gap:10px;flex-wrap:wrap}
  html.rco-mobile-layout-demo main .actions>.btn,
  html.rco-mobile-layout-demo main .view-heading-actions>.btn{flex:1 1 190px}
  html.rco-mobile-layout-demo main :is(.property-card,.dashboard-property-focus,.list-item){min-width:0;overflow-wrap:anywhere}
  html.rco-mobile-layout-demo main :is(.calendar-scroll,.table-scroll,.table-wrap){max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
  html.rco-mobile-layout-demo .sidebar button{font-size:17px;line-height:1.35;padding:12px}
  html.rco-mobile-layout-demo .sidebar .nav-section-label{font-size:13px}
  html.rco-mobile-layout-demo .property-modal-panel,
  html.rco-mobile-layout-demo .agenda-modal-panel{font-size:17px}
  html.rco-mobile-layout-demo .property-modal-body,
  html.rco-mobile-layout-demo .agenda-modal-body{padding:20px 18px calc(26px + env(safe-area-inset-bottom))}
}
@media(max-width:430px){
  html.rco-mobile-layout-demo main{padding-right:12px;padding-left:12px}
  html.rco-mobile-layout-demo main :is(p,li,label,.muted,.section-kicker,.view-eyebrow,.section-status,.save-status,.badge,.empty-state,.form-hint,.helper-text){font-size:15.5px!important}
  html.rco-mobile-layout-demo main :is(button,.btn,input,select,textarea){font-size:16px!important}
  html.rco-mobile-layout-demo main :is(.card,.panel,.editor-card,.registry-card,.issue-inbox-card,.issue-archive-card){padding:15px}
  html.rco-mobile-layout-demo main .view-title{font-size:32px!important}
  html.rco-mobile-layout-demo main .actions>.btn,
  html.rco-mobile-layout-demo main .view-heading-actions>.btn{flex-basis:100%;width:100%}
}


/* Readability-first phone profile: single-column cards and comfortable scrolling. */
@media (max-width:620px), (min-width:621px) and (max-width:1100px) and (orientation:portrait){
  html.rco-mobile-layout-demo body{font-size:19px;line-height:1.55;-webkit-text-size-adjust:100%;text-size-adjust:100%}
  html.rco-mobile-layout-demo main{padding:24px 13px calc(38px + env(safe-area-inset-bottom));font-size:19px;line-height:1.55}
  html.rco-mobile-layout-demo main :is(p,li,label,.muted,.section-kicker,.view-eyebrow,.section-status,.save-status,.badge,.empty-state,.form-hint,.helper-text){font-size:18px!important;line-height:1.55}
  html.rco-mobile-layout-demo main :is(button,.btn,input,select,textarea){font-size:19px!important;line-height:1.4}
  html.rco-mobile-layout-demo main :is(button,.btn){min-height:58px;padding:14px 16px}
  html.rco-mobile-layout-demo main :is(input,select){height:60px;padding:13px 15px}
  html.rco-mobile-layout-demo main textarea{min-height:132px}
  html.rco-mobile-layout-demo main .view-title{font-size:36px!important;line-height:1.12}
  html.rco-mobile-layout-demo main .view-subtitle{font-size:19px!important}
  html.rco-mobile-layout-demo main :is(.panel-head h3,.card h3,.section-heading){font-size:25px!important}
  html.rco-mobile-layout-demo main :is(.dashboard-kpis,.today-kpis,.grid.two,.grid.three,.grid.four,.property-card-grid,.form-grid,.modern-form,.checklist,.appliance-grid,.calendar-filters,.network-view #operatorGrid){grid-template-columns:minmax(0,1fr)!important}
  html.rco-mobile-layout-demo main :is(.card,.panel,.editor-card,.registry-card,.issue-inbox-card,.issue-archive-card){padding:20px;border-radius:18px}
  html.rco-mobile-layout-demo main .dashboard-kpi{grid-template-columns:48px minmax(0,1fr);gap:14px;padding:18px}
  html.rco-mobile-layout-demo main .dashboard-kpi strong{font-size:34px}
  html.rco-mobile-layout-demo main .dashboard-kpi :is(span,small){font-size:18px}
  html.rco-mobile-layout-demo main :is(.row,.list-item,.property-card){padding-top:17px;padding-bottom:17px}
  html.rco-mobile-layout-demo main :is(.row-title,.item-title,.list-item strong,.property-card h3){font-size:20px!important;line-height:1.4}
  html.rco-mobile-layout-demo main :is(.row-sub,.list-item small,.property-card p){font-size:17px!important;line-height:1.5}
  html.rco-mobile-layout-demo main .actions,
  html.rco-mobile-layout-demo main .view-heading-actions,
  html.rco-mobile-layout-demo main .form-actions{display:grid;grid-template-columns:minmax(0,1fr);gap:11px}
  html.rco-mobile-layout-demo main .actions>.btn,
  html.rco-mobile-layout-demo main .view-heading-actions>.btn{width:100%;min-width:0}
  html.rco-mobile-layout-demo .sidebar{width:min(390px,calc(100vw - 20px));left:10px}
  html.rco-mobile-layout-demo .sidebar button{min-height:56px;font-size:19px;line-height:1.4;padding:13px 14px}
  html.rco-mobile-layout-demo .sidebar .nav-section-label{font-size:14px}
  html.rco-mobile-layout-demo .property-modal-body,
  html.rco-mobile-layout-demo .agenda-modal-body{padding:22px 18px calc(30px + env(safe-area-inset-bottom))}
  html.rco-mobile-layout-demo .property-modal-body :is(label,button,input,select,textarea){font-size:18px}
  html.rco-mobile-layout-demo .property-modal-body :is(input,select){height:58px}
  html.rco-mobile-layout-demo .property-modal-body .btn{min-height:56px}
}
@media(max-width:370px){
  html.rco-mobile-layout-demo main{padding-right:11px;padding-left:11px}
  html.rco-mobile-layout-demo main .dashboard-kpi{grid-template-columns:42px minmax(0,1fr);padding:16px}
}
@media(min-width:621px) and (max-width:1100px){
  html.rco-mobile-layout-demo main :is(.grid.two,.grid.three,.grid.four,.dashboard-kpis,.today-kpis,.property-card-grid,.form-grid,.modern-form,.checklist,.appliance-grid,.calendar-filters){grid-template-columns:repeat(2,minmax(0,1fr))}
}


/* Third pass requested: much larger overall phone controls and typography. */
@media (max-width:620px), (min-width:621px) and (max-width:1100px) and (orientation:portrait){
  html.rco-mobile-layout-demo body{font-size:21px;line-height:1.6}
  html.rco-mobile-layout-demo main{font-size:21px;line-height:1.6;padding:26px 14px calc(42px + env(safe-area-inset-bottom))}
  html.rco-mobile-layout-demo main :is(p,li,label,.muted,.section-kicker,.view-eyebrow,.section-status,.save-status,.badge,.empty-state,.form-hint,.helper-text){font-size:20px!important;line-height:1.55}
  html.rco-mobile-layout-demo main :is(button,.btn,input,select,textarea){font-size:21px!important;line-height:1.4}
  html.rco-mobile-layout-demo main :is(button,.btn){min-height:64px;padding:16px 18px}
  html.rco-mobile-layout-demo main :is(input,select){height:66px;padding:15px 16px}
  html.rco-mobile-layout-demo main textarea{min-height:150px}
  html.rco-mobile-layout-demo main .view-title{font-size:40px!important;line-height:1.12}
  html.rco-mobile-layout-demo main .view-subtitle{font-size:21px!important}
  html.rco-mobile-layout-demo main :is(.panel-head h3,.card h3,.section-heading){font-size:28px!important}
  html.rco-mobile-layout-demo main :is(.card,.panel,.editor-card,.registry-card,.issue-inbox-card,.issue-archive-card){padding:23px;border-radius:20px}
  html.rco-mobile-layout-demo main .dashboard-kpi{grid-template-columns:52px minmax(0,1fr);gap:16px;padding:21px}
  html.rco-mobile-layout-demo main .dashboard-kpi strong{font-size:38px}
  html.rco-mobile-layout-demo main .dashboard-kpi :is(span,small){font-size:20px}
  html.rco-mobile-layout-demo main :is(.row-title,.item-title,.list-item strong,.property-card h3){font-size:23px!important;line-height:1.4}
  html.rco-mobile-layout-demo main :is(.row-sub,.list-item small,.property-card p){font-size:19px!important;line-height:1.5}
  html.rco-mobile-layout-demo .sidebar button{min-height:64px;font-size:21px;line-height:1.4;padding:15px 16px}
  html.rco-mobile-layout-demo .sidebar .nav-section-label{font-size:16px}
  html.rco-mobile-layout-demo .property-modal-body,
  html.rco-mobile-layout-demo .agenda-modal-body{padding:24px 20px calc(34px + env(safe-area-inset-bottom))}
  html.rco-mobile-layout-demo .property-modal-body :is(label,button,input,select,textarea){font-size:20px}
  html.rco-mobile-layout-demo .property-modal-body :is(input,select){height:64px}
  html.rco-mobile-layout-demo .property-modal-body .btn{min-height:62px}
  html.rco-mobile-layout-demo main :is(.badge,.count-pill,.nav-alert-count){font-size:16px}
}
@media(max-width:370px){
  html.rco-mobile-layout-demo main{padding-right:12px;padding-left:12px}
  html.rco-mobile-layout-demo main .view-title{font-size:37px!important}
  html.rco-mobile-layout-demo main :is(p,li,label,.muted,.section-kicker,.view-eyebrow,.section-status,.save-status,.badge,.empty-state,.form-hint,.helper-text){font-size:18px!important}
  html.rco-mobile-layout-demo main :is(button,.btn,input,select,textarea){font-size:19px!important}
  html.rco-mobile-layout-demo main .dashboard-kpi{grid-template-columns:46px minmax(0,1fr);padding:18px}
}


/* Accessibility pass for readers who need larger text. */
@media (max-width:620px), (min-width:621px) and (max-width:1100px) and (orientation:portrait){
  html.rco-mobile-layout-demo{--muted:#46515f}
  html.rco-mobile-layout-demo body{font-size:23px;line-height:1.62}
  html.rco-mobile-layout-demo main{font-size:23px;line-height:1.62;padding-top:28px}
  html.rco-mobile-layout-demo main :is(p,li,label,.muted,.section-kicker,.view-eyebrow,.section-status,.save-status,.badge,.empty-state,.form-hint,.helper-text){font-size:21px!important;line-height:1.58;color:#46515f}
  html.rco-mobile-layout-demo main :is(button,.btn,input,select,textarea){font-size:22px!important;line-height:1.42}
  html.rco-mobile-layout-demo main :is(button,.btn){min-height:68px;padding:17px 19px}
  html.rco-mobile-layout-demo main :is(input,select){height:70px;padding:16px 17px}
  html.rco-mobile-layout-demo main textarea{min-height:160px}
  html.rco-mobile-layout-demo main .view-title{font-size:43px!important}
  html.rco-mobile-layout-demo main .view-subtitle{font-size:22px!important}
  html.rco-mobile-layout-demo main :is(h2,h3,h4,.panel-head h3,.card h3,.section-heading){font-size:29px!important;line-height:1.3}
  html.rco-mobile-layout-demo main :is(th,summary,.field-label,.form-label){font-size:20px}
  html.rco-mobile-layout-demo main :is(.row-title,.item-title,.list-item strong,.property-card h3){font-size:24px!important}
  html.rco-mobile-layout-demo main :is(.row-sub,.list-item small,.property-card p){font-size:20px!important;color:#46515f}
  html.rco-mobile-layout-demo main .dashboard-kpi strong{font-size:40px}
  html.rco-mobile-layout-demo main .dashboard-kpi :is(span,small){font-size:21px}
  html.rco-mobile-layout-demo .sidebar button{min-height:68px;font-size:22px;line-height:1.45;padding:16px}
  html.rco-mobile-layout-demo .sidebar .nav-section-label{font-size:17px;color:#46515f}
  html.rco-mobile-layout-demo main :is(.card,.panel,.editor-card,.registry-card,.issue-inbox-card,.issue-archive-card){padding:25px}
  html.rco-mobile-layout-demo main :is(.grid.two,.grid.three,.grid.four,.dashboard-kpis,.today-kpis,.property-card-grid,.form-grid,.modern-form,.checklist,.appliance-grid,.calendar-filters,.network-view #operatorGrid){grid-template-columns:minmax(0,1fr)!important}
  html.rco-mobile-layout-demo main .actions,
  html.rco-mobile-layout-demo main .view-heading-actions,
  html.rco-mobile-layout-demo main .form-actions{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:370px){
  html.rco-mobile-layout-demo body,
  html.rco-mobile-layout-demo main{font-size:21px}
  html.rco-mobile-layout-demo main :is(p,li,label,.muted,.section-kicker,.view-eyebrow,.section-status,.save-status,.badge,.empty-state,.form-hint,.helper-text){font-size:19px!important}
  html.rco-mobile-layout-demo main :is(button,.btn,input,select,textarea){font-size:20px!important}
  html.rco-mobile-layout-demo main .view-title{font-size:39px!important}
  html.rco-mobile-layout-demo main :is(.card,.panel,.editor-card,.registry-card,.issue-inbox-card,.issue-archive-card){padding:19px}
}


/* Mobile login: keep language available inline and put sign-in controls first. */
@media (max-width:620px), (min-width:621px) and (max-width:1100px) and (orientation:portrait){
  html.rco-mobile-layout-demo .login-screen{display:block;overflow-y:auto;overscroll-behavior-y:contain;min-height:100dvh;padding:0;background:#f4f6f8}
  html.rco-mobile-layout-demo .login-shell{display:block;width:100%;max-width:560px;min-height:100dvh;margin:0 auto;overflow:visible;border:0;border-radius:0;background:#fff;box-shadow:none}
  html.rco-mobile-layout-demo .login-visual{min-height:0;padding:13px 17px;background:#173f59}
  html.rco-mobile-layout-demo .login-visual:before,
  html.rco-mobile-layout-demo .login-visual:after,
  html.rco-mobile-layout-demo .login-presentation,
  html.rco-mobile-layout-demo .login-features{display:none}
  html.rco-mobile-layout-demo .login-brand{gap:11px;font-size:18px;line-height:1.2}
  html.rco-mobile-layout-demo .login-brand>span{width:44px;height:44px;flex:0 0 44px;font-size:14px}
  html.rco-mobile-layout-demo .login-card{width:100%;max-width:520px;padding:22px 18px 30px}
  html.rco-mobile-layout-demo .login-language-picker{margin:0 0 18px;font-size:17px}
  html.rco-mobile-layout-demo .login-language-button{min-width:62px;min-height:54px;font-size:18px}
  html.rco-mobile-layout-demo .login-card-head{margin-bottom:20px}
  html.rco-mobile-layout-demo .login-kicker{font-size:15px}
  html.rco-mobile-layout-demo .login-card h2{font-size:34px;line-height:1.15}
  html.rco-mobile-layout-demo .login-card-head p{font-size:19px;line-height:1.5}
  html.rco-mobile-layout-demo .login-mode-tabs{gap:7px;margin-bottom:16px;padding:5px}
  html.rco-mobile-layout-demo .login-mode-tabs button{min-height:58px;font-size:18px}
  html.rco-mobile-layout-demo .login-role-heading{gap:5px;margin-bottom:12px}
  html.rco-mobile-layout-demo .login-role-heading>span{font-size:18px}
  html.rco-mobile-layout-demo .login-role-heading small{display:none}
  html.rco-mobile-layout-demo .login-role-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:18px}
  html.rco-mobile-layout-demo .login-role-card{min-width:0;min-height:70px;display:grid;place-items:center;padding:8px 5px;text-align:center}
  html.rco-mobile-layout-demo .login-role-icon,
  html.rco-mobile-layout-demo .login-role-card small{display:none}
  html.rco-mobile-layout-demo .login-role-card strong{font-size:15px;line-height:1.3;overflow-wrap:anywhere}
  html.rco-mobile-layout-demo .login-card form{gap:15px;margin-top:0}
  html.rco-mobile-layout-demo .login-card form label{font-size:18px;line-height:1.4}
  html.rco-mobile-layout-demo .login-card form input,
  html.rco-mobile-layout-demo .login-mode-panel textarea{min-height:64px;padding:14px 15px;font-size:19px}
  html.rco-mobile-layout-demo .login-card form textarea{min-height:130px}
  html.rco-mobile-layout-demo .login-card form .btn{min-height:68px;font-size:20px}
  html.rco-mobile-layout-demo .login-security-note{font-size:16px;line-height:1.5}
  html.rco-mobile-layout-demo .login-version{font-size:14px}
  html.rco-mobile-layout-demo .admin-language-screen{padding:14px}
  html.rco-mobile-layout-demo .admin-language-card{padding:24px 18px}
  html.rco-mobile-layout-demo .admin-language-card h2{font-size:32px}
  html.rco-mobile-layout-demo .admin-language-card p{font-size:19px;line-height:1.5}
  html.rco-mobile-layout-demo .admin-language-options button{min-height:64px;font-size:19px}
}
@media(max-width:370px){
  html.rco-mobile-layout-demo .login-card{padding-right:14px;padding-left:14px}
  html.rco-mobile-layout-demo .login-card h2{font-size:31px}
  html.rco-mobile-layout-demo .login-role-card strong{font-size:14px}
}

/* Mobile calendar view selector. */
@media (max-width:620px), (min-width:621px) and (max-width:1100px) and (orientation:portrait){
  html.rco-mobile-layout-demo #calendar .rco-mobile-mode-switch{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
  html.rco-mobile-layout-demo #calendar .rco-mobile-mode-switch button{min-height:52px;border:1px solid #c7d0d8;border-radius:12px;background:#fff;color:#344054;padding:8px 5px;font:inherit;font-size:15px;font-weight:800}
  html.rco-mobile-layout-demo #calendar .rco-mobile-mode-switch button.active{border-color:#174f70;background:#174f70;color:#fff}
  html.rco-mobile-layout-demo #calendar .rco-mobile-day-blocks{display:grid;gap:14px}
  html.rco-mobile-layout-demo #calendar .rco-mobile-day-block{display:grid;gap:10px}
  html.rco-mobile-layout-demo #calendar .rco-mobile-month-help{margin:0;padding:14px 16px;border-radius:14px;background:#f7f9fa;color:#46515f;font-size:16px;line-height:1.4}
  html.rco-mobile-layout-demo #calendar.rco-mobile-month-view .month-calendar{display:grid!important;overflow:hidden}
  html.rco-mobile-layout-demo #calendar.rco-mobile-month-view .calendar-cell{min-height:72px;padding:8px 5px}
  html.rco-mobile-layout-demo #calendar.rco-mobile-month-view .calendar-cell-tags{display:none}
  html.rco-mobile-layout-demo #calendar.rco-mobile-month-view .calendar-cell-number{font-size:18px}
}

/* Extracted day cell: enlarged copy of the original calendar cell. */
@media (max-width:620px), (min-width:621px) and (max-width:1100px) and (orientation:portrait){
  html.rco-mobile-layout-demo #calendar .rco-mobile-extracted-cell{display:grid!important;grid-template-columns:1fr!important;gap:13px;min-height:220px!important;margin:0;padding:20px!important;border-radius:20px!important;border:2px solid #b8c7d2!important;background:#fff!important;box-shadow:0 8px 22px rgba(23,79,112,.10);cursor:pointer}
  html.rco-mobile-layout-demo #calendar .rco-mobile-extracted-cell .calendar-cell-number{font-size:54px!important;line-height:1!important;font-weight:900}
  html.rco-mobile-layout-demo #calendar .rco-mobile-extracted-cell .calendar-cell-tags{display:flex!important;flex-wrap:wrap;gap:9px!important;margin-top:3px}
  html.rco-mobile-layout-demo #calendar .rco-mobile-extracted-cell .calendar-cell-tags span{font-size:18px!important;line-height:1.2;padding:8px 11px!important}
  html.rco-mobile-layout-demo #calendar .rco-mobile-extracted-cell .calendar-property-dots{display:flex!important;flex-wrap:wrap;gap:9px!important;margin-top:auto}
  html.rco-mobile-layout-demo #calendar .rco-mobile-extracted-cell .calendar-property-dots i{width:18px!important;height:18px!important}
  html.rco-mobile-layout-demo #calendar .rco-mobile-extracted-cell:after{content:"Tap the day to open and manage it";display:block;color:#52606d;font-size:15px;font-weight:700}
  html.rco-mobile-layout-demo #calendar .rco-mobile-extracted-cell .calendar-cell-tags:empty:after{content:"No items scheduled";color:#52606d;font-size:18px;font-weight:700}
  html.rco-mobile-layout-demo #calendar .rco-mobile-extracted-cell .calendar-cell-tags:empty{display:block!important}
}


/* Final mobile menu containment: keep the hamburger panel inside the viewport. */
@media (max-width:620px), (min-width:621px) and (max-width:1100px) and (orientation:portrait){
  html.rco-mobile-layout-demo .sidebar{
    left:10px;
    right:10px;
    width:auto;
    max-width:calc(100vw - 20px);
    box-sizing:border-box;
    overflow-x:hidden;
    overflow-y:auto;
    overscroll-behavior-x:none;
    touch-action:pan-y;
  }
  html.rco-mobile-layout-demo .sidebar *{
    max-width:100%;
    min-width:0;
    box-sizing:border-box;
  }
  html.rco-mobile-layout-demo .sidebar button{
    overflow:hidden;
    white-space:normal;
    overflow-wrap:anywhere;
    word-break:break-word;
  }
  html.rco-mobile-layout-demo .sidebar .nav-section-label{
    overflow-wrap:anywhere;
    word-break:break-word;
  }
}


/* Keep long navigation labels inside their mobile menu button. */
@media (max-width:620px), (min-width:621px) and (max-width:1100px) and (orientation:portrait){
  html.rco-mobile-layout-demo .sidebar button{
    width:100%;
    max-width:100%;
    min-width:0;
  }
  html.rco-mobile-layout-demo .sidebar button>span:last-child{
    flex:1 1 0;
    width:0;
    max-width:100%;
    min-width:0;
    overflow:hidden;
    white-space:normal;
    overflow-wrap:anywhere;
    word-break:break-word;
  }
}


/* Mobile login: show access roles as three clear full-width rows. */
@media (max-width:620px), (min-width:621px) and (max-width:1100px) and (orientation:portrait){
  html.rco-mobile-layout-demo .login-role-grid{
    grid-template-columns:minmax(0,1fr)!important;
    gap:10px;
    margin-bottom:20px;
  }
  html.rco-mobile-layout-demo .login-role-card{
    width:100%;
    min-width:0;
    min-height:64px;
    display:flex;
    align-items:center;
    justify-content:flex-start;
    padding:15px 17px;
    text-align:left;
    border-radius:14px;
  }
  html.rco-mobile-layout-demo .login-role-card strong{
    display:block;
    min-width:0;
    font-size:20px;
    line-height:1.3;
    white-space:normal;
    overflow-wrap:anywhere;
  }
  html.rco-mobile-layout-demo .login-role-icon,
  html.rco-mobile-layout-demo .login-role-card small{
    display:none;
  }
}


/* Phones keep the mobile layout in portrait and landscape without blocking use. */

/* Checkpoint mobile: calendario mensile predefinito e filtri compatti a tendina. */
@media (max-width:620px), (min-width:621px) and (max-width:1100px) and (orientation:portrait){
  #calendar #calendarFilters{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
    margin-top:12px;
    padding:10px;
    border:1px solid #d9e0e5;
    border-radius:14px;
    background:#f7f9fa;
  }
  #calendar #calendarFilters .calendar-filter-heading,
  #calendar #calendarFilters > .btn{
    display:none!important;
  }
  #calendar #calendarFilters label{
    display:block;
    margin:0;
    font-size:0;
  }
  #calendar #calendarFilters select{
    display:block;
    width:100%;
    min-height:48px;
    padding:10px 38px 10px 12px;
    border:1px solid #c7d0d8;
    border-radius:11px;
    background:#fff;
    color:#17212b;
    font:inherit;
    font-size:16px;
    font-weight:750;
  }
}


/* Checkpoint 22/10: barra mobile separata e tema notturno leggibile. */
@media (max-width:620px), (min-width:621px) and (max-width:1100px) and (orientation:portrait){
  .topbar,
  html.rco-mobile-layout-demo .topbar{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto;
    grid-template-areas:"brand menu" "user user";
    align-items:center;
    gap:8px;
    min-width:0;
    padding:10px 12px;
  }
  .topbar .brand-block,
  html.rco-mobile-layout-demo .topbar .brand-block{
    grid-area:brand;
    min-width:0;
    max-width:100%;
    overflow:hidden;
    display:flex;
    align-items:center;
    gap:8px;
  }
  .topbar .brand-block h1,
  html.rco-mobile-layout-demo .topbar .brand-block h1{
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:16px;
  }
  .topbar .brand-block p,
  html.rco-mobile-layout-demo .topbar .brand-block p{display:none}
  .topbar .brand-mark,
  html.rco-mobile-layout-demo .topbar .brand-mark{
    display:grid!important;
    flex:0 0 34px;
    width:34px;
    height:34px;
  }
  .topbar #mobileMenuButton,
  .topbar .mobile-menu-toggle,
  html.rco-mobile-layout-demo .topbar #mobileMenuButton,
  html.rco-mobile-layout-demo .topbar .mobile-menu-toggle{
    grid-area:menu;
    position:static!important;
    z-index:auto;
    flex:0 0 42px;
    width:42px;
    height:42px;
    margin:0!important;
    justify-self:end;
  }
  .topbar .userbar,
  html.rco-mobile-layout-demo .topbar .userbar{
    grid-area:user;
    min-width:0;
    width:100%;
    margin-left:0!important;
    justify-content:flex-end;
  }

  /* La selezione delle modalità è raccolta sotto un solo comando. */
  #calendar #calendarFilters,
  html.rco-mobile-layout-demo #calendar #calendarFilters{display:none!important}
  #calendar .rco-mobile-view-menu,
  html.rco-mobile-layout-demo #calendar .rco-mobile-view-menu{
    display:block;
    margin:0 0 10px;
    border:1px solid #c7d0d8;
    border-radius:14px;
    background:#fff;
    overflow:hidden;
  }
  #calendar .rco-mobile-view-menu>summary,
  html.rco-mobile-layout-demo #calendar .rco-mobile-view-menu>summary{
    display:flex;
    align-items:center;
    justify-content:space-between;
    min-height:52px;
    padding:12px 14px;
    color:#174f70;
    cursor:pointer;
    font:inherit;
    font-size:16px;
    font-weight:850;
    list-style:none;
  }
  #calendar .rco-mobile-view-menu>summary::-webkit-details-marker,
  html.rco-mobile-layout-demo #calendar .rco-mobile-view-menu>summary::-webkit-details-marker{display:none}
  #calendar .rco-mobile-view-menu>summary:after,
  html.rco-mobile-layout-demo #calendar .rco-mobile-view-menu>summary:after{
    content:"⌄";
    font-size:21px;
    line-height:1;
    transition:transform .16s ease;
  }
  #calendar .rco-mobile-view-menu[open]>summary:after,
  html.rco-mobile-layout-demo #calendar .rco-mobile-view-menu[open]>summary:after{transform:rotate(180deg)}
  #calendar .rco-mobile-view-menu .rco-mobile-mode-switch,
  html.rco-mobile-layout-demo #calendar .rco-mobile-view-menu .rco-mobile-mode-switch{
    display:none!important;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px;
    padding:10px;
    border-top:1px solid #e2e8ee;
    background:#f7f9fa;
  }
  #calendar .rco-mobile-view-menu[open] .rco-mobile-mode-switch,
  html.rco-mobile-layout-demo #calendar .rco-mobile-view-menu[open] .rco-mobile-mode-switch{
    display:grid!important;
  }
  #calendar .rco-mobile-view-menu .rco-mobile-mode-switch button,
  html.rco-mobile-layout-demo #calendar .rco-mobile-view-menu .rco-mobile-mode-switch button{
    min-height:48px;
  }
}

body.rco-manager-theme-night main,
body.rco-manager-theme-night .view,
body.rco-manager-theme-night .mobile-menu{
  color:var(--ink);
}
body.rco-manager-theme-night main .view-title,
body.rco-manager-theme-night main .view:not(#today)>.view-title,
body.rco-manager-theme-night main .view h2,
body.rco-manager-theme-night main .view h3,
body.rco-manager-theme-night main .view h4,
body.rco-manager-theme-night main .panel-head h3,
body.rco-manager-theme-night main .list-title,
body.rco-manager-theme-night main .calendar-detail-head h3{
  color:var(--ink)!important;
}
body.rco-manager-theme-night main .view-subtitle,
body.rco-manager-theme-night main .view-eyebrow,
body.rco-manager-theme-night main .section-kicker,
body.rco-manager-theme-night main .muted,
body.rco-manager-theme-night main .list-meta,
body.rco-manager-theme-night main .field-help,
body.rco-manager-theme-night main .panel-head p,
body.rco-manager-theme-night main .timeline-time{
  color:var(--muted)!important;
}
body.rco-manager-theme-night main .view-eyebrow,
body.rco-manager-theme-night main .section-kicker{color:#9cc2ff!important}
body.rco-manager-theme-night main .card,
body.rco-manager-theme-night main .list-item,
body.rco-manager-theme-night main .property-catalog,
body.rco-manager-theme-night main .property-catalog-card,
body.rco-manager-theme-night main .network-directory,
body.rco-manager-theme-night main .issue-inbox-card,
body.rco-manager-theme-night main .issue-archive-card,
body.rco-manager-theme-night main .issue-detail,
body.rco-manager-theme-night main .calendar-filters,
body.rco-manager-theme-night main .calendar-legend-card,
body.rco-manager-theme-night main .calendar-detail-card{
  background:#162338!important;
  border-color:#33455e!important;
  color:var(--ink);
}
body.rco-manager-theme-night main .calendar-filters label,
body.rco-manager-theme-night main .calendar-filter-heading b,
body.rco-manager-theme-night main .form-grid label,
body.rco-manager-theme-night main .calendar-controls strong{
  color:var(--ink)!important;
}
body.rco-manager-theme-night main .calendar-filters select,
body.rco-manager-theme-night main input,
body.rco-manager-theme-night main select,
body.rco-manager-theme-night main textarea{
  background:#162338!important;
  color:var(--ink)!important;
  border-color:#4a668a!important;
}
body.rco-manager-theme-night main .calendar-controls{
  background:#162338!important;
  border-color:#33455e!important;
}
body.rco-manager-theme-night main .calendar-controls .btn,
body.rco-manager-theme-night main .btn:not(.primary):not(.blue):not(.green):not(.danger){
  background:#1a2b42!important;
  color:#edf4ff!important;
  border-color:#4a668a!important;
}
body.rco-manager-theme-night main .empty{
  background:#1b2d45!important;
  border-color:#4a668a!important;
  color:var(--muted)!important;
}
body.rco-manager-theme-night main .calendar-cell:not(.checkin):not(.checkout):not(.mixed):not(.emergency),
body.rco-manager-theme-night main .calendar-cell.property-period:not(.checkin):not(.checkout):not(.mixed):not(.emergency){
  color:var(--ink)!important;
}
body.rco-manager-theme-night main .calendar-cell.checkin,
body.rco-manager-theme-night main .calendar-cell.checkout,
body.rco-manager-theme-night main .calendar-cell.mixed,
body.rco-manager-theme-night main .calendar-cell.emergency{
  color:#fff!important;
}
body.rco-manager-theme-night .mobile-menu{
  background:#111d30;
  border-color:#33455e;
}
body.rco-manager-theme-night .mobile-menu-head,
body.rco-manager-theme-night .mobile-menu-close,
body.rco-manager-theme-night .mobile-menu nav button{
  color:var(--ink);
  border-color:#33455e;
  background:#162338;
}
body.rco-manager-theme-night .mobile-menu nav button.active{background:#203b5e;color:#b9d3ff}
body.rco-manager-theme-night .mobile-menu nav button:hover,
body.rco-manager-theme-night .mobile-menu nav button:focus-visible{background:#203551}


/* Rifinitura contrasto: anche i testi descrittivi restano leggibili sui pannelli scuri. */
body.rco-manager-theme-night main p,
body.rco-manager-theme-night main li,
body.rco-manager-theme-night main small{
  color:var(--muted)!important;
}
body.rco-manager-theme-night main .dashboard-property-focus p,
body.rco-manager-theme-night main .dashboard-property-focus small{
  color:#c1cede!important;
}
body.rco-manager-theme-night main .dashboard-property-focus h2,
body.rco-manager-theme-night main .dashboard-property-focus h3{
  color:var(--ink)!important;
}
