/* The mobile shell uses existing brand colors, controls, and navigation. */
@media(max-width:680px){
 body[data-screen=workspace]{padding-bottom:calc(72px + env(safe-area-inset-bottom))}
 body[data-screen=workspace]>aside{display:flex;flex-flow:row nowrap;align-items:center;gap:8px;padding:8px 12px;min-height:64px;height:auto;position:relative;overflow:visible}
 body[data-screen=workspace]>aside>.brand{flex:1;min-width:0;margin:0;padding:0}
 body[data-screen=workspace]>aside .app-brand-logo{width:112px;max-width:100%;height:auto}
 body[data-screen=workspace]>aside>.account-toolbar{display:flex;flex-flow:row nowrap;gap:8px;margin:0;flex:none;color:var(--text)}
 body[data-screen=workspace]>aside>:is(.sidebar-tagline,.account-exit,.sidebar-bottom){display:none!important}
 body[data-screen=workspace]>#mobile-account-controls{display:none!important}
 body[data-screen=workspace] #workspace-search-button{padding:8px 10px;min-width:0;min-height:44px;font-size:14px}
 #mobile-account-menu>summary{list-style:none;display:flex;align-items:center;justify-content:center;min-height:44px;padding:8px 10px;border-radius:8px;background:var(--surface);color:var(--text);cursor:pointer;font-size:14px}
 #mobile-account-menu>summary::-webkit-details-marker{display:none}
 #mobile-account-menu[open]{position:absolute;right:12px;top:8px;z-index:40;width:min(290px,calc(100vw - 24px));padding:8px;background:var(--surface);color:var(--text);border:1px solid var(--input-border);border-radius:12px;box-shadow:0 8px 24px #0003}
 #mobile-account-menu[open]>summary{width:max-content;margin-left:auto}
 #mobile-account-menu[open]>:not(summary){display:block;margin:12px 0;max-width:100%;overflow-wrap:anywhere}
 #mobile-account-menu .sidebar-utilities{display:flex;background:#17212d;padding:4px;border-radius:8px}
 #mobile-account-menu .sidebar-utilities button{flex:1;min-height:44px;color:#fff}
 #mobile-account-menu .profile-link{display:flex;min-height:44px;width:100%;align-items:center;gap:8px}
 body[data-screen=workspace] #nav{position:fixed;inset:auto 0 0;z-index:30;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;max-width:100vw;margin:0;padding:8px max(8px,env(safe-area-inset-right,0px)) calc(8px + env(safe-area-inset-bottom,0px)) max(8px,env(safe-area-inset-left,0px));background:#17212d;border-top:1px solid #ffffff24;overflow:visible}
 #nav>.nav-section-label{display:none}
 body[data-screen=workspace] #nav>button,body[data-screen=workspace] #nav>.secondary-navigation>.more-toggle{display:flex;align-items:center;justify-content:center;min-width:0;width:100%;height:48px;min-height:48px;padding:8px 2px;margin:0;font-size:12px;white-space:nowrap}
 #nav .nav-icon{display:none}
 body[data-screen=workspace] #nav>.secondary-navigation{position:static;min-width:0!important;width:auto!important;margin:0}
 body[data-screen=workspace] #nav .secondary-nav-items{position:absolute;inset:auto max(8px,env(safe-area-inset-right,0px)) calc(100% + 8px) max(8px,env(safe-area-inset-left,0px));max-height:60dvh;overflow:auto;margin:0;padding:12px;background:#17212d;border:1px solid #ffffff24;border-radius:12px;box-shadow:0 -4px 20px #0003}
 #nav .secondary-nav-items[hidden]{display:none!important}
 #nav .secondary-nav-items button{min-height:44px;width:100%;text-align:left}
 body[data-screen=workspace] #mobile-account-menu .profile-link{width:100%;height:auto;justify-content:flex-start}
 body[data-screen=workspace] #mobile-account-menu .profile-link>div{display:block}
 body[data-screen=workspace] main{padding-top:16px}
 body[data-view=pipeline] #pipeline-controls .ux-bookings-toolbar{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
 body[data-view=pipeline] #pipeline-controls .ux-booking-search{width:100%;margin:0}
 body[data-view=pipeline] #pipeline-controls .ux-view-switch{margin:0;justify-content:flex-start}
 body[data-view=pipeline] .mobile-booking-filters{margin:12px 0 0}
 body[data-view=pipeline] .mobile-booking-filters>summary{min-height:44px;padding:12px}
 body[data-view=pipeline] .mobile-booking-filters[open]>*:not(summary){margin:12px}
 body[data-view=pipeline] #stats{margin:20px 0 0}
 body[data-view=calendar] main>header>.actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;gap:12px}
 body[data-view=calendar] main>header>.actions>button{white-space:normal;word-break:normal;overflow-wrap:normal;padding:12px 8px;min-width:0}
 body[data-view=calendar] main>header>.actions>button.primary{grid-column:1/-1;grid-row:1;min-height:48px}
 body[data-screen=workspace] #toast{bottom:calc(84px + env(safe-area-inset-bottom))}
}

.day-availability-summary{margin:12px 0}.day-availability-summary>summary{padding:12px;min-height:44px}.day-availability-summary .availability-status{margin:8px 0 0}
@media(max-width:680px){
 body[data-screen=workspace] #nav{grid-template-columns:.85fr 1fr 1.25fr 1.2fr .8fr}
 body[data-screen=workspace] #nav>button .nav-label{font-size:14px;line-height:1.2;letter-spacing:0;white-space:nowrap}
 body[data-screen=workspace] #nav>.secondary-navigation>.more-toggle{font-size:14px;padding:8px 2px;letter-spacing:0}
}
@media(max-width:680px){
 body[data-screen=workspace] #nav>button.active{background:#a8441d;color:#fff}
}

.demo-data-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.demo-data-options section{min-width:0}.demo-data-options h3{margin-top:0}.demo-data-options button{min-height:44px;white-space:normal}@media(max-width:680px){.demo-data-options{grid-template-columns:1fr}.demo-data-options section+section{border-top:1px solid var(--input-border);padding-top:16px}}

/* Mobile controls must not inherit the sidebar's pale text on light surfaces. */
@media(max-width:680px){
 body[data-screen=workspace]>aside #workspace-search-button,
 body[data-screen=workspace]>aside #mobile-account-menu>summary,
 body[data-screen=workspace]>aside #mobile-account-menu [data-logout]{background:var(--surface);color:var(--ink);border-color:var(--border)}
 body[data-screen=workspace]>aside #mobile-account-menu[open]{background:var(--surface);color:var(--ink)}
 body[data-screen=workspace]>aside #mobile-account-menu #active-account-label{color:var(--ink)}
 body[data-screen=workspace]>aside #mobile-account-menu #save-state{color:var(--muted)}
 html body[data-screen=workspace] aside #nav>button.active{background:#a8441d;color:#fff!important}
 html body[data-screen=workspace] aside #nav>button.active .nav-label{color:inherit}
 .demo-example-cleanup{margin:16px 0 24px;padding:16px;border:1px solid var(--border);border-radius:12px;background:var(--soft)}
 .demo-example-cleanup h3{margin-top:0}
 .demo-example-cleanup .workspace-tool-row{display:flex;gap:12px;flex-wrap:wrap}
}

/* Account identities stay legible; the profile action bar leaves navigation reachable. */
@media(max-width:680px){
 body[data-screen=workspace]>aside #mobile-account-menu .profile-link{background:var(--soft)!important;color:var(--ink);padding:10px 12px;min-height:54px;text-align:left;border:1px solid var(--border)}
 body[data-screen=workspace]>aside #mobile-account-menu #artist-name{color:var(--ink)}
 body[data-screen=workspace]>aside #mobile-account-menu .profile-link small{display:block;color:var(--muted);font-size:12px;line-height:1.4;margin-top:3px}
 body[data-screen=workspace][data-view=profile] .profile-editor-toolbar{bottom:calc(76px + env(safe-area-inset-bottom));z-index:20}
}

/* The visual viewport can shrink independently of dvh when a keyboard opens. */
@media(max-width:680px){
 dialog.mobile-form-viewport:has(.ux-form-dialog){position:fixed;inset:auto;top:calc(var(--form-visible-top) + 8px);left:8px;right:8px;margin:0;width:calc(100vw - 16px);max-width:calc(100vw - 16px);height:calc(var(--form-visible-height) - 16px);max-height:calc(var(--form-visible-height) - 16px)}
 dialog.mobile-form-viewport .ux-form-scroll{overscroll-behavior-y:contain}
 dialog.mobile-form-viewport[data-mobile-compact=true] .ux-form-dialog{padding-top:8px}
 dialog.mobile-form-viewport[data-mobile-compact=true] .ux-form-dialog>.modalhead{margin-bottom:6px}
 dialog.mobile-form-viewport[data-mobile-compact=true] .ux-form-dialog>.privacy,
 dialog.mobile-form-viewport[data-mobile-compact=true] .ux-form-dialog>.booking-form-intro{display:none}
 dialog.mobile-form-viewport[data-mobile-compact=true] .ux-dialog-form>.form-actions{padding-top:8px;padding-bottom:8px}
}

/* Money actions keep readable labels when the export choices expand. */
@media(max-width:680px){
 body[data-view=income] #content .panel>.toolbar .actions{display:flex;flex-wrap:wrap;align-items:flex-start;width:100%;gap:12px}
 body[data-view=income] #content .ux-record-payment{flex:0 0 auto;min-height:44px;white-space:nowrap;word-break:normal;overflow-wrap:normal}
 body[data-view=income] #content .ux-export-menu{max-width:100%}
 body[data-view=income] #content .ux-export-menu[open]{flex:1 0 100%;width:100%}
 body[data-view=income] #content .ux-export-menu button{min-height:44px;max-width:100%;white-space:normal;word-break:normal}
}

/* While typing, the profile save bar follows the keyboard's visible edge. */
@media(max-width:680px){
 body[data-view=profile].profile-keyboard-open .profile-editor-toolbar{position:fixed;top:auto;bottom:calc(100% - var(--profile-visible-bottom) + 8px);left:12px;right:12px;width:auto;margin:0;padding:8px 12px;gap:0;z-index:25}
 body[data-view=profile].profile-keyboard-open .profile-editor-toolbar>p:not([data-error=true]){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 body[data-view=profile].profile-keyboard-open .profile-editor-toolbar>p[data-error=true]{flex:none;margin:0 0 8px}
 body[data-view=profile].profile-keyboard-open .profile-editor-toolbar>div{display:flex;width:100%}
 body[data-view=profile].profile-keyboard-open .profile-editor-toolbar button{width:100%;min-height:44px}
}

@media(max-width:680px){
 #member-form>.form-actions:has(.danger){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 #member-form>.form-actions:has(.danger) button{padding:10px 8px;font-size:13px;min-width:0;min-height:44px}
}

.tour-stop-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:10px 0}
@media(max-width:680px){
 body[data-view=tour] #content .panel>.toolbar{flex-wrap:wrap}
 body[data-view=tour] .tour-stop-actions button,body[data-view=tour] .gap button{min-height:44px;white-space:normal;word-break:normal;overflow-wrap:anywhere}
 body[data-view=tour] #content .panel>.toolbar>button{min-height:44px;white-space:normal}
}

@media(max-width:680px){
 #modal .tour-gap-venue{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-items:start}
 #modal .tour-gap-venue>.row-main{grid-column:1/-1;min-width:0}
 #modal .tour-gap-venue h3{overflow-wrap:anywhere;word-break:normal;margin-bottom:8px}
 #modal .tour-gap-venue>button{width:100%;min-width:0;min-height:44px;white-space:normal;word-break:normal;padding:10px 8px}
}

/* Date-sheet actions and rows stay readable with multiple mobile choices. */
@media(max-width:680px){
 #modal-body .toolbar:has(.calendar-day-actions){display:block}
 #modal-body .calendar-day-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;gap:10px}
 #modal-body .calendar-day-actions>button{min-width:0;width:100%;min-height:44px;white-space:normal;word-break:normal;overflow-wrap:normal}
 #modal-body .calendar-day-item{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 #modal-body .calendar-day-item .row-main{grid-column:1/-1;min-width:0}
 #modal-body .calendar-day-item>button{width:100%;min-width:0;min-height:44px;white-space:normal}
}
@media(max-width:680px){
 #modal-body .recurring-preview-table{max-height:none;overflow:visible}
 #modal-body .recurring-preview-table table{min-width:0;table-layout:fixed;width:100%}
 #modal-body .recurring-preview-table th,#modal-body .recurring-preview-table td{padding:9px 6px;overflow-wrap:anywhere;vertical-align:top}
 #modal-body .recurring-preview-table th:first-child{width:32%}
 #modal-body .recurring-preview-table th:nth-child(2){width:9%}
 #modal-body .recurring-preview-table .check{white-space:normal;align-items:flex-start}
 #modal-body .recurring-conflict{font-size:14px;line-height:1.45}
}
@media(max-width:680px){
 #recurring-preview-form>.form-actions{display:grid;grid-template-columns:minmax(58px,1fr) minmax(0,3fr);align-items:stretch}
 #recurring-preview-form>.form-actions button{min-width:0;padding:10px 8px;font-size:13px;overflow-wrap:normal}
 dialog[data-mobile-compact=true] .recurring-preview-summary{display:block;margin:0 0 8px;font-size:14px}
 dialog[data-mobile-compact=true] .recurring-preview-summary>span{display:none}
}
/* The warning fill stays light in both themes; dates must stay readable too. */
#modal-body .recurring-preview-table tr.has-conflict{color:#59451d}

.booking-visible-scope{font-weight:600;margin:8px 0 14px}.venue-compact .venue-directory-row{padding:12px!important;gap:8px!important}.venue-compact .venue-directory-contact,.venue-compact .venue-directory-summary,.venue-compact .venue-actions{display:none!important}.venue-compact .venue-address-line{margin:4px 0}.mobile-preview-points{display:none}@media(max-width:680px){.sales-hero-screen>a{display:none}.mobile-preview-points{display:block;padding:16px 28px;margin:0;line-height:1.8}.sales-hero-screen figcaption{display:none}}

.directory-filter-controls{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin:16px 0}.directory-filter-controls input,.directory-filter-controls select{min-height:44px;width:100%}.venue-compact .venue-directory-row[hidden]{display:none!important}

.directory-advanced{grid-column:1/-1}.directory-advanced summary{min-height:44px;padding:12px;border:1px solid var(--line,#ccc);border-radius:8px;cursor:pointer}.directory-advanced[open]{display:grid;gap:12px}.directory-filter-controls>label:first-child{grid-column:1/-1}
