/* Local candidate: one diagram and one shared detail panel, with existing editor controls. */
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #commonDentalPanel{max-width:none}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #common-treatment-pane{min-width:0}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #commonDentalPanel #common-treatment-pane #planAddDock{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:12px;padding:14px;margin:0;min-width:0;align-content:start;background:#fff;border:1px solid #dce6e6;border-radius:12px}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #planAddDock>*{grid-column:1/-1!important;min-width:0}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #planAddDock.no-treatment>:not(#treatmentDetailHeader):not(#message):not(#planActionNotice){display:none!important}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #planAddDock :is(.plan-add-info,.planner-dock-visit,#pendingSelectionDetails){display:none!important}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #planAddDock :is(#commonQuote,#secondQuote,#restorationQuote){padding:0;background:transparent;border:0;gap:10px}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #planAddDock :is(#commonQuote,#secondQuote,#restorationQuote)>h3{display:none}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace :is(.common-quote-fields,.second-quote-fields,.restoration-quote-fields){grid-template-columns:minmax(0,1fr)}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace :is(label:has(>#commonQuoteVisit),label:has(>#secondQuoteVisit),label:has(>#restorationQuoteVisit),.dock-visit-tools){display:none!important}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #planAddDock .plan-add-actions{display:grid!important;grid-template-columns:minmax(0,1fr);position:sticky;bottom:0;padding:12px 0 0;margin:0;background:#fff;border-top:1px solid #e0e7eb;z-index:2}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #planAddDock #add{width:100%;min-width:0;white-space:normal}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #simpleAddSummary{font-size:12px;line-height:1.4}
body.desktop-treatment-workspace .treatment-detail-header{display:grid;gap:8px}
body.desktop-treatment-workspace .treatment-detail-header h2{margin:0;font-size:17px;color:#143b50}
body.desktop-treatment-workspace .treatment-detail-name{font-size:14px;line-height:1.4;color:#006d68;overflow-wrap:anywhere}
body.desktop-treatment-workspace .treatment-detail-region{font-size:12px;line-height:1.45;margin:0;color:#52697e;overflow-wrap:anywhere}
body.desktop-treatment-workspace .workspace-visit-field{border:0;border-top:1px solid #e1e8ed;padding:10px 0 0;margin:4px 0 0;min-width:0;display:flex;align-items:center;gap:7px;flex-wrap:wrap}
body.desktop-treatment-workspace .workspace-visit-field legend{font-size:12px;font-weight:650;padding:0 5px 0 0;color:#36516a}
body.desktop-treatment-workspace .workspace-visit-choices{display:flex;flex-wrap:wrap;gap:6px;width:100%}
body.desktop-treatment-workspace .workspace-visit-choices label{position:relative;display:flex;flex:1 1 85px;min-width:0;cursor:pointer}
body.desktop-treatment-workspace .workspace-visit-choices input{position:absolute;width:1px;height:1px;opacity:0}
body.desktop-treatment-workspace .workspace-visit-choices span{display:flex;align-items:center;justify-content:center;min-height:38px;padding:7px 9px;width:100%;box-sizing:border-box;border:1px solid #cbd9df;border-radius:7px;font-size:12px;line-height:1.35;background:#fff;color:#36516a;text-align:center;overflow-wrap:anywhere}
body.desktop-treatment-workspace .workspace-visit-choices input:checked+span{background:#e3f3ef;border-color:#008d83;color:#00645e;font-weight:700;box-shadow:inset 0 0 0 1px #008d83}
body.desktop-treatment-workspace .workspace-visit-choices input:focus-visible+span{outline:3px solid #0c6194;outline-offset:2px}
body.desktop-treatment-workspace .workspace-visit-field .workspace-add-visit{min-height:36px!important;padding:6px 9px!important;font-size:12px}
body.desktop-treatment-workspace .workspace-visit-notice:empty{display:none}
body.desktop-treatment-workspace .workspace-visit-notice{margin:0;color:#00645e;font-size:12px}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #common-treatment-pane>.simple-selection-tools{display:flex!important;flex-wrap:wrap;align-items:center;gap:8px;margin:0;padding:10px;border-radius:10px}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #commonDentalPanel .simple-selection-tools #quickTreatmentShortcuts{flex:1 1 300px;max-width:100%;min-width:0;display:block!important;margin:0}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #commonDentalPanel .simple-selection-tools #quickTreatmentShortcuts>small{display:none}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #commonDentalPanel .simple-selection-tools .quick-treatment-buttons{display:flex;flex-wrap:wrap;gap:5px;overflow:visible;max-height:none}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #commonDentalPanel .simple-selection-tools [data-quick-treatment]{min-height:36px;padding:6px 8px;font-size:11px;white-space:normal;flex:0 1 auto}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace .simple-selection-tools>.planner-change-treatment{min-height:36px;max-width:none;padding:6px 10px;font-size:12px;margin:0}
body.desktop-treatment-workspace .workspace-visit-tools{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding-top:7px;border-top:1px solid #e0e8eb;font-size:12px;color:#52697e}
body.desktop-treatment-workspace .workspace-visit-tools button{min-height:34px;padding:5px 9px;font-size:12px}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #common-treatment-pane>#pendingTreatmentPicker{margin:0;padding:12px;min-width:0}
@media(min-width:1101px){
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace .rail{width:184px;padding:18px 10px}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace :is(header,main){margin-left:184px;padding-left:20px;padding-right:20px;max-width:none}
 body.desktop-treatment-workspace .rail-heading{display:none}
 body.desktop-treatment-workspace .rail .logo{padding:8px 9px;margin-bottom:12px}
 body.desktop-treatment-workspace .rail .logo img{max-width:148px}
 body.desktop-treatment-workspace .rail-actions button{padding:8px;gap:8px;font-size:12px;min-height:40px}
 body.desktop-treatment-workspace .rail :is(.rail-preferences,.rail-operator){font-size:12px}
}
@media(min-width:1280px){
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #common-treatment-pane{display:grid;grid-template-columns:minmax(0,1fr) 320px;grid-template-rows:auto auto auto;gap:12px 16px;align-items:start}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #common-treatment-pane>.chart{grid-column:1;grid-row:1;margin:0;padding:12px}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #common-treatment-pane>.simple-selection-tools{grid-column:1;grid-row:2}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #common-treatment-pane>#pendingTreatmentPicker{grid-column:1;grid-row:3}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #commonDentalPanel #common-treatment-pane #planAddDock{grid-column:2;grid-row:1/4;position:sticky;top:78px;max-height:var(--detail-available-height,calc(100dvh - 330px));overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scroll-margin-top:78px}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #common-treatment-pane>.chart .simple-chart-arches,body.compact-workspace.three-step-workspace.desktop-treatment-workspace #common-treatment-pane>.chart :is(#upperTeeth,#lowerTeeth){min-width:640px}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #common-treatment-pane>.chart :is(#upperTeeth,#lowerTeeth){grid-template-columns:repeat(16,minmax(40px,1fr))!important}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #common-treatment-pane>.chart .tooth{min-width:40px}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #common-treatment-pane>.chart{display:block!important}
}
@media(max-width:1279px){body.compact-workspace.three-step-workspace.desktop-treatment-workspace #common-treatment-pane{display:grid;gap:10px}body.compact-workspace.three-step-workspace.desktop-treatment-workspace #planAddDock{max-height:none;position:static}}

body.compact-workspace.three-step-workspace.desktop-treatment-workspace #commonDentalPanel .simple-selection-tools #quickTreatmentShortcuts{display:block!important}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #commonDentalPanel .simple-selection-tools #quickTreatmentShortcuts .quick-treatment-buttons{display:flex!important;flex-wrap:wrap;overflow:visible;max-height:none;gap:5px}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #commonDentalPanel .simple-selection-tools #quickTreatmentShortcuts>small{display:none!important}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #commonDentalPanel .simple-selection-tools .treatment-shortcut{min-height:34px;max-width:none;padding:5px 7px;font-size:11px}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #commonDentalPanel .simple-selection-tools .shortcut-icon{width:18px;height:22px}

@media(min-width:1280px){
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #simplePlanGuide{margin:12px 0}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #common-treatment-pane>.chart .section-title{min-height:0;align-items:start}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #common-treatment-pane>.chart .tooth{min-height:96px}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #common-treatment-pane>.chart .arch-head{min-height:36px}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace .chart .treatment-legend{gap:5px 8px;font-size:10px}
}

body.compact-workspace.three-step-workspace.desktop-treatment-workspace #commonDentalPanel .simple-selection-tools .workspace-visit-tools button{min-height:34px;padding:5px 9px;font-size:12px}
@media(min-width:1280px){
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #common-treatment-pane>.chart .section-title{gap:8px;margin-bottom:4px}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #common-treatment-pane>.chart .arch-head button{min-height:32px;padding:4px 8px;font-size:12px}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #common-treatment-pane>.chart :is(#upperTeeth,#lowerTeeth){min-height:0;gap:0}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #common-treatment-pane>.chart .tooth{grid-template-rows:60px 16px auto;min-height:88px;padding:2px 1px}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #common-treatment-pane>.chart .dental-tooth{height:60px}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #common-treatment-pane>.chart .chart-footer{margin-top:4px}
}

@media(min-width:1280px){
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #common-treatment-pane>.chart .section-title h2{font-size:17px;line-height:1.25;margin:0 0 3px!important}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #common-treatment-pane>.chart .section-title p{line-height:1.4}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #common-treatment-pane>.chart .tooth-mode{display:none}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #common-treatment-pane>.chart :is(#upperTeeth,#lowerTeeth){padding:2px 2px 4px}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #commonDentalPanel .simple-selection-tools .treatment-shortcut{min-height:34px!important;padding:5px 7px!important;line-height:1.2}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #commonDentalPanel .simple-selection-tools>.planner-change-treatment{min-height:34px!important;padding:5px 9px!important}
}

/* A normal footer outside the only scrolling body avoids WebKit sticky hit-test drift. */
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #commonDentalPanel #common-treatment-pane #planAddDock{display:flex!important;flex-direction:column;gap:10px;overflow:hidden}
body.desktop-treatment-workspace #planAddDock>.treatment-detail-header{flex:none}
body.desktop-treatment-workspace #planAddDock>.treatment-detail-scroll{min-height:0;min-width:0;overflow-y:auto;overscroll-behavior:contain;flex:1 1 auto;display:grid;gap:10px;scrollbar-width:thin}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #commonDentalPanel #planAddDock>.plan-add-actions{position:static!important;inset:auto;z-index:auto;flex:none;padding-top:10px;gap:0}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #planAddDock.no-treatment>.treatment-detail-scroll{display:none!important}
body.desktop-treatment-workspace #planAddDock :is(#simpleAddSummary,#commonQuoteRegion,#secondQuoteRegion){display:none!important}
body.desktop-treatment-workspace .workspace-visit-tools{display:none!important}
body.desktop-treatment-workspace .workspace-favorite-extra{display:none!important}
body.desktop-treatment-workspace .workspace-more-favorites[hidden]{display:none!important}
body.desktop-treatment-workspace .workspace-more-favorites{min-height:34px;padding:5px 8px;font-size:11px}
body.desktop-treatment-workspace #planAddDock>[role=status]:empty,body.desktop-treatment-workspace #planAddDock>#message:empty{display:none}
@media(min-width:1280px){
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #simpleStep2>.simple-patient-bar{margin:8px 0;padding:7px 10px;min-height:44px;gap:8px}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #simpleStep2 #simpleCondition{margin:6px 0}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #simpleStep2 #simplePackagePicker{margin:6px 0}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #simpleStep2 :is(#simpleCondition,#simplePackagePicker)>summary{padding:8px 12px;min-height:34px}
 body.desktop-treatment-workspace .treatment-detail-header{gap:6px}
 body.desktop-treatment-workspace .workspace-visit-field{padding-top:6px;margin-top:0}
}
@media(max-width:1279px){body.desktop-treatment-workspace #planAddDock>.treatment-detail-scroll{overflow:visible;flex:none}}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #commonDentalPanel #common-treatment-pane #planAddDock{align-items:stretch!important}
body.desktop-treatment-workspace #planAddDock>.treatment-detail-scroll{grid-template-columns:minmax(0,1fr);width:100%;box-sizing:border-box}
body.desktop-treatment-workspace #planAddDock>.treatment-detail-scroll>*{grid-column:1/-1!important;min-width:0}

/* Local review: one context card, native disclosure controls, no duplicate state. */
body.desktop-treatment-workspace #compactPlanContext{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 10px;padding:8px 12px;margin:8px 0 10px;background:#f4fbfa;border:1px solid #bfdcd8;border-left:3px solid #008c87;border-radius:12px;min-width:0}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #compactPlanContext>.simple-patient-bar{grid-column:1/-1;grid-row:1;margin:0;padding:0 0 6px;min-height:38px;gap:8px;border:0;border-bottom:1px solid #dce9e7;border-radius:0;background:transparent}
body.desktop-treatment-workspace #compactPlanContext :is(#quickPackages,#simplePackagePicker,#simpleCondition){display:contents!important}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #compactPlanContext :is(#simplePackagePicker,#simpleCondition)>summary{grid-row:2;min-height:34px;padding:5px 9px!important;margin:0!important;border:1px solid #d3e2e0;border-radius:7px;background:#fff;display:flex!important;align-items:center;font-size:13px;line-height:1.4;cursor:pointer;gap:6px;white-space:normal}
body.desktop-treatment-workspace #compactPlanContext #simplePackagePicker>summary{grid-column:1}
body.desktop-treatment-workspace #compactPlanContext #simpleCondition>summary{grid-column:2}
body.desktop-treatment-workspace #compactPlanContext summary::marker{content:''}
body.desktop-treatment-workspace #compactPlanContext summary::after{content:'⌄';margin-left:auto;font-size:16px;position:static;transform:none}
body.desktop-treatment-workspace #compactPlanContext details[open]>summary::after{content:'⌃'}
body.desktop-treatment-workspace #compactPlanContext :is(.compact-package-content,#common-condition-pane){grid-column:1/-1;grid-row:3;padding:12px!important;min-width:0;background:#fff;border:1px solid #d8e4e3;border-radius:8px}
body.desktop-treatment-workspace #compactPlanContext #simpleCondition>.chart{grid-column:1/-1;grid-row:4;margin:0;min-width:0;box-sizing:border-box}
body.desktop-treatment-workspace #compactPlanContext #simpleCondition:not([open])>:not(summary){display:none!important}
body.desktop-treatment-workspace #compactPlanContext #quickPackages>.applied-package-label{grid-column:1/-1;grid-row:5;margin:0;font-size:12px}
body.desktop-treatment-workspace #compactPlanContext #simplePatientEdit{min-height:44px;padding:8px 14px}
body.desktop-treatment-workspace #compactPlanContext .compact-package-content :is(.quick-packages-heading,#quickPackageHint,#quickPackageList){margin:6px 0}
body.desktop-treatment-workspace .workspace-visit-choices{flex:1 1 150px;min-width:0}
body.desktop-treatment-workspace .workspace-visit-choices label{flex:0 1 auto}
body.desktop-treatment-workspace .workspace-visit-choices span{min-height:34px;padding:6px 9px}
@media(max-width:520px){body.desktop-treatment-workspace #compactPlanContext{gap:6px;padding:8px}body.desktop-treatment-workspace #compactPlanContext :is(#simpleCondition,#simplePackagePicker)>summary{font-size:12px!important}body.desktop-treatment-workspace #compactPlanContext #simplePatientLabel{flex-wrap:wrap}}
body.desktop-treatment-workspace #compactPlanContext summary::after{background:none!important;width:auto;height:auto;border:0;inset:auto}
body.desktop-treatment-workspace #compactPlanContext summary::before{display:none!important}
body.desktop-treatment-workspace #compactPlanContext summary::-webkit-details-marker{display:none}
body.desktop-treatment-workspace #compactPlanContext :is(#simplePackagePicker,#simpleCondition)::details-content{display:contents}

/* Visit actions stay in normal flow; no viewport-following popup. */
body.desktop-treatment-workspace .workspace-visit-actions{display:flex;flex-wrap:wrap;gap:6px;flex:1 1 100%;align-items:center}
body.desktop-treatment-workspace .workspace-visit-action{position:static!important;min-height:36px!important;padding:6px 9px!important;font-size:12px}
body.desktop-treatment-workspace #workspaceVisitReason{flex:1 1 100%;margin:0;font-size:11px;line-height:1.45;font-family:inherit;letter-spacing:normal;text-transform:none;color:#52697e}
body.desktop-treatment-workspace #workspaceVisitReason[hidden]{display:none}

/* Inline visit transfer: target buttons stay inside the detail panel. */
body.desktop-treatment-workspace .workspace-visit-transfer{flex:1 1 100%;display:flex;flex-wrap:wrap;gap:6px;padding:8px;background:#eef8f6;border:1px solid #bfdcd8;border-radius:8px}
body.desktop-treatment-workspace .workspace-visit-transfer[hidden]{display:none}
body.desktop-treatment-workspace .workspace-visit-transfer p{flex:1 1 100%;margin:0;font-size:12px;line-height:1.5}
body.desktop-treatment-workspace .workspace-visit-transfer button{min-height:36px;padding:6px 9px;font-size:12px}
/* Treatment entry point, preserving the existing catalog and selection handlers. */
body.three-step-workspace #commonDentalPanel .simple-selection-tools>#simpleTreatmentTitle{grid-column:1/-1!important;grid-row:1!important;flex:0 0 100%;margin:0 0 4px;font-size:16px;line-height:1.4;font-weight:700;color:#253746}
body.three-step-workspace #commonDentalPanel .simple-selection-tools>#quickTreatmentShortcuts,body.three-step-workspace #commonDentalPanel .simple-selection-tools>.planner-change-treatment,body.three-step-workspace #commonDentalPanel .simple-selection-tools>.dock-visit-tools{grid-row:2!important}
@media(max-width:700px){body.three-step-workspace #commonDentalPanel .simple-selection-tools>.planner-change-treatment,body.three-step-workspace #commonDentalPanel .simple-selection-tools>.dock-visit-tools{grid-row:3!important}}

/* Keep the existing net total and review action reachable throughout step two. */
body.compact-workspace.three-step-workspace #simpleStep2{padding-bottom:120px}
body.compact-workspace.three-step-workspace .simple-plan-footer{position:fixed;inset:auto 14px max(8px,env(safe-area-inset-bottom)) 14px;z-index:70;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;margin:0;padding:12px 16px;background:#fff;border:1px solid #dbe4eb;border-radius:12px;box-shadow:0 -4px 20px #10263c12}
body.compact-workspace.three-step-workspace .simple-footer-amount{display:grid;gap:2px;min-width:0}
body.compact-workspace.three-step-workspace #simpleTotalLabel{font-size:12px;line-height:1.4;color:#52677c}
body.compact-workspace.three-step-workspace #simpleTotal{font-size:24px;line-height:1.3;overflow-wrap:anywhere}
body.compact-workspace.three-step-workspace .simple-plan-footer button{max-width:230px;white-space:normal}
body.workspace-menu-open .simple-plan-footer{visibility:hidden}
@media(min-width:801px){body.compact-workspace.three-step-workspace .simple-plan-footer{left:220px;right:20px}}
@media(min-width:1101px){body.compact-workspace.three-step-workspace .simple-plan-footer{left:204px}}
@media(max-width:480px){body.compact-workspace.three-step-workspace .simple-plan-footer{padding:10px 12px;gap:8px;grid-template-columns:minmax(100px,.7fr) minmax(0,1.3fr)}body.compact-workspace.three-step-workspace .simple-plan-footer button{padding:9px 10px;font-size:12px}body.compact-workspace.three-step-workspace #simpleTotal{font-size:21px}}
@media print{body.compact-workspace.three-step-workspace .simple-plan-footer{position:static;box-shadow:none}}

/* Readable chart guidance at every operator viewport; patient outputs are separate. */
body.compact-workspace.three-step-workspace.desktop-treatment-workspace .chart .arch-head>span{font-size:11px;line-height:1.5;letter-spacing:.04em;font-weight:600;color:#52677c}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace .chart .chart-footer{font-size:12px;line-height:1.5;color:#52677c;gap:8px}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace .chart .chart-footer>div{display:flex;align-items:center;flex-wrap:wrap;gap:6px}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace .chart #selectedCount{font-size:12px;font-weight:650;line-height:1.5;color:#143b50;background:#edf5f4;padding:4px 8px;border-radius:6px}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace .chart .treatment-legend{font-size:12px;line-height:1.5;color:#52677c;gap:8px 12px;padding-top:10px}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace .chart .treatment-legend>span{gap:5px;white-space:nowrap}

/* Expand catalog scanning space while search and filtering stay above the list. */
body.compact-workspace.three-step-workspace #commonDentalPanel #pendingTreatmentPicker #pendingTreatmentResults{max-height:clamp(200px,calc(100dvh - 340px),480px);gap:4px;padding:3px;scrollbar-gutter:stable;scroll-padding-block:6px}
body.compact-workspace.three-step-workspace #pendingTreatmentResults .pending-treatment-result{padding:8px 10px;gap:10px;align-items:flex-start}
body.compact-workspace.three-step-workspace #pendingTreatmentResults .pending-treatment-result>span{font-size:13px;line-height:1.45;font-weight:650}
body.compact-workspace.three-step-workspace #pendingTreatmentResults .picker-description{font-size:12px;line-height:1.4;font-weight:400;color:#52677c;margin-top:2px}
body.compact-workspace.three-step-workspace #pendingTreatmentResults .pending-treatment-result>small{font-size:12px;line-height:1.45;font-weight:650}
@media(max-width:480px){body.compact-workspace.three-step-workspace #pendingTreatmentResults .pending-treatment-result>small{white-space:normal}}

/* One catalog entry beside the diagram title; keep its original picker and handlers. */
body.compact-workspace.three-step-workspace.desktop-treatment-workspace .chart .section-title{flex-wrap:wrap}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace .chart .section-title>div:first-child{flex:1;min-width:150px}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace .chart .chart-catalog-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;flex:0 1 auto}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace .chart .chart-catalog-actions .planner-change-treatment{display:block!important;min-height:44px;padding:8px 12px;border:1px solid #79aaa5;border-radius:8px;background:#eaf5f3;color:#075f58;font-size:12px;font-weight:650;white-space:normal;text-align:center}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace .chart .chart-catalog-actions #clear{min-height:44px;margin:0;padding:8px 10px}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace .chart>#pendingTreatmentPicker{margin:10px 0 14px}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #simpleCondition .chart-catalog-actions .planner-change-treatment,body.compact-workspace.three-step-workspace.desktop-treatment-workspace #simpleCondition #pendingTreatmentPicker{display:none!important}
@media(max-width:600px){
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace .chart .section-title>.chart-catalog-actions{width:100%;display:grid;grid-template-columns:minmax(0,1fr) auto;flex:none}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace .chart .chart-catalog-actions .planner-change-treatment{font-size:12px;padding:8px}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #simpleCondition .chart-catalog-actions{display:flex;justify-content:flex-end}
}

/* Lead with treatment details; visit management follows the price fields. */
body.desktop-treatment-workspace .workspace-empty-target{margin:4px 0 0;padding-top:8px;border-top:1px solid #e1e8ed;font-size:12px;line-height:1.5;color:#52697e}
body.desktop-treatment-workspace .workspace-empty-target[hidden],body.desktop-treatment-workspace .workspace-visit-field[hidden]{display:none!important}

body.desktop-treatment-workspace .pending-treatment-status{margin:0;padding:7px 9px;border:1px solid #e4d6b5;border-radius:7px;background:#fff8e9;color:#79551a;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
body.desktop-treatment-workspace .pending-treatment-status[hidden]{display:none!important}

/* Favorite treatment shortcuts share the diagram heading and scroll independently. */
body.compact-workspace.three-step-workspace.desktop-treatment-workspace.chart-favorites-workspace .chart .section-title{display:grid;grid-template-columns:140px minmax(0,1fr);align-items:center;gap:8px 12px}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace.chart-favorites-workspace .chart .section-title>div:first-child{min-width:0;grid-column:1;grid-row:1}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace.chart-favorites-workspace #simpleSelectionHint{display:none!important}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace.chart-favorites-workspace #commonDentalPanel .chart #quickTreatmentShortcuts{display:block!important;grid-column:2!important;grid-row:1!important;min-width:0;max-width:100%;margin:0;padding:0;overflow:hidden}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace.chart-favorites-workspace #commonDentalPanel .chart #quickTreatmentShortcuts>small{display:none!important}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace.chart-favorites-workspace #commonDentalPanel .chart #quickTreatmentShortcuts .quick-treatment-buttons{display:flex!important;flex-wrap:nowrap!important;gap:6px;max-width:100%;overflow-x:auto;overflow-y:hidden;padding:4px 3px 6px;scrollbar-width:thin;scroll-snap-type:x proximity;overscroll-behavior-x:contain}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace.chart-favorites-workspace #commonDentalPanel .chart #quickTreatmentShortcuts [data-quick-treatment]{display:flex!important;flex:0 0 auto;align-items:center;min-height:44px;max-width:220px;gap:5px;padding:7px 9px;white-space:nowrap;font-size:12px;scroll-snap-align:start}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace.chart-favorites-workspace .chart .chart-catalog-actions{grid-column:1/-1;grid-row:2;justify-self:stretch;width:100%;display:flex;justify-content:flex-end}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace.chart-favorites-workspace #common-treatment-pane>.simple-selection-tools{display:none!important}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace.chart-favorites-workspace #simpleCondition .chart-favorites{display:none!important}
@media(max-width:600px){
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace.chart-favorites-workspace .chart .section-title{grid-template-columns:100px minmax(0,1fr);gap:8px}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace.chart-favorites-workspace .chart .section-title>.chart-catalog-actions{display:grid;grid-template-columns:minmax(0,1fr) auto}
}

/* Desktop: align the heading and actions, then give favorites the full chart width. */
@media(min-width:801px){
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace.chart-favorites-workspace .chart .section-title{grid-template-columns:minmax(0,1fr) auto;gap:6px 12px}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace.chart-favorites-workspace .chart .section-title>.chart-catalog-actions{grid-column:2;grid-row:1;width:auto;justify-self:end;display:flex;gap:8px}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace.chart-favorites-workspace #commonDentalPanel .chart #quickTreatmentShortcuts{grid-column:1/-1!important;grid-row:2!important}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace.chart-favorites-workspace #commonDentalPanel .chart #quickTreatmentShortcuts [data-quick-treatment]{padding:6px 8px;gap:4px;min-height:40px}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace.chart-favorites-workspace #commonDentalPanel .chart #quickTreatmentShortcuts .shortcut-icon{width:16px;height:20px}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace.chart-favorites-workspace #commonDentalPanel .chart #quickTreatmentShortcuts .shortcut-icon .treatment-badge{width:16px;height:20px;border-radius:4px}
}

/* Desktop mouse controls supplement touch/trackpad and keyboard scrolling. */
body.desktop-treatment-workspace .favorite-scroll-button{display:none!important}
@media(min-width:801px){
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace.chart-favorites-workspace #commonDentalPanel .chart #quickTreatmentShortcuts{display:grid!important;grid-template-columns:minmax(0,1fr) 40px 40px;align-items:center;gap:4px}
 body.desktop-treatment-workspace #quickTreatmentShortcuts .favorite-scroll-button{display:inline-flex!important;align-items:center;justify-content:center;min-width:40px;width:40px;height:40px;min-height:40px;padding:0;font-size:24px;line-height:1;border-radius:8px}
 body.desktop-treatment-workspace #quickTreatmentShortcuts .favorite-scroll-button:disabled{opacity:.35;cursor:default}
}

/* Keep the Add action outside the scrolling editor, including visit controls and feedback. */
@media(min-width:1280px){
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #commonDentalPanel #common-treatment-pane #planAddDock:not(.no-treatment){height:var(--detail-available-height);max-height:var(--detail-available-height);box-sizing:border-box;padding:12px;gap:8px;min-height:0}
 body.desktop-treatment-workspace #planAddDock:not(.no-treatment)>.treatment-detail-header{flex:0 1 auto;min-height:0;max-height:40%;overflow-y:auto;gap:4px;scrollbar-width:thin}
 body.desktop-treatment-workspace #planAddDock>.treatment-detail-scroll{flex:1 1 0;display:block;padding-right:4px;scroll-padding-block:8px}
 body.desktop-treatment-workspace #planAddDock>.treatment-detail-scroll>*+*{margin-top:10px}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #commonDentalPanel #planAddDock>.plan-add-actions{flex:0 0 auto;padding-top:8px}
 body.compact-workspace.three-step-workspace.desktop-treatment-workspace #planAddDock #add{min-height:44px!important;margin:0}
 body.desktop-treatment-workspace #planAddDock .workspace-visit-field{padding-top:8px;gap:6px}
 body.desktop-treatment-workspace #planAddDock .workspace-visit-choices{flex-basis:100%;gap:4px}
 body.desktop-treatment-workspace #planAddDock .workspace-visit-choices span{min-height:32px;padding:5px 8px}
 body.desktop-treatment-workspace #planAddDock .workspace-visit-actions button{min-height:32px!important;padding:5px 8px!important}
 body.desktop-treatment-workspace #planAddDock .pending-treatment-status{padding:4px 7px}
}

/* Keep the current blocking reason next to the disabled Add action. */
body.desktop-treatment-workspace #planAddDock .pending-add-reason{margin:0 0 8px;padding:6px 8px;border:1px solid #e4d6b5;border-radius:7px;background:#fff8e9;color:#79551a;font-size:12px;line-height:1.45;overflow-wrap:anywhere;max-height:84px;overflow-y:auto;scrollbar-width:thin}
body.desktop-treatment-workspace #planAddDock .pending-add-reason[hidden]{display:none!important}

/* Jump to the actual missing control without applying or confirming anything. */
body.desktop-treatment-workspace #planAddDock .pending-add-help{margin-bottom:8px;padding:6px 8px;border:1px solid #e4d6b5;border-radius:7px;background:#fff8e9;max-height:100px;overflow:auto;scrollbar-width:thin}
body.desktop-treatment-workspace #planAddDock .pending-add-help[hidden]{display:none!important}
body.desktop-treatment-workspace #planAddDock .pending-add-help .pending-add-reason{margin:0;padding:0;border:0;background:transparent;max-height:none;overflow:visible}
body.compact-workspace.three-step-workspace.desktop-treatment-workspace #commonDentalPanel #planAddDock .plan-add-actions .pending-reason-link{display:block;min-height:28px!important;padding:3px 0!important;margin-top:2px;border:0;background:transparent;color:#006d68;text-decoration:underline;font-size:12px;line-height:1.5;text-align:left;cursor:pointer}
body.desktop-treatment-workspace #planAddDock .pending-reason-link[hidden]{display:none!important}

/* Mobile shortcut navigates to the existing editor; it never adds a treatment. */
body.compact-workspace.three-step-workspace .simple-plan-footer .mobile-pending-details{display:none}
@media(max-width:800px){
 body.compact-workspace.three-step-workspace .simple-plan-footer .mobile-pending-details:not([hidden]){display:block;grid-column:1/-1;max-width:none;min-height:44px;padding:8px 4px;border-top:1px solid #dbe4eb;border-radius:0;font-size:12px;line-height:1.5;text-align:left;color:#255f5b;overflow-wrap:anywhere}
 body.compact-workspace.three-step-workspace #simpleStep2:has(.mobile-pending-details:not([hidden])){padding-bottom:190px}
 body.compact-workspace.three-step-workspace #planAddDock{scroll-margin-top:70px}
}
body.compact-workspace.three-step-workspace #treatmentDetailTitle:focus-visible{outline:2px solid #397f79;outline-offset:4px}

/* A zero catalog value needs an explicit meaning; approval remains owned by SelectionWorkflow. */
body.compact-workspace #commonDentalPanel #pendingTreatmentResults .pending-treatment-result>.picker-price-required{white-space:normal;color:#79551a;font-weight:650;max-width:180px}
body.desktop-treatment-workspace #planAddDock .pending-price-status{padding:10px;border:1px solid #e4d6b5;border-radius:8px;background:#fff8e9;color:#79551a}
body.desktop-treatment-workspace #planAddDock .pending-price-status[data-price-state=confirmed]{border-color:#b4d4cc;background:#edf7f3;color:#255f50}
body.desktop-treatment-workspace #planAddDock .pending-price-status p{display:block!important;margin:0 0 8px;font-size:12px;line-height:1.5}
body.desktop-treatment-workspace #planAddDock .pending-price-status p:last-child{margin-bottom:0}
body.desktop-treatment-workspace #planAddDock .pending-price-status button{width:100%;white-space:normal;text-align:left}
@media(max-width:480px){body.compact-workspace #commonDentalPanel #pendingTreatmentResults .pending-treatment-result>.picker-price-required{max-width:none}}

/* Keep the current validated action beside the mobile details shortcut. */
body.compact-workspace.three-step-workspace .simple-plan-footer .mobile-pending-add{display:none}
@media(max-width:1279px){
 body.compact-workspace.three-step-workspace .simple-plan-footer .mobile-pending-details:not([hidden]){grid-column:1;min-width:0}
 body.compact-workspace.three-step-workspace .simple-plan-footer .mobile-pending-add:not([hidden]){display:block;grid-column:2;grid-row:2;max-width:200px;min-height:44px;font-size:12px;padding:8px 12px}
}

/* Detail-panel selection contract: use the visit selector's persistent selected treatment. */
body.desktop-treatment-workspace #commonDentalPanel #planAddDock :is(button[aria-pressed="true"],button[role="radio"][aria-checked="true"],label:has(>input[type="checkbox"]:checked),label:has(>input[type="radio"]:checked):not(:has(>span))){background:#e3f3ef;border-color:#008d83;color:#00645e;font-weight:700;box-shadow:inset 0 0 0 1px #008d83}
body.desktop-treatment-workspace #commonDentalPanel #planAddDock :is(button[aria-pressed="true"],button[role="radio"][aria-checked="true"])::before{content:"✓ ";font-weight:700}
body.desktop-treatment-workspace #commonDentalPanel #planAddDock input:is([type="checkbox"],[type="radio"]){accent-color:#008d83}

/* Compact target-visit row: visits on the left, Add visit on the right. */
body.desktop-treatment-workspace #planAddDock .workspace-visit-field{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:6px;padding:8px 0 0;margin:0;position:relative}
body.desktop-treatment-workspace #planAddDock .workspace-visit-field legend{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
body.desktop-treatment-workspace #planAddDock .workspace-visit-choices{width:auto;min-width:0;gap:4px;flex-basis:auto}
body.desktop-treatment-workspace #planAddDock .workspace-visit-choices label{flex:0 1 auto}
body.desktop-treatment-workspace #planAddDock .workspace-visit-choices span{min-height:36px;padding:6px 9px}
body.desktop-treatment-workspace #planAddDock .workspace-visit-actions{margin:0;align-self:start}
body.desktop-treatment-workspace #planAddDock .workspace-visit-actions .workspace-add-visit{min-height:36px!important;padding:6px 9px!important;margin:0;white-space:normal}

/* Approved local improvements: payment entry focus and compact pending actions. */
body.compact-workspace.three-step-workspace #simplePaymentTitle{scroll-margin-top:calc(var(--planner-header-height,112px) + 12px)}
body.compact-workspace.three-step-workspace #simplePaymentTitle:focus-visible{outline:2px solid #397f79;outline-offset:4px}
@media(max-width:800px){
 body.compact-workspace.three-step-workspace .simple-plan-footer:has(.mobile-pending-add:not([hidden])){gap:4px 10px;padding:8px 12px}
 body.compact-workspace.three-step-workspace .simple-plan-footer:has(.mobile-pending-add:not([hidden])) .simple-footer-amount{grid-column:1;grid-row:1}
 body.compact-workspace.three-step-workspace .simple-plan-footer:has(.mobile-pending-add:not([hidden])) #mobilePendingAdd{grid-column:2;grid-row:1;max-width:none;width:100%}
 body.compact-workspace.three-step-workspace .simple-plan-footer:has(.mobile-pending-add:not([hidden])) #mobilePendingDetails{grid-column:1;grid-row:2;min-height:32px;padding:4px 0;border:0;font-size:11px;line-height:1.3}
 body.compact-workspace.three-step-workspace .simple-plan-footer:has(.mobile-pending-add:not([hidden])) #simpleReviewPlan{grid-column:2;grid-row:2;min-height:32px;padding:4px;border:0;background:transparent;box-shadow:none;font-size:11px;text-decoration:underline}
}


/* Inline chart arrows share the existing side labels without another toolbar row. */
body.three-step-workspace .simple-chart-arches>.arch-head>.simple-chart-side{display:flex;align-items:center;gap:2px;min-width:0}
body.three-step-workspace .simple-chart-arches>.arch-head>.simple-chart-side:last-child{justify-content:flex-end}
body.compact-workspace.three-step-workspace .chart .arch-head .simple-chart-arrow{display:inline-flex;align-items:center;justify-content:center;flex:0 0 28px;min-width:28px;width:28px;min-height:32px;height:32px;padding:0;border:0;border-radius:5px;background:transparent;box-shadow:none;color:#315e65;font-size:23px;line-height:1}
body.compact-workspace.three-step-workspace .chart .arch-head .simple-chart-arrow[hidden]{display:none!important}
body.compact-workspace.three-step-workspace .chart .arch-head .simple-chart-arrow:disabled{opacity:.35;cursor:default}
body.compact-workspace.three-step-workspace .chart .arch-head .simple-chart-arrow:focus-visible{outline:2px solid #397f79;outline-offset:1px}
