/* One domain, one application and one set of data; these controls adapt to narrow screens. */
.mobile-tab-label{display:none}
.planner-mobile{overflow-x:clip}
.planner-mobile .masthead{min-height:66px;padding:12px max(14px,env(safe-area-inset-right));gap:10px}
.planner-mobile .brand{gap:9px;min-width:0}.planner-mobile .brand img{width:38px;height:38px;object-fit:contain}.planner-mobile .brand b{font-size:17px}.planner-mobile .brand small,.planner-mobile .shared-label{display:none}
.planner-mobile .account-button{padding:5px;gap:7px;min-height:44px}.planner-mobile .account-button>span:last-child{max-width:60px;overflow:hidden;text-overflow:ellipsis;font-size:12px}
.planner-mobile .main-workspace{padding:18px 12px calc(96px + env(safe-area-inset-bottom));max-width:100%;min-width:0}
.planner-mobile .heading-row{align-items:flex-start;gap:12px;flex-wrap:wrap;margin-bottom:16px}.planner-mobile .heading-row h1{font-size:25px}.planner-mobile .heading-row .eyebrow{font-size:10px}.planner-mobile .heading-actions{width:100%;gap:3px;justify-content:flex-start;flex-wrap:wrap}.planner-mobile .heading-actions button{min-height:44px;font-size:12px;padding:8px}
.planner-mobile .board-toolbar{margin:0;padding:0;border:0}.planner-mobile .view-tabs{position:fixed;left:0;right:0;bottom:0;z-index:45;height:auto;min-height:70px;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:0;padding:7px 6px calc(8px + env(safe-area-inset-bottom));border:1px solid var(--ui-line);border-radius:18px 18px 0 0;background:var(--ui-panel);box-shadow:0 -5px 25px #50346412}
.planner-mobile .view-tabs [role=tab]{position:relative;min-width:0;min-height:50px;padding:6px 2px;display:flex;flex-direction:column;gap:3px;border:0;border-radius:10px;color:var(--ui-muted);font-size:10px;white-space:nowrap;background:transparent;box-shadow:none}
.planner-mobile .view-tabs [role=tab][data-state=active]{background:var(--ui-hover);color:var(--ui-accent-ink)}.planner-mobile .view-tabs .tab-count{position:absolute;right:9px;top:1px;padding:1px 4px;font-size:8px;min-width:13px}.planner-mobile .view-tabs .desktop-tab-label{display:none}.planner-mobile .view-tabs .mobile-tab-label{display:inline}.planner-mobile.mobile-keyboard .view-tabs{display:none}
.planner-mobile .board-meta{font-size:11px;align-items:flex-start;gap:5px;flex-direction:column;margin:0 0 13px}.planner-mobile .board-layout{display:block;min-width:0}.planner-mobile .board-tab-region{width:100%;min-width:0}.planner-mobile .chat-column{display:none}.planner-mobile.mobile-chat-view .board-tab-region{display:none}.planner-mobile.mobile-chat-view .chat-column{display:block;width:100%;position:static;margin:0}
.planner-mobile .planner-tools{flex-wrap:wrap;justify-content:flex-start;gap:7px}.planner-mobile .planner-tools button{min-height:42px}.planner-mobile .calendar-filters{padding:12px 0;display:grid;grid-template-columns:minmax(0,1fr);gap:9px}.planner-mobile .calendar-search{min-width:0}.planner-mobile .calendar-filters input,.planner-mobile .calendar-filters select{font-size:16px;min-width:0;min-height:44px;width:100%}.planner-mobile .calendar-filters>label:last-child{display:grid;grid-template-columns:100px minmax(0,1fr)}
.planner-mobile .calendar-visibility{padding:7px 0}.planner-mobile .calendar-completed-toggle{min-height:44px;font-size:12px}.planner-mobile .calendar-completed-toggle input{height:20px;width:20px}
.planner-mobile .calendar-navigation{padding:10px 0;gap:5px;grid-template-columns:44px minmax(0,1fr) 44px}.planner-mobile .calendar-nav-button{min-width:44px;min-height:44px;padding:8px;border-radius:10px}.planner-mobile .calendar-nav-button>span{display:none}.planner-mobile .calendar-navigation-center{min-width:0}.planner-mobile .calendar-week-range{font-size:14px}.planner-mobile .calendar-nav-today{min-height:36px;padding:6px 14px}
.mobile-calendar-mode{display:flex;gap:6px;padding:0 0 12px}.mobile-calendar-mode button,.mobile-group-toggle{min-height:40px;border:1px solid var(--ui-line);border-radius:9px;background:var(--ui-panel);color:var(--ui-muted);padding:8px 15px;font:inherit;font-size:12px}.mobile-calendar-mode button[aria-pressed=true]{background:var(--ui-hover);border-color:var(--ui-accent);color:var(--ui-accent-ink)}
.planner-mobile .day-focus-toolbar{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:4px;padding:6px 0}.planner-mobile .calendar-back-week{display:none}.planner-mobile .day-navigation-date{text-align:center;min-width:0}.planner-mobile .day-navigation-date>b{font-size:17px}.planner-mobile .day-navigation-date>span{font-size:11px}
.planner-mobile .day-picker{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));min-width:0;gap:3px;margin:8px 0 13px}.planner-mobile .day-picker>div{min-width:0}.planner-mobile .day-picker .day-heading{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:7px 1px;height:72px;min-height:72px;border:1px solid var(--ui-line);border-radius:10px;background:var(--ui-panel);width:100%}.planner-mobile .day-picker .day-heading>span{font-size:9px}.planner-mobile .day-picker .day-heading strong{font-size:18px}.planner-mobile .day-picker .day-heading small{font-size:8px;white-space:nowrap}.planner-mobile .day-picker .day-today{border-color:var(--ui-accent)}.planner-mobile .day-picker .day-selected{background:var(--ui-hover);border-color:var(--ui-accent);color:var(--ui-accent-ink)}
.planner-mobile .calendar-scroll{overflow:visible;min-width:0;border:0;background:transparent}.planner-mobile .week-grid{grid-template-columns:minmax(0,1fr);min-width:0;min-height:0;gap:13px}.planner-mobile .day-column{border:1px solid var(--ui-line)!important;border-radius:12px;overflow:hidden}.planner-mobile .day-column .day-heading{height:60px;min-height:60px;padding:10px 14px}.planner-mobile .day-column .day-work{padding:10px}.planner-mobile .day-focused-work{padding:0;min-width:0}.planner-mobile .clinic-group-heading{padding:10px 6px;min-height:42px;font-size:14px}
.planner-mobile .planner-row{flex-wrap:wrap;gap:6px;min-height:60px;padding:10px 6px}.planner-mobile .planner-title{font-size:15px;white-space:normal;line-height:1.5;min-height:40px;flex-basis:calc(100% - 105px);padding:7px 9px;overflow-wrap:anywhere}.planner-mobile .planner-owner,.planner-mobile .planner-credit,.planner-mobile .planner-row-clinic,.planner-mobile .planner-rejection,.planner-mobile .planner-urgency{font-size:11px;max-width:100%;padding:3px 5px}.planner-mobile .planner-menu-button,.planner-mobile .planner-take{width:40px;height:40px;opacity:1;border-radius:9px;background:var(--ui-hover)}.planner-mobile .planner-take svg{width:18px;height:18px}.planner-mobile .planner-symbols{font-size:11px}.planner-mobile .planner-grip{display:none}
.mobile-move-work{height:40px;width:40px;flex-shrink:0;border:1px solid var(--ui-line);border-radius:9px;background:var(--ui-panel);color:var(--ui-accent-ink);display:grid;place-items:center}.mobile-move-work:disabled{opacity:.45}.mobile-move-dialog form{display:grid;gap:14px}.mobile-move-dialog label{display:grid;gap:8px;font-size:14px}
.planner-mobile .planner-quick-add{min-height:48px}.planner-mobile .planner-quick-add input{height:44px;font-size:16px}.planner-mobile .undated-section{padding:13px;margin-top:16px}.planner-mobile .undated-heading{flex-wrap:wrap}.planner-mobile .undated-heading select{min-height:42px;max-width:100%;font-size:16px}.planner-mobile .undated-cards{display:block}.planner-mobile .personal-full{min-height:240px;padding:16px}.planner-mobile .personal-grid{grid-template-columns:minmax(0,1fr);gap:12px}.planner-mobile .work-card{padding:15px}.planner-mobile .card-title{font-size:17px}.planner-mobile .card-bottom button{min-height:42px;padding:9px}.planner-mobile .workspace-footer{flex-wrap:wrap;font-size:11px}.planner-mobile .workspace-footer button{min-height:44px}
.planner-mobile .chat-body{height:calc(var(--mobile-height,100vh) - 265px);min-height:300px;max-height:none}.planner-mobile .chat-history{padding:12px}.planner-mobile .chat-message{max-width:94%;padding:11px 12px}.planner-mobile .chat-message p{font-size:15px}.planner-mobile .chat-compose textarea{font-size:16px;min-height:75px}.planner-mobile .chat-send,.planner-mobile .chat-attach,.planner-mobile .chat-sound{min-width:44px;min-height:44px}.planner-mobile .chat-upload button,.planner-mobile .chat-delete-file{width:40px;height:40px}.planner-mobile .chat-compose-footer>small{display:none}.planner-mobile .chat-delete-message{min-height:36px;font-size:11px}.planner-mobile.mobile-keyboard .chat-body{min-height:0;height:calc(var(--mobile-height,100vh) - 150px)}
.work-sheet.mobile-sheet{width:100vw!important;max-width:100vw!important;height:var(--mobile-height,100vh)!important;top:0!important;bottom:auto!important;border:0;border-radius:0;padding-top:env(safe-area-inset-top);gap:10px}.work-sheet.mobile-sheet [data-slot=sheet-header]{padding:18px 20px 8px}.work-sheet.mobile-sheet [data-slot=sheet-title]{font-size:20px;padding-top:0;padding-right:34px}.work-sheet.mobile-sheet [data-slot=sheet-description]{font-size:12px}.work-sheet.mobile-sheet>.sheet-body{flex:1;min-height:0;padding:0 14px calc(24px + env(safe-area-inset-bottom));gap:13px}.work-sheet.mobile-sheet>button,.work-type-panel.mobile-sheet>button{width:44px;height:44px;top:8px;right:8px;display:grid;place-items:center;opacity:1;background:var(--ui-hover);border-radius:12px;z-index:5}.work-sheet.mobile-sheet .dental-order{padding:10px}.work-sheet.mobile-sheet input,.work-sheet.mobile-sheet select,.work-sheet.mobile-sheet textarea{font-size:16px;min-height:44px;min-width:0}.work-sheet.mobile-sheet .dental-fields{grid-template-columns:minmax(0,1fr)}.work-sheet.mobile-sheet .order-type-button,.work-sheet.mobile-sheet .sheet-take-button,.work-sheet.mobile-sheet .order-save{min-height:44px}.work-sheet.mobile-sheet .tooth-chart{min-width:544px}.work-sheet.mobile-sheet .tooth{min-height:62px}.work-sheet.mobile-sheet .jaw-select{min-height:36px}.work-sheet.mobile-sheet .selected-teeth>button{min-height:32px;font-size:12px;padding:5px 7px}.work-sheet.mobile-sheet .sheet-body pre{font-size:13px}
.work-sheet.mobile-picker-open .sheet-body{padding-bottom:calc(var(--mobile-height,100vh)*.55 + 24px)}.work-sheet.mobile-sheet .mobile-chart-active{position:sticky;top:0;z-index:3;background:var(--ui-panel);border-bottom:1px solid var(--ui-line);padding:5px 0;scroll-margin-top:0}.work-sheet.mobile-sheet .mobile-chart-active .tooth svg{height:40px}.work-sheet.mobile-sheet .mobile-chart-active .tooth{min-height:57px}
.work-type-panel.mobile-sheet{top:auto!important;bottom:0!important;right:0!important;width:100vw!important;max-width:100vw!important;height:calc(var(--mobile-height,100vh)*.52)!important;max-height:calc(var(--mobile-height,100vh)*.52)!important;border-radius:18px 18px 0 0;padding:16px 14px calc(16px + env(safe-area-inset-bottom))!important;gap:10px;overflow-y:auto!important}.work-type-panel.mobile-sheet [data-slot=sheet-header]{padding:0 42px 0 0;gap:4px}.work-type-panel.mobile-sheet [data-slot=sheet-title]{font-size:19px}.work-type-panel.mobile-sheet [data-slot=sheet-description]{display:none}.work-type-panel.mobile-sheet input,.work-type-panel.mobile-sheet select{font-size:16px;min-height:42px}.work-type-panel.mobile-sheet .type-scope{gap:4px;font-size:11px}.work-type-panel.mobile-sheet .work-type-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.work-type-panel.mobile-sheet .work-type-tile{min-height:62px;padding:9px;gap:7px}.work-type-panel.mobile-sheet .work-type-tile span{font-size:12px}.work-type-panel.mobile-sheet .work-type-catalog{min-height:130px;flex:1 0 130px}.work-type-panel.mobile-sheet .custom-work-type button{min-height:44px}.work-type-panel.mobile-sheet .type-group-scroll{max-height:160px;overflow:auto}.work-type-panel.mobile-sheet .type-group-row button{min-width:30px;min-height:36px}
@media(max-width:760px){
 body{overflow-x:hidden;-webkit-text-size-adjust:100%}input,textarea,select{font-size:16px}
 .lab-dialog,.calendar-edit-dialog{width:calc(100vw - 24px)!important;max-width:calc(100vw - 24px)!important;max-height:calc(var(--mobile-height,100vh) - 24px);overflow:auto;padding:20px!important;border-radius:16px!important}.lab-dialog [data-slot=dialog-title]{font-size:21px;padding-right:26px}.lab-dialog input,.lab-dialog select,.lab-dialog textarea{font-size:16px}.lab-dialog>button{min-width:40px;min-height:40px}
 .planner-context-menu{min-width:220px;font-size:14px}.planner-context-menu>[role=menuitem]{min-height:44px;padding:10px 12px}
 .earnings-locked{padding:20px 0}.earnings-password-card{padding:22px 18px}.earnings-view{padding:18px 8px}.earnings-password-card input,.earnings-account select,.earnings-period input{font-size:16px;min-height:44px}.earnings-period{gap:4px}.earnings-item>header{flex-wrap:wrap}.earnings-item header>b{margin-left:auto}.earnings-lines>div{gap:8px}.earnings-lines>div>span{min-width:0;overflow-wrap:anywhere}.earnings-lock-action button{min-height:44px}
 .calendar-drag-hint{bottom:90px;left:12px;max-width:calc(100vw - 24px)}.reminder-popup{position:fixed;top:110px;left:12px;right:12px;min-width:0;max-width:none;max-height:calc(var(--mobile-height,100vh) - 220px);overflow:auto}
}

/* Fit all 16 positions without changing familiar FDI order on narrow screens. */
.work-sheet.mobile-sheet .tooth-chart{min-width:0;width:100%}
.work-type-panel.mobile-sheet .type-group-row button{min-width:0}

/* Explicit placement resets the desktop two-row rules on phones. */
.lab-app.planner-mobile :is(.calendar-navigation,.day-focus-toolbar.day-navigation){display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;gap:8px;padding:12px 0;width:100%;min-width:0}
.lab-app.planner-mobile :is(.calendar-navigation-center,.day-navigation>.day-navigation-date){grid-column:2;grid-row:1;display:grid;justify-items:center;align-items:center;min-width:0;gap:5px}
.lab-app.planner-mobile :is(.calendar-week-prev,.calendar-day-prev){grid-column:1;grid-row:1}
.lab-app.planner-mobile :is(.calendar-week-next,.calendar-day-next){grid-column:3;grid-row:1}
.lab-app.planner-mobile .calendar-nav-button{justify-self:stretch;width:44px;min-width:44px;max-width:44px;min-height:44px;padding:8px;flex-shrink:0}
.lab-app.planner-mobile .calendar-nav-button svg{flex-shrink:0}
.lab-app.planner-mobile .calendar-week-range{font-size:13px;line-height:1.4;white-space:normal;overflow-wrap:break-word}
.lab-app.planner-mobile .calendar-nav-today{min-height:36px;padding:6px 12px}
.lab-app.planner-mobile .day-picker>div+div{border-left:0}
.lab-app.planner-mobile .day-picker .day-heading{height:76px;min-height:76px;padding:7px 1px;background:var(--ui-panel);color:var(--ui-text);border-color:var(--ui-line)}
.lab-app.planner-mobile .day-picker .day-heading strong{font-size:19px;color:var(--ui-text)}
.lab-app.planner-mobile .day-picker .day-heading>span{font-size:10px;color:var(--ui-muted)}
.lab-app.planner-mobile .day-picker .day-heading small{font-size:9px;color:var(--ui-muted)}
.lab-app.planner-mobile .day-picker :is(.day-selected,.day-today){background:var(--ui-today,var(--ui-hover))!important;border-color:var(--ui-accent)}
.lab-app.planner-mobile .mobile-calendar-mode button{background:var(--ui-panel);color:var(--ui-muted);border-color:var(--ui-line)}
.lab-app.planner-mobile .mobile-calendar-mode button[aria-pressed=true]{background:var(--ui-hover);color:var(--ui-accent-ink);border-color:var(--ui-accent)}
.lab-app.planner-mobile .day-column{border-color:var(--ui-line)!important}
