/* RC90: one readable control system across workspaces. */
:root{--kf-control-text:#243b46;--kf-control-line:#a9b5ba;--kf-selected:#fdf0e3;--kf-selected-line:#b9501a}
*,*::before,*::after{box-sizing:border-box}
button,input,select,textarea{font-family:inherit}
button:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #267797!important;outline-offset:2px}
button:disabled{cursor:not-allowed;opacity:.55}
/* Navigation choices all wrap, use the same selected state and stay in flow. */
:is(.panel-pages,.quote-tabs,.build-tabs,.survey-tabs,.survey-feature-picker) button{
 display:flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;
 min-height:44px!important;height:auto!important;min-width:0!important;max-width:100%!important;
 padding:10px 12px!important;font-size:13px!important;line-height:1.35!important;
 white-space:normal!important;overflow-wrap:anywhere!important;word-break:normal!important;
 border:1px solid var(--kf-control-line)!important;border-radius:7px!important;
 background:#fff!important;color:var(--kf-control-text)!important;box-shadow:none!important;cursor:pointer;
}
:is(.panel-pages,.quote-tabs,.build-tabs,.survey-tabs,.survey-feature-picker) button:is(.active,[aria-pressed="true"],[aria-selected="true"]){background:var(--kf-selected)!important;border-color:var(--kf-selected-line)!important;color:#713810!important;box-shadow:inset 0 -3px var(--kf-selected-line)!important;font-weight:750!important}
:is(.panel-pages,.quote-tabs,.build-tabs,.survey-tabs,.survey-feature-picker) button:hover{background:#f4eee6!important}
.panel-pages{gap:8px!important;padding:8px!important}
.survey-feature-picker{display:flex!important;flex-wrap:wrap!important;gap:8px!important;padding:0!important;margin:10px 0!important}
.survey-feature-picker button{flex:1 1 140px!important}
body[data-workspace="survey"] .survey-tabs button{justify-content:flex-start!important;flex-wrap:wrap!important;text-align:left!important}
/* The count is a labelled badge, never a coloured dot with a clipped numeral. */
body[data-workspace="survey"] .survey-tabs .survey-count,body[data-workspace="survey"] .survey-tabs button.active .survey-count{display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:0 0 auto!important;width:auto!important;min-width:44px!important;max-width:none!important;height:24px!important;padding:2px 6px!important;border-radius:5px!important;margin:0!important;background:#f0dcca!important;color:#713810!important;font-size:12px!important;font-weight:700!important;line-height:20px!important;white-space:nowrap!important;overflow:visible!important}
body[data-workspace="survey"] #surveyPanel{grid-template-columns:164px minmax(0,1fr)!important}
body[data-workspace="survey"] #surveyPanel>.survey-pane{padding:12px!important;scroll-padding:12px;overscroll-behavior:contain}
body[data-workspace="survey"] #surveyPanel label{font-size:13px!important}
body[data-workspace="survey"] #surveyPanel :is(input:not([type="checkbox"]),select,textarea){font-size:14px!important;min-height:42px!important;line-height:1.35!important;border-radius:6px!important}
body[data-workspace="survey"] #surveyPanel .survey-card{padding:12px!important}
body[data-workspace="survey"] .survey-navigation{position:static!important;grid-column:1/-1!important;display:flex!important;flex-wrap:wrap!important;gap:8px!important;padding:10px!important;height:auto!important;min-height:64px!important;background:#f4f0e9!important;border-top:1px solid #bfc8cb;z-index:5}
body[data-workspace="survey"] .survey-navigation button{flex:1 1 130px!important;min-height:44px!important;font-size:13px!important;white-space:normal!important;padding:9px 10px!important}
body[data-workspace="survey"] .survey-feature-row{min-width:0!important;padding:10px!important;border:1px solid #aebac0!important;border-radius:8px!important;box-shadow:none!important;background:#fff!important}
body[data-workspace="survey"] .survey-feature-row-head{display:flex!important;gap:8px!important;flex-wrap:wrap!important;margin:0 0 8px!important;padding:0!important;align-items:center!important}
body[data-workspace="survey"] .survey-feature-row-head strong{flex:1 1 100%;font-size:14px!important;line-height:1.4!important}
body[data-workspace="survey"] .survey-feature-row-head button,.survey-feature-actions button{min-height:42px!important;font-size:12px!important;white-space:normal!important;flex:1 1 100px!important}
body[data-workspace="survey"] #surveyPanel .survey-feature-row .panel-pages{grid-template-columns:repeat(2,minmax(0,1fr))!important;position:static!important;padding:6px 0!important}
body[data-workspace="survey"] #surveyPanel .survey-feature-row .panel-page{max-height:none!important;overflow:visible!important;padding:0!important}
body[data-workspace="survey"] #surveyPanel .survey-feature-grid{gap:10px!important;margin:10px 0 0!important}
body[data-workspace="survey"] #surveyPanel .survey-feature-grid:has([data-survey-offset]) label:has([data-survey-offset]),body[data-workspace="survey"] #surveyPanel .survey-feature-grid label:has([data-survey-notes]){grid-column:1/-1!important}
/* Generic forms and action rows share sizes and wrap rather than clip. */
:is(.app-modal,.project-files-modal-card,#quoteWorkspaceBody,#buildWorkspaceBody) label{min-width:0;line-height:1.4}
:is(.app-modal,#quoteWorkspaceBody,#buildWorkspaceBody) :is(input:not([type="checkbox"]),select,textarea){min-width:0;max-width:100%;font-size:14px!important;min-height:42px!important;line-height:1.35}
:is(.scope-toolbar,.pricing-toolbar,.project-doc-actions,.project-overview-actions,.survey-feature-actions,.modal-head){flex-wrap:wrap;gap:8px}
:is(.scope-toolbar,.pricing-toolbar,.project-doc-actions,.project-overview-actions,.modal-head) button{min-height:44px!important;white-space:normal!important}
.toolbar-more-menu{max-height:calc(100dvh - 130px)!important;overflow:auto!important;overscroll-behavior:contain}
.toolbar-more-menu button{min-height:48px!important;white-space:normal!important}
.toolbar-more-menu button strong{font-size:13px!important}.toolbar-more-menu button small{font-size:12px!important;line-height:1.4!important}
#properties :is(input:not([type="checkbox"]),select),#worktopWorkspacePanel :is(input:not([type="checkbox"]),select){min-height:38px!important;font-size:13px!important}
#properties .panel-page{max-height:calc(100dvh - 365px)!important}
.panel-page{scroll-padding:12px;scrollbar-gutter:stable}
/* Tablet: show the survey OR the full plan, with a persistent switch. */
@media(min-width:1101px){body[data-workspace="survey"] main{grid-template-columns:minmax(560px,56%) minmax(0,1fr)!important}}
@media(max-width:1100px){
 body[data-workspace="survey"] main{display:block!important;position:relative!important;min-height:0!important}
 body[data-workspace="survey"] main>.properties-panel{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;z-index:2!important;box-shadow:none!important}
 body[data-workspace="survey"] main>.workspace{display:none!important}
 body[data-workspace="survey"].survey-plan-visible main>.workspace{display:block!important;position:absolute!important;inset:0 0 76px!important;width:100%!important;height:auto!important}
 body[data-workspace="survey"].survey-plan-visible #surveyPanel>:is(.survey-head,.survey-tabs,.survey-pane){visibility:hidden!important}
 body[data-workspace="survey"].survey-plan-visible main>.properties-panel{pointer-events:none;background:transparent!important}
 body[data-workspace="survey"].survey-plan-visible .survey-navigation{pointer-events:auto!important}
 body[data-workspace="survey"].survey-plan-visible #surveyPanel{background:transparent!important}
 body[data-workspace="survey"] #surveyShowPlan{display:block!important}
 body[data-workspace="survey"] #surveyPanel{grid-template-columns:148px minmax(0,1fr)!important}
}
@media(max-width:600px){
 body[data-workspace="survey"] #surveyPanel{grid-template-columns:110px minmax(0,1fr)!important}
 body[data-workspace="survey"] .survey-tabs{padding:8px 5px!important}
 body[data-workspace="survey"] .survey-tabs button{padding:8px!important;font-size:12px!important}
 body[data-workspace="survey"] #surveyPanel>.survey-head{padding:10px!important;gap:8px!important;flex-wrap:wrap!important}
 body[data-workspace="survey"] .survey-photos-btn{font-size:12px!important;max-width:none!important;min-height:42px!important}
 body[data-workspace="survey"] #surveyPanel>.survey-pane{padding:8px!important}
 body[data-workspace="survey"] #surveyPanel .survey-card{padding:10px!important}
 body[data-workspace="survey"] #surveyPanel :is(input:not([type="checkbox"]),select,textarea),.app-modal :is(input:not([type="checkbox"]),select,textarea){font-size:16px!important}
 body[data-workspace="survey"] #surveyPanel .survey-feature-row-head button{flex-basis:100%!important}
 body[data-workspace="survey"] .survey-navigation button{flex-basis:calc(50% - 8px)!important;font-size:12px!important}
 body[data-workspace="survey"].survey-plan-visible main>.workspace{bottom:120px!important}
 .panel-pages{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .panel-pages button{font-size:12px!important;padding:8px!important}
 .app-modal .modal-card{max-height:calc(100dvh - 20px)!important}
}
@media print{.rail-support,.panel-pages{display:none!important}}
body[data-workspace="survey"] #surveyFeaturesPane .survey-section-head{display:flex!important;flex-wrap:wrap!important;align-items:center!important;gap:10px!important;padding-bottom:4px!important}
body[data-workspace="survey"] #surveyFeaturesPane .survey-section-head>div:first-child{flex:1 1 240px!important;min-width:0!important}
body[data-workspace="survey"] #surveyFeaturesPane .survey-section-head h3{margin-bottom:4px!important}
body[data-workspace="survey"] #surveyFeaturesPane .survey-section-head .survey-help{margin:0!important}
body[data-workspace="survey"] .survey-feature-actions{display:flex!important;flex-direction:row!important;flex:0 1 auto!important;gap:8px!important;width:auto!important}
body[data-workspace="survey"] .survey-feature-actions button{flex:0 1 auto!important;width:auto!important;padding:8px 12px!important}
body[data-workspace="survey"] #surveyPanel .survey-feature-row .panel-pages{grid-template-columns:repeat(3,minmax(0,1fr))!important}
.feature-edit-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.feature-edit-actions button{flex:1 1 120px;min-height:44px!important;font-size:13px!important;white-space:normal!important}
@media(max-width:600px){body[data-workspace="survey"] #surveyFeaturesPane .survey-section-head>div:first-child{flex-basis:100%!important}body[data-workspace="survey"] #surveyPanel .survey-feature-row .panel-pages button{padding:6px!important;font-size:11px!important}}
body[data-workspace="survey"] #surveyPanel{max-height:none!important;min-height:0!important}
body[data-workspace="survey"].survey-plan-visible .zoom{bottom:20px!important;z-index:4}
.survey-section-menu{display:none!important}.workspace-rail{overflow-x:hidden!important}.workspace-rail>*{max-width:100%}
@media(max-width:600px){
 body[data-workspace="survey"] .app{grid-template-rows:150px 0 minmax(0,1fr) 26px!important}
 body[data-workspace="survey"] .topbar{display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:44px 90px!important;height:150px!important;min-height:0!important;gap:4px!important;padding:6px!important;overflow:visible!important}
 body[data-workspace="survey"] .topbar .brand{display:block!important;width:100%!important;max-width:none!important;height:44px!important;padding:0!important;margin:0!important}
 body[data-workspace="survey"] .topbar .brand img{max-height:40px!important;width:auto!important;max-width:100%!important}
 body[data-workspace="survey"] .top-actions{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;grid-auto-rows:42px!important;gap:4px!important;overflow:visible!important;padding:0!important;width:100%!important;min-width:0!important}
 body[data-workspace="survey"] .top-actions .toolbar-group{display:contents!important}
 body[data-workspace="survey"] .top-actions .toolbar-group[aria-label="Edit"]{display:none!important}
 body[data-workspace="survey"] .top-actions button,body[data-workspace="survey"] #toolbarMore>summary{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;width:100%!important;min-width:0!important;height:42px!important;min-height:42px!important;padding:3px!important;gap:2px!important}
 body[data-workspace="survey"] .top-actions button span,body[data-workspace="survey"] #toolbarMore>summary>span{font-size:14px!important;line-height:1!important}
 body[data-workspace="survey"] .top-actions button strong,body[data-workspace="survey"] #toolbarMore strong{display:block!important;font-size:10px!important;line-height:1.2!important}
 body[data-workspace="survey"] #toolbarMore{width:100%!important;min-width:0!important;height:42px!important}
 body[data-workspace="survey"] .toolrow{display:none!important}
 body[data-workspace="survey"] #surveyPanel{display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto auto minmax(0,1fr) auto!important;height:100%!important;max-height:none!important}
 body[data-workspace="survey"] #surveyPanel>.survey-head{grid-row:1!important;grid-column:1!important;display:flex!important;flex-wrap:wrap!important}
 body[data-workspace="survey"] #surveyPanel>.survey-head h2{display:block!important;font-size:18px!important}
 body[data-workspace="survey"] #surveyPanel>.survey-head small{font-size:12px!important}
 body[data-workspace="survey"] #surveyPanel>.survey-tabs{display:none!important}
 body[data-workspace="survey"] #surveyPanel>.survey-section-menu{display:flex!important;flex-direction:column!important;grid-row:2!important;grid-column:1!important;padding:8px 10px!important;gap:5px!important;margin:0!important;background:#eae5dd!important}
 body[data-workspace="survey"] #surveySectionSelect{width:100%!important;min-width:0!important;min-height:44px!important;font-size:16px!important}
 body[data-workspace="survey"] #surveyPanel>.survey-pane{grid-row:3!important;grid-column:1!important;width:100%!important;min-width:0!important;min-height:0!important;height:auto!important}
 body[data-workspace="survey"] #surveyPanel>.survey-navigation{grid-row:4!important;grid-column:1!important;width:100%!important}
 body[data-workspace="survey"].survey-plan-visible #surveyPanel>.survey-section-menu{visibility:hidden!important}
 body[data-workspace="survey"] #surveyPanel .survey-feature-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 body[data-workspace="survey"] #surveyFeaturesPane .survey-section-head .survey-help{display:none!important}
 body[data-workspace="survey"] #surveyFeaturesPane .survey-section-head>div:first-child{flex-basis:auto!important}
 body[data-workspace="survey"] .survey-feature-picker button{flex-basis:calc(50% - 8px)!important;font-size:12px!important}
 .rail-support button{font-size:9px!important;padding:7px 0!important}
}
@media(max-width:600px){body[data-workspace="survey"] .top-actions .toolbar-more-menu button{display:grid!important;grid-template-columns:20px minmax(0,1fr)!important;height:auto!important;min-height:48px!important;padding:10px!important;gap:10px!important;text-align:left!important}body[data-workspace="survey"] .top-actions .toolbar-more-menu button span{font-size:13px!important}body[data-workspace="survey"] .top-actions .toolbar-more-menu button strong{font-size:13px!important}body[data-workspace="survey"] .toolbar-more-menu{position:fixed!important;top:148px!important;left:56px!important;right:8px!important;width:auto!important;max-height:calc(100dvh - 165px)!important}}
@media(max-width:600px){body[data-workspace="survey"] .app>main{grid-row:3!important}body[data-workspace="survey"] .app>footer{grid-row:4!important}body[data-workspace="survey"] .app>.topbar{grid-row:1!important}}
.survey-fixed-item-select{display:none!important}
@media(max-width:600px){body[data-workspace="survey"] #surveyFeaturePicker .survey-fixed-item-select{display:block!important;width:100%!important;min-height:44px!important;font-size:16px!important}body[data-workspace="survey"] #surveyFeaturePicker button{display:none!important}body[data-workspace="survey"] #surveyFeaturesPane .survey-section-head>div:first-child{display:none!important}body[data-workspace="survey"] #surveyPanel .survey-feature-row-head strong{display:none!important}body[data-workspace="survey"] .survey-feature-actions{width:100%!important}body[data-workspace="survey"] .survey-feature-actions button{flex:1!important}}
body[data-workspace="survey"] #surveyPanel .survey-feature-grid label:has([data-survey-notes]){grid-column:auto!important}
/* A recorded-item list stays one control even on a large survey. */
body[data-workspace="survey"] #surveyFeaturePicker .survey-fixed-item-select{display:block!important;width:100%!important;min-height:44px!important;font-size:14px!important}
body[data-workspace="survey"] #surveyFeaturePicker button{display:none!important}
@media(max-width:600px){body[data-workspace="survey"] #surveyFeaturePicker .survey-fixed-item-select{font-size:16px!important}}

body[data-workspace="survey"] #surveyPanel>.survey-section-menu{display:none!important}
@media(max-width:600px){body[data-workspace="survey"] #surveyPanel>.survey-section-menu{display:flex!important}}
@media(max-width:1100px){
 body[data-workspace="survey"] .app{grid-template-rows:150px 0 minmax(0,1fr) 26px!important}
 body[data-workspace="survey"] .topbar{display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:44px 90px!important;height:150px!important;min-height:0!important;gap:4px!important;padding:6px!important;overflow:visible!important}
 body[data-workspace="survey"] .topbar .brand{display:block!important;width:100%!important;max-width:none!important;height:44px!important;padding:0!important;margin:0!important}
 body[data-workspace="survey"] .topbar .brand img{max-height:40px!important;width:auto!important;max-width:100%!important}
 body[data-workspace="survey"] .top-actions{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;grid-auto-rows:42px!important;gap:4px!important;overflow:visible!important;padding:0!important;width:100%!important;min-width:0!important}
 body[data-workspace="survey"] .top-actions .toolbar-group{display:contents!important}
 body[data-workspace="survey"] .top-actions .toolbar-group[aria-label="Edit"]{display:none!important}
 body[data-workspace="survey"] .top-actions button,body[data-workspace="survey"] #toolbarMore>summary{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;width:100%!important;min-width:0!important;height:42px!important;min-height:42px!important;padding:3px!important;gap:2px!important}
 body[data-workspace="survey"] .top-actions button span,body[data-workspace="survey"] #toolbarMore>summary>span{font-size:14px!important;line-height:1!important}
 body[data-workspace="survey"] .top-actions button strong,body[data-workspace="survey"] #toolbarMore strong{display:block!important;font-size:10px!important;line-height:1.2!important}
 body[data-workspace="survey"] #toolbarMore{width:100%!important;min-width:0!important;height:42px!important}
 body[data-workspace="survey"] .toolrow{display:none!important}
 body[data-workspace="design"] .app{grid-template-rows:150px 0 minmax(0,1fr) 26px!important}
 body[data-workspace="design"] .topbar{display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:44px 90px!important;height:150px!important;min-height:0!important;gap:4px!important;padding:6px!important;overflow:visible!important}
 body[data-workspace="design"] .topbar .brand{display:block!important;width:100%!important;max-width:none!important;height:44px!important;padding:0!important;margin:0!important}
 body[data-workspace="design"] .topbar .brand img{max-height:40px!important;width:auto!important;max-width:100%!important}
 body[data-workspace="design"] .top-actions{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;grid-auto-rows:42px!important;gap:4px!important;overflow:visible!important;padding:0!important;width:100%!important;min-width:0!important}
 body[data-workspace="design"] .top-actions .toolbar-group{display:contents!important}
 body[data-workspace="design"] .top-actions .toolbar-group[aria-label="Edit"]{display:none!important}
 body[data-workspace="design"] .top-actions button,body[data-workspace="design"] #toolbarMore>summary{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;width:100%!important;min-width:0!important;height:42px!important;min-height:42px!important;padding:3px!important;gap:2px!important}
 body[data-workspace="design"] .top-actions button span,body[data-workspace="design"] #toolbarMore>summary>span{font-size:14px!important;line-height:1!important}
 body[data-workspace="design"] .top-actions button strong,body[data-workspace="design"] #toolbarMore strong{display:block!important;font-size:10px!important;line-height:1.2!important}
 body[data-workspace="design"] #toolbarMore{width:100%!important;min-width:0!important;height:42px!important}
 body[data-workspace="design"] .toolrow{display:none!important}

body:is([data-workspace="survey"],[data-workspace="design"]) .app>main{grid-row:3!important}body:is([data-workspace="survey"],[data-workspace="design"]) .app>footer{grid-row:4!important}body:is([data-workspace="survey"],[data-workspace="design"]) .app>.topbar{grid-row:1!important}
.phone-extra-tools{display:flex!important;gap:6px;padding:8px}.phone-extra-tools button{flex:1!important;min-height:42px!important}
}
@media(max-width:1100px){body[data-workspace="design"] .app{grid-template-rows:150px 44px minmax(0,1fr) 26px!important}body[data-workspace="design"] .toolrow{display:flex!important}}
#properties>.panel-pages button{font-size:13px!important;line-height:1.35!important}
body[data-workspace="design"] #properties label:not(.checkline),body[data-workspace="design"] #properties label.checkline{font-size:13px!important;line-height:1.4!important}
.scope-origin{font-size:11px!important;white-space:normal!important;line-height:1.3!important}
@media(max-width:700px){body[data-workspace="design"] .app{grid-template-rows:100px 44px minmax(0,1fr) 26px!important}body[data-workspace="design"] .topbar{height:100px!important;grid-template-rows:44px 42px!important}body[data-workspace="design"] .top-actions{grid-auto-rows:42px!important}}

/* RC91: tablet (701-1100px) — keep the plan usable. Library narrows, Properties becomes a slide-over drawer opened from the toolbar. */
@media(min-width:701px) and (max-width:1100px){
 body[data-workspace="design"] main,body[data-workspace="design"].properties-collapsed main{grid-template-columns:210px minmax(0,1fr)!important}
 body[data-workspace="design"] main>.properties-panel{display:none!important;position:fixed!important;z-index:950!important;right:0!important;top:150px!important;bottom:30px!important;width:min(340px,70vw)!important;box-shadow:-8px 0 24px rgba(0,0,0,.35)!important}
 body[data-workspace="design"].mobile-properties-open main>.properties-panel{display:block!important}
 body[data-workspace="design"] #mobilePropertiesToggle{display:inline-flex!important;align-items:center!important}
 body[data-workspace="design"] #mobileLibraryToggle{display:none!important}
 body[data-workspace="design"] .properties-reopen{display:none!important}
}
