.order-scheme-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:18px;margin:18px 0}.scheme-choice{padding:24px;text-align:left;display:flex;flex-direction:column;gap:14px;color:inherit;background:white;border:1px solid var(--line,#dfe6ef);cursor:pointer}.scheme-choice strong{font-size:20px}.scheme-choice.selected{border:2px solid #267ef0;background:#f4f8ff}.scheme-choice span{line-height:1.7}.order-scheme-cards .panel-body{padding:24px}#scheme-footer{padding:20px 0;position:sticky;bottom:-24px;background:#fff;border-top:1px solid #e4e9f0;z-index:12}#scheme-body .pb-workbench{margin-top:18px}#scheme-name{max-width:560px}@media(max-width:640px){.order-scheme-cards{grid-template-columns:1fr}#scheme-footer{bottom:-16px}#scheme-footer button{flex:1;min-width:120px}}

/* Scheme cards share a footer baseline even when descriptions wrap. */
.order-scheme-cards{grid-template-columns:repeat(auto-fit,minmax(min(260px,100%),1fr));align-items:stretch;gap:16px}
.order-scheme-cards>.panel{min-width:0;margin:0;overflow-wrap:anywhere}
.order-scheme-cards>.panel>.panel-body{height:100%;box-sizing:border-box;display:flex;flex-direction:column;gap:12px;padding:24px}
.order-scheme-cards>.panel>.panel-body :is(h2,p){margin:0;line-height:1.5}
.order-scheme-cards>.panel>.panel-body h2{font-size:18px}
.order-scheme-cards>.panel>.panel-body p.small{padding-top:4px}
.order-scheme-cards>.panel>.panel-body p.scheme-card-status{margin-top:auto}
.scheme-owned-cards>.panel>.panel-body .scheme-card-note{min-height:3em}
@supports(grid-template-rows:subgrid){
 .scheme-owned-cards>.panel{display:grid;grid-row:span 6;grid-template-rows:subgrid;row-gap:12px}
 .scheme-owned-cards>.panel>.panel-body{display:grid;grid-row:span 6;grid-template-rows:subgrid;height:auto;row-gap:12px}
 .scheme-owned-cards>.panel>.panel-body p.scheme-card-status{margin-top:0}
 .scheme-owned-cards>.panel>.panel-body .scheme-card-note{min-height:0}
}
.order-scheme-cards>.panel>.panel-body>.btn{width:100%;min-height:44px;justify-content:center}
.order-scheme-cards>.scheme-choice{min-height:160px;margin:0;border-width:1px;border-radius:10px;font:inherit;gap:12px}
.order-scheme-cards>.scheme-choice strong{font-size:18px;line-height:1.5}
.order-scheme-cards>.scheme-choice.selected{border-width:1px;box-shadow:inset 0 0 0 1px #267ef0}
#scheme-body>.field{display:grid;gap:8px;margin:16px 0;min-width:0}
#scheme-body>.form-grid{gap:16px;align-items:start;margin:16px 0}
#scheme-body>.actions{gap:8px;flex-wrap:wrap;margin:16px 0}
#scheme-name{width:100%;max-width:100%}
#scheme-footer{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
#scheme-footer>.btn{min-height:44px;min-width:120px}
@media(max-width:640px){.order-scheme-cards>.panel>.panel-body{padding:16px}.order-scheme-cards>.scheme-choice{padding:16px;min-height:0}#scheme-footer>.btn{flex:1 1 140px}}
/* Unified scheme form: one body scroller; footer occupies its own row. */
.scheme-v3-form{display:flex!important;flex-direction:column;min-height:0;overflow:hidden!important}
#v3-steps{flex:none;margin:0 0 16px;line-height:1.8;overflow-wrap:anywhere}
#v3-body{flex:1;min-height:0;overflow:auto;padding:0 4px 16px}
#v3-error{flex:none;max-height:100px;overflow:auto}
#v3-footer{flex:none;position:static;border-top:1px solid var(--line,#dfe6ef);background:white;padding-top:16px;gap:8px;flex-wrap:wrap}
.scheme-v3-form :is(button.btn,input:not([type=checkbox]),select){min-height:44px;box-sizing:border-box}
.scheme-v3-form .form-grid{gap:16px;margin:16px 0;align-items:end}
.scheme-v3-form .actions{gap:8px;flex-wrap:wrap;margin:16px 0}
.v3-field-list{display:grid;gap:8px;margin-top:16px}
.v3-field-row{display:grid;grid-template-columns:minmax(150px,1fr) minmax(160px,1fr) 80px minmax(120px,1fr);align-items:center;gap:16px;padding:12px 16px;border:1px solid var(--line,#dfe6ef);border-radius:8px}
.v3-field-row :is(input:not([type=checkbox]),select){width:100%;min-width:0}.v3-field-row .field{min-width:0;margin:0}
#v3-builder{min-width:0}#v3-builder .pb-workbench{height:min(680px,65vh);min-height:360px}
@media(max-width:768px){.v3-field-row{grid-template-columns:1fr 1fr;gap:8px;padding:12px}#v3-footer>.btn{flex:1 1 130px}#v3-body{padding-bottom:8px}.scheme-v3-form .form-grid{grid-template-columns:1fr}}
.scheme-v3-form>.modal-body{display:flex;flex-direction:column;min-height:0;overflow:hidden!important}.scheme-v3-form>.modal-actions[hidden]{display:none!important}


dialog.order-fullscreen .scheme-v3-form :is(input:not([type=checkbox]),select,.btn){min-height:44px!important}
.order-settings-list{display:grid;gap:12px;min-width:0}
.order-settings-list .order-setting-entry{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:6px;width:100%;min-height:64px;padding:14px 16px;text-align:left;white-space:normal;overflow-wrap:anywhere}
.order-setting-entry strong{font-weight:600}
.order-setting-entry .small{line-height:1.5}

/* Hidden wizard controls must not be restored by the shared field grid styles. */
.scheme-v3-form [hidden]{display:none!important}
/* Wrapped mobile tools occupy their own space, leaving a usable preview below. */
@media(max-width:850px){
  #v3-builder .pb-workbench{height:auto;min-height:0}
  #v3-builder .pb-center{flex:none;height: min(600px,65vh);min-height:360px}
  #v3-builder :is(.pb-blocks,.pb-properties){max-height:65vh;flex:none}
}

/* Keep optional controls compact and explain feature dependencies in place. */
.v3-module-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0}
.v3-module-option{display:flex;flex-direction:column;gap:8px;padding:16px;border:1px solid var(--line,#dfe6ef);border-radius:8px;min-width:0;cursor:pointer}
.v3-module-option span{font-weight:600}.v3-module-option small{color:var(--muted,#65758b);line-height:1.5;overflow-wrap:anywhere}
.v3-advanced{border:1px solid var(--line,#dfe6ef);border-radius:8px;padding:12px 16px;margin:16px 0}
:is(.v3-advanced,.v3-field-default)>summary{cursor:pointer;min-height:44px;align-content:center;line-height:1.5}
.v3-field-default{min-width:0}.v3-field-default>.field{margin-top:8px}
@media(max-width:640px){.v3-module-options{grid-template-columns:1fr}.v3-field-default{grid-column:1/-1}}

#v3-edit-status{flex:1 1 240px;margin:0;align-self:center;overflow-wrap:anywhere}

/* Keep common actions visible and advanced controls out of the preview viewport. */
#v3-steps{display:flex;gap:8px;flex-wrap:wrap;background:transparent;padding:0;margin-bottom:10px}
#v3-steps>.btn{min-height:40px;padding:8px 12px}
.v3-field-group{display:grid;gap:8px;min-width:0}.v3-field-group h3{margin:12px 0 4px;font-size:15px}
.v3-field-meaning{grid-column:1/-1;margin:0;line-height:1.6}
.v3-use-default{display:flex;gap:8px;align-items:center;margin:16px 0;min-height:44px}
.order-create-scheme{display:flex;align-items:center;gap:16px;flex-wrap:wrap;padding:12px 0;margin-bottom:12px;border-bottom:1px solid var(--line)}
.order-create-scheme .field{flex:0 1 380px;min-width:0;margin:0}
#order-filter [hidden]{display:none!important}
#v3-body.v3-page-step{display:flex;flex-direction:column;overflow:hidden;padding-bottom:0}
.v3-page-toolbar{flex:none;display:flex;align-items:flex-start;justify-content:space-between;gap:8px;flex-wrap:wrap}
.v3-page-toolbar>.actions{margin:0}.v3-preview-settings{min-width:0;max-width:100%}
.v3-preview-settings>summary{cursor:pointer;min-height:44px;align-content:center}
.v3-preview-settings[open]{flex:1 1 100%;max-height:220px;overflow:auto}
#v3-preview-status{flex:none;margin:6px 0;line-height:1.5}
#v3-body.v3-page-step #v3-builder{flex:1;min-height:0;overflow:hidden}
#v3-body.v3-page-step #v3-builder .pb-workbench{height:100%;min-height:0;margin:0}
@media(max-width:850px){#v3-body.v3-page-step{overflow:auto}#v3-body.v3-page-step #v3-builder{flex:none;overflow:visible}#v3-body.v3-page-step #v3-builder .pb-workbench{height:auto;min-height:0}.v3-preview-settings[open]{max-height:240px}#v3-steps>.btn{flex:1 1 110px}.order-create-scheme .field{flex:1 1 100%}}

/* Native hidden must win over button and flex display rules in order dialogs. */
.order-control-surface [hidden]{display:none!important}

.order-control-surface .toolbar>.field{margin:0;min-width:0}

/* Puck adds an intermediate root: carry the bounded desktop height through it. */
@media(min-width:851px){#v3-body.v3-page-step #v3-builder>.Puck{height:100%;min-height:0;overflow:hidden}}

/* Compact mobile navigation leaves room for the selected editing pane. */
@media(max-width:850px){
 #v3-steps{flex-wrap:nowrap;overflow-x:auto;flex-shrink:0;max-width:100%}
 #v3-steps>.btn{flex:none;white-space:nowrap}
 #modal #v3-footer>.btn{flex:1 1 auto;min-width:0;padding:10px 4px;font-size:13px;white-space:normal;overflow-wrap:anywhere}
 #v3-edit-status{flex-basis:100%;font-size:12px}
 .v3-page-toolbar>.actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}
 #modal .v3-page-toolbar>.actions>.btn{min-width:0;padding:10px 6px;font-size:13px;white-space:nowrap}
 #v3-builder .pb-tools>span{display:block;font-size:12px;line-height:18px}
 #v3-builder .pb-tools>div:not(.pb-pane-switch){flex-wrap:nowrap;overflow-x:auto;max-width:100%}
 #v3-builder .pb-tools>div:not(.pb-pane-switch)>button{flex:none;white-space:nowrap}
}
/* On tall phones scroll the active pane, not its toolbar; short viewports retain page scrolling. */
@media(max-width:850px) and (min-height:700px){
 #v3-body.v3-page-step{overflow:hidden}
 #v3-body.v3-page-step #v3-builder{flex:1;min-height:0;overflow:hidden}
 #v3-body.v3-page-step #v3-builder>.Puck{height:100%;min-height:0;overflow:hidden}
 #v3-body.v3-page-step #v3-builder .pb-workbench{height:100%;min-height:0;overflow:hidden}
 #v3-body.v3-page-step #v3-builder .pb-tools{flex:none}
 #v3-body.v3-page-step #v3-builder :is(.pb-blocks,.pb-properties,.pb-center){flex:1;min-height:0;height:auto;max-height:none}
}

.scheme-group-title{font-size:18px;margin:24px 0 12px}.scheme-starters>summary{cursor:pointer;min-height:44px;align-content:center;font-weight:600}.scheme-starters{margin-top:20px}
.v3-preparation-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:12px 0}
.v3-preview-short{display:none}
@media(max-width:850px){
 #v3-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;overflow:visible}
 #modal #v3-steps>.btn{min-width:0;padding:8px 2px;font-size:13px}
 #v3-preview-status{display:none}
 .v3-page-toolbar{gap:6px;align-items:center}
 .v3-page-toolbar>.actions{flex:1;width:auto;gap:6px!important}
 .v3-preview-settings{flex:0 0 46px}
 .v3-preview-settings>summary{display:flex;align-items:center;justify-content:center;border:1px solid var(--line,#dfe6ef);border-radius:6px;min-height:44px;font-size:13px;padding:0 6px}
 .v3-preview-label{display:none}.v3-preview-short{display:inline}
 .v3-preview-settings[open]{flex:1 1 100%;max-height:180px}
 .v3-preview-settings[open] .v3-preview-label{display:inline}.v3-preview-settings[open] .v3-preview-short{display:none}
 #v3-builder .pb-tools>.pb-tool-actions{overflow:visible}
 #v3-body.v3-page-step{gap:8px}
}

.scheme-current>.panel-body{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:16px}.scheme-current-info{flex:1 1 240px;min-width:0;overflow-wrap:anywhere}.scheme-current-info>p{margin-bottom:0}.scheme-current>.panel-body>.btn{flex:0 0 auto;min-height:44px}

.scheme-card-actions{display:flex;flex-wrap:wrap;gap:10px}.scheme-card-actions>.btn{flex:1 1 120px;min-height:44px;justify-content:center}.scheme-example-devices{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:14px}.scheme-example-stage{height:65dvh;min-height:280px;max-height:760px;overflow:auto;padding:12px;box-sizing:border-box;border:1px solid var(--line,#dfe6ef);border-radius:8px;background:#f3f6fb}.scheme-example-frame{display:block;height:100%;border:0;background:white;margin:0 auto;width:100%;min-width:960px}.scheme-example-frame[data-device="mobile"]{width:390px;min-width:0;max-width:100%}

.order-fullscreen .modal-body.scheme-example-body{display:flex;flex-direction:column;overflow:hidden}.scheme-example-body>.notice,.scheme-example-body>.scheme-example-devices{flex:0 0 auto}.scheme-example-body>.notice{margin-top:0}.scheme-example-body>.scheme-example-stage{flex:1 1 auto;height:auto;min-height:0;max-height:none}

.v3-preview-sources{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:start}#v3-body .v3-preview-sources>.field{display:grid;gap:8px;font-size:14px;line-height:20px;min-width:0;margin:0}.v3-preview-search{display:flex;gap:8px;align-items:stretch;min-width:0}.v3-preview-search>input{flex:1 1 0;width:0;min-width:0}.v3-preview-search>.btn{flex:0 0 auto;min-height:44px}.scheme-example-body>#scheme-example-note{flex:none;margin:0 0 10px}
@media(max-width:850px){.v3-preview-sources{grid-template-columns:minmax(0,1fr)}}

.v3-preview-source{flex:none;min-width:0;max-width:100%;margin:4px 0;color:var(--text,#182f4a);font-size:13px;line-height:1.5;overflow-wrap:anywhere}.v3-change-summary{padding:14px 16px;border:1px solid var(--line,#dfe6ef);border-radius:8px;background:var(--panel,#fff);overflow-wrap:anywhere}.v3-change-summary ul{padding-left:20px;margin:10px 0}.v3-change-summary p{font-size:13px;line-height:1.6;margin:6px 0}@media(max-width:850px){.v3-preview-settings{flex-basis:64px}.v3-preview-source{font-size:12px;margin:0}.v3-change-summary{padding:12px}}

.v3-public-notice{flex:none;margin:4px 0;padding:8px 12px;border-left:3px solid #267ef0;background:#f0f6ff;color:#304d72;font-size:13px;line-height:1.5;overflow-wrap:anywhere}.v3-check-issue{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.v3-check-issue>div{flex:1 1 220px;min-width:0;overflow-wrap:anywhere}.v3-check-issue p{margin:6px 0}.v3-check-issue>.btn{flex:none;min-height:44px}

/* Daily shortcuts use existing wrapping buttons and keep help aligned with filters. */
.orders-list-content #order-quick-help{margin:0;padding:10px 22px;overflow-wrap:anywhere}
.appointment-page .toolbar{padding:12px 0}
@media(max-width:600px){.orders-list-content #order-quick-help{padding:10px 14px}.appointment-page .toolbar .btn{min-height:44px}}

/* Calendar trigger stays immediately before Apply; popover wraps inside the filter width. */
#order-filter{position:relative}
.order-date-picker{position:relative;flex:0 1 auto;min-width:0;max-width:100%}
.order-date-picker>summary{list-style:none;cursor:pointer;min-height:44px;max-width:100%;white-space:nowrap}
.order-date-picker>summary::-webkit-details-marker{display:none}
.order-date-picker[open]>summary{border-color:var(--green);background:var(--pale,#f0f6ff)}
.order-date-popover{position:absolute;z-index:20;top:calc(100% + 8px);left:0;width:360px;max-width:calc(100vw - 24px);overflow:auto;padding:16px;border:1px solid var(--line);border-radius:10px;background:#fff;box-shadow:0 10px 30px #20304826;box-sizing:border-box}
.order-list-dates{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;min-width:0}
.order-list-dates .field{min-width:0;margin:0}.order-list-dates .field:first-child,.order-list-dates small{grid-column:1/-1}
.order-list-dates input,.order-list-dates select{width:100%;min-width:0;box-sizing:border-box;min-height:44px}
.order-list-dates small{overflow-wrap:anywhere}.order-date-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:14px}.order-date-footer .btn{flex:none}
@media(max-width:600px){.order-list-dates{grid-template-columns:minmax(0,1fr)}}

.orders-list-content .order-filter-panel{overflow:visible}.order-filter-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;min-width:0;max-width:100%}.order-filter-actions>.btn{min-height:44px;white-space:nowrap}@media(max-width:600px){.order-filter-actions{flex:1 1 100%;gap:8px}.order-filter-actions>.btn{width:auto}}

/* Step colors are local to the setup journey; page-view tabs retain their blue style. */
#v3-steps>.v3-step{--step-ink:#1d4ed8;--step-tint:#eff6ff;--step-border:#93c5fd;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;border:2px solid var(--step-border);background:var(--step-tint);color:var(--step-ink);font-weight:500;line-height:1.5}
#v3-steps>.v3-step-2{--step-ink:#6d28d9;--step-tint:#f5f3ff;--step-border:#c4b5fd}
#v3-steps>.v3-step-3{--step-ink:#0f766e;--step-tint:#f0fdfa;--step-border:#5eead4}
#v3-steps>.v3-step:hover:not(:disabled){border-color:var(--step-ink)}
#v3-steps>.v3-step[aria-current="step"]{background:var(--step-ink);border-color:var(--step-ink);color:#fff;font-weight:700}
#v3-steps>.v3-step[aria-current="step"] .v3-step-label{text-decoration:underline;text-underline-offset:4px;text-decoration-thickness:2px}
#v3-steps>.v3-step:focus-visible{outline:3px solid var(--step-ink);outline-offset:3px}
#v3-steps>.v3-step:disabled{background:#f3f4f6;border-color:#d1d5db;color:#6b7280;opacity:1;cursor:not-allowed}
.v3-step-number{display:inline-flex;align-items:center;justify-content:center;flex:none;width:22px;height:22px;border:1px solid currentColor;border-radius:50%;font-size:12px;line-height:1}
@media(max-width:850px){#v3-steps>.v3-step{gap:4px}.v3-step-number{width:18px;height:18px;font-size:11px}}
/* Keep a usable mobile canvas; the wizard body scrolls above its fixed actions. */
@media(max-width:850px){
 #v3-body.v3-page-step{overflow:auto}
 #v3-body.v3-page-step #v3-builder{flex:none;overflow:visible}
 #v3-body.v3-page-step #v3-builder>.Puck{height:auto;overflow:visible}
 #v3-body.v3-page-step #v3-builder .pb-workbench{height:auto;overflow:visible}
 #v3-body.v3-page-step #v3-builder .pb-center{flex:none;height:auto;min-height:320px}
}

/* Keep the editing field and all save actions available above the phone keyboard. */
html.mobile-keyboard-open.mobile-viewport-short #modal .scheme-v3-form #v3-steps,
html.mobile-keyboard-open.mobile-viewport-short #modal .scheme-v3-form #v3-edit-status{display:none}
html.mobile-keyboard-open.mobile-viewport-short #modal .scheme-v3-form #v3-footer{margin:0;padding-top:4px;gap:4px}
html.mobile-keyboard-open.mobile-viewport-short #modal .scheme-v3-form #v3-body{overflow:auto;min-height:0}
html.mobile-keyboard-open.mobile-viewport-tight #modal:has(.scheme-v3-form) .modal-head{display:none}
