/* Scoped calendar rules outrank broad app button styling without changing other views. */
.shared-calendar{width:100%;position:relative;touch-action:none;--sc-hour:48px;color:#172d71}
.shared-calendar .sc-controls{display:flex;gap:6px;justify-content:center}.shared-calendar .sc-controls button{flex:1;min-width:0}
.shared-calendar .sc-range{text-align:center;margin:4px 0;font-weight:700}.shared-calendar .sc-feedback:empty{display:none}
.shared-calendar .sc-viewport{width:100%;border:1px solid #ccd4e2;border-radius:8px;overflow:auto;overscroll-behavior:contain;touch-action:none}
.shared-calendar .sc-grid{width:100%;min-width:0}.shared-calendar .sc-time-header,.shared-calendar .sc-time-body{display:grid;grid-template-columns:44px repeat(var(--sc-days),minmax(0,1fr))}
.shared-calendar .sc-time-header{height:32px;position:sticky;top:0;z-index:3;background:#eef2fa}.shared-calendar .sc-time-header>span{font-size:12px;text-align:center;padding-top:7px}
.shared-calendar .sc-time-body{height:calc(11 * var(--sc-hour));position:relative}.shared-calendar .sc-axis{position:relative;background:white;z-index:1}.shared-calendar .sc-axis>span{position:absolute;left:0;width:100%;text-align:center;font:12px/18px system-ui}
.shared-calendar .sc-column{position:relative;border-left:1px solid #dce2eb;font-size:var(--sc-hour);background:repeating-linear-gradient(to bottom,#dce2eb 0,#dce2eb 1px,transparent 1px,transparent calc(var(--sc-hour)/2 - 1px),#eef1f6 calc(var(--sc-hour)/2 - 1px),#eef1f6 calc(var(--sc-hour)/2),transparent calc(var(--sc-hour)/2),transparent var(--sc-hour))}
.shared-calendar .sc-job{position:absolute;box-sizing:border-box;overflow:hidden;container-type:size;border:1px solid white!important;border-radius:4px!important;margin:0!important;min-height:0!important;padding:2px!important;box-shadow:none!important;touch-action:none}
.shared-calendar .sc-job-text{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:2px;height:100%;width:100%;text-align:center;overflow:hidden}
.shared-calendar .sc-month{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));grid-auto-rows:minmax(24px,auto);gap:1px;background:#dce2eb}.shared-calendar .sc-month-day{background:white;min-width:0;min-height:80px;padding:2px}.shared-calendar .sc-month-job{position:relative;width:100%;height:46px;margin-top:2px!important}.shared-calendar .sc-day-label{background:#eef2fa;text-align:center;font-size:13px;padding:4px}
.shared-calendar .sc-untimed{margin:6px 0}.shared-calendar .sc-untimed .sc-job{position:relative;display:inline-block;width:160px;height:60px}.shared-calendar .sc-dragging{z-index:10;opacity:.75;outline:2px solid #172d71}
.shared-calendar[data-landscape=true] .sc-controls{position:relative;padding-right:0}.shared-calendar[data-landscape=true] .sc-untimed{position:absolute;right:0;top:36px;z-index:5;background:white;border:1px solid #ccd4e2;max-height:70vh;overflow:auto}.shared-calendar[data-landscape=true] .sc-untimed:not([open]){font-size:0;border:0}.shared-calendar[data-landscape=true] .sc-untimed:not([open]) summary::after{content:'⋯';font-size:18px}
.sc-popup{width:min(94vw,460px);box-sizing:border-box;border:1px solid #ccd4e2;border-radius:12px;text-align:center;padding:16px;max-height:90dvh;overflow:auto;color:#172d71;background:white}.sc-popup::backdrop{background:#10245166}.sc-popup h2{font-size:23px}.sc-popup p{font-size:16px}.sc-popup label{display:block;text-align:left;margin:8px 0}.sc-popup input{width:100%;box-sizing:border-box;min-height:44px;font-size:16px}.sc-actions{display:flex;gap:8px;margin-top:12px}.sc-actions button{flex:1}.sc-badge{display:inline-block;padding:6px 12px;border-radius:6px}.sc-primary{background:#172d71!important;color:white!important}.sc-dashboard-tasks:empty{display:none}.sc-task-card{width:100%;margin:6px 0;padding:12px;border:1px solid #ccd4e2;border-radius:10px;color:#172d71;background:white;font-size:16px}
@layer hub-action-colors,hub-button-typography;
@layer hub-action-colors {
html body .shared-calendar.shared-calendar.shared-calendar.shared-calendar.shared-calendar.shared-calendar button:not(.sc-job),html body .sc-popup.sc-popup button{font:700 14px/1.2 system-ui!important;min-height:36px!important;margin:0!important;padding:5px!important;text-align:center!important}
html body .shared-calendar.shared-calendar.shared-calendar.shared-calendar.shared-calendar.shared-calendar .sc-job,html body .shared-calendar.shared-calendar.shared-calendar.shared-calendar.shared-calendar.shared-calendar .sc-job *{color:white!important;-webkit-text-fill-color:white!important;font-size:14px!important;line-height:1.15!important;font-weight:700!important;overflow-wrap:normal!important;word-break:normal!important}
html body .shared-calendar.shared-calendar.shared-calendar.shared-calendar.shared-calendar.shared-calendar .sc-job strong,html body .shared-calendar.shared-calendar.shared-calendar.shared-calendar.shared-calendar.shared-calendar .sc-job-text>span{display:block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html body .shared-calendar.shared-calendar.shared-calendar.shared-calendar.shared-calendar.shared-calendar .sc-column>.sc-job{font-size:14px!important}
html body .shared-calendar.shared-calendar.shared-calendar.shared-calendar.shared-calendar.shared-calendar .sc-time-header button{font-size:clamp(9px,1.6vw,14px)!important;min-height:30px!important;padding:1px!important;border:0!important;border-radius:0!important;white-space:nowrap!important;background:transparent!important}
html body .shared-calendar.shared-calendar.shared-calendar.shared-calendar.shared-calendar.shared-calendar button[aria-pressed=true]{background:#172d71!important;color:white!important;-webkit-text-fill-color:white!important}
}

html body main #business-dashboard:has(#biz-live-calendar.shared-calendar) :is(#biz-back,.business-page-heading,[data-biz-view="calendar"]>h2){display:none!important}
html body main #biz-live-calendar.shared-calendar{display:block!important}
.shared-calendar[data-landscape=true] .sc-month{height:100%;grid-auto-rows:minmax(0,1fr);grid-template-rows:24px}
.shared-calendar[data-landscape=true] .sc-month-day{min-height:0;overflow:auto}
.shared-calendar[data-landscape=true] .sc-month-day .sc-date{float:left;min-height:20px!important;padding:0 2px!important}
.shared-calendar[data-landscape=true] .sc-month-job{height:40px}

html body main #business-dashboard.active:has(#biz-live-calendar.shared-calendar){max-width:100%;width:100%}
@media(orientation:landscape) and (max-height:600px){
html body:has(#biz-live-calendar.shared-calendar){overflow:hidden!important;height:100dvh}
html body:has(#biz-live-calendar.shared-calendar) main{height:100dvh!important;min-height:0!important;padding:4px!important;overflow:hidden!important}
html body main #business-dashboard.active:has(#biz-live-calendar.shared-calendar){padding:0 4px!important}
html body main #business-dashboard:has(#biz-live-calendar.shared-calendar) .biz-box:has(#biz-live-calendar){margin-top:0!important;padding:4px!important}
}
@layer hub-action-colors{
html body .shared-calendar.shared-calendar.shared-calendar.shared-calendar.shared-calendar.shared-calendar .sc-month-day button.sc-date{display:block!important;float:none!important;height:16px!important;min-height:16px!important;line-height:16px!important;padding:0!important;border:0!important;box-shadow:none!important;background:transparent!important}
}

html body main #business-dashboard.active:has(#biz-live-calendar.shared-calendar){padding:4px!important}
html body main #biz-live-calendar.shared-calendar .sc-time-header>button{overflow:hidden}
html body main #biz-live-calendar.shared-calendar .sc-viewport{box-sizing:border-box}

.shared-calendar .sc-viewport{flex:none!important}
@media(orientation:landscape) and (max-height:600px){body:has(#workspace.shared-calendar) .technician-header{display:none!important}}
#pm-dashboard:has(.shared-calendar)>.pm-heading{display:none!important}

@layer hub-action-colors{
html body .shared-calendar.shared-calendar.shared-calendar.shared-calendar.shared-calendar.shared-calendar .sc-controls button{border:1px solid #ccd4e2!important;border-radius:8px!important;background:white!important;color:#172d71!important;-webkit-text-fill-color:#172d71!important}
html body .shared-calendar.shared-calendar.shared-calendar.shared-calendar.shared-calendar.shared-calendar .sc-controls button:is([aria-pressed=true],.sc-primary){background:#172d71!important;color:white!important;-webkit-text-fill-color:white!important}
}

.sc-popup label,.sc-popup input{font-size:16px!important}

/* Week/Month retain one physical orientation while the viewport rotates. */
.shared-calendar.sc-landscape-panel{position:fixed!important;left:var(--sc-panel-left)!important;top:var(--sc-panel-top)!important;width:var(--sc-panel-width)!important;height:var(--sc-panel-height)!important;max-width:none!important;box-sizing:border-box;padding:6px!important;transform-origin:top left;transform:rotate(var(--sc-panel-rotation));transition:none!important;z-index:900;background:white}
.shared-calendar[data-landscape=true] .sc-mode{display:none!important}
.shared-calendar .sc-sideways-back{display:none!important}

.sc-status-row{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%}.sc-status-row .sc-badge{margin:0}.sc-zip{white-space:nowrap}
.sc-tasks>button{width:100%;margin-top:8px}.sc-tasks>input{margin-bottom:8px}

/* Calendar-only corrections; retain card status colors and existing readable job text. */
.shared-calendar .sc-job,.shared-calendar .sc-job *{user-select:none!important;-webkit-user-select:none!important;-webkit-touch-callout:none;touch-action:none!important}
html body .shared-calendar .sc-axis>span{font:11px/16px system-ui!important}
.shared-calendar .sc-column::before{content:'';position:absolute;left:0;right:0;top:var(--sc-hour);height:1px;background:#f0f3f7;box-shadow:0 calc(2 * var(--sc-hour)) #f0f3f7,0 calc(4 * var(--sc-hour)) #f0f3f7,0 calc(6 * var(--sc-hour)) #f0f3f7;pointer-events:none}
html body .shared-calendar .sc-untimed summary{font-size:18px!important;line-height:24px!important;list-style:none!important;padding:0 6px!important}
.shared-calendar .sc-untimed summary::after{content:none!important}
.sc-popup.sc-covered{visibility:hidden;pointer-events:none}
html body .sc-popup .sc-status-row>select{width:auto!important;max-width:75%;min-height:44px;margin:0;font:inherit;flex:0 1 auto}

/* Fixed calendar header geometry keeps the first hour clear of its labels. */
html body .shared-calendar .sc-time-header{box-sizing:border-box!important;height:32px!important;min-height:32px!important;max-height:32px!important;align-items:stretch!important;margin:0!important;padding:0!important}
html body .shared-calendar .sc-time-header>*{box-sizing:border-box!important;height:32px!important;min-height:0!important;max-height:32px!important;margin:0!important;padding:2px!important;line-height:28px!important;overflow:hidden!important}
.shared-calendar[data-landscape=true] .sc-time-header{position:relative!important;top:auto!important}
html body .shared-calendar .sc-time-body{margin:0!important;flex-shrink:0!important}
html body .shared-calendar .sc-job-text{display:flex!important;flex-direction:column!important;justify-content:center!important;align-items:center!important;gap:2px!important;width:100%!important;height:100%!important;margin:0!important;padding:0!important}
html body .shared-calendar .sc-job-text>*{width:100%;text-align:center!important;margin:0!important;padding:0!important;font-size:14px!important;line-height:1.15!important;font-weight:700!important}
.shared-calendar[data-view=day] .sc-mode{display:block!important}

/* Tap the existing appointment date to use the native date picker. */
html body .sc-popup .sc-appointment-date{position:relative;display:inline-block!important;margin:0!important;font:inherit!important;cursor:pointer}
html body .sc-popup .sc-appointment-date input{position:absolute;inset:0;opacity:0;width:100%!important;height:100%!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important;cursor:pointer}
.sc-popup .sc-appointment-date:focus-within{outline:2px solid #172d71;outline-offset:3px;border-radius:3px}
.sc-popup .sc-date-feedback:not([hidden]){display:block;margin-top:4px;font-size:14px;color:#172d71}

/* Shared popup order: customer, ZIP, status, editable appointment, actions. */
html body .sc-popup{padding:16px!important;text-align:center}
html body .sc-popup>h2{margin:0 0 8px!important}
html body .sc-popup>.sc-zip{display:block;margin:0 0 12px}
html body .sc-popup .sc-status-row{display:flex!important;justify-content:center!important;width:100%;margin:8px 0}
html body .sc-popup .sc-status-row>.sc-badge{width:85%!important;max-width:none!important;min-height:44px;box-sizing:border-box;text-align:center}
html body .sc-popup .sc-appointment-line{text-align:center;margin:8px 0}
html body .sc-popup .sc-editable-appointment{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:6px;font-size:16px}
html body .sc-popup .sc-editable-appointment>input[type=time]{width:120px;min-height:44px;font:inherit;text-align:center}
html body .sc-popup .sc-actions{margin-top:12px}

.shared-calendar .sc-untimed-row{display:grid;grid-template-columns:44px repeat(var(--sc-days),minmax(0,1fr));align-items:start}
.shared-calendar .sc-untimed-row>span{font-size:12px;text-align:center}

.sc-popup .sc-status-row:has(.sc-start){display:flex;align-items:stretch}
.sc-popup .sc-status-row .sc-start{flex:0 0 44px;background:#b42329;color:white;font-weight:750;border-radius:8px;min-height:44px}
.sc-popup .sc-start[hidden]{display:none}
