.commerce-offers{min-width:0;color:var(--ink)}
.commerce-loading,.commerce-more{padding:24px;text-align:center;color:var(--muted)}
.commerce-list-head,.commerce-list-row{display:grid;grid-template-columns:minmax(220px,2fr) minmax(140px,1fr) minmax(100px,.7fr) minmax(150px,1fr);gap:20px;align-items:center;padding:18px 22px}
.commerce-list-head{padding-top:8px;padding-bottom:12px;font-size:12px;color:var(--muted)}
.commerce-list{background:var(--surface);border:1px solid var(--line);border-radius:14px;overflow:hidden}
.commerce-list-row+.commerce-list-row{border-top:1px solid var(--line)}
.commerce-list-row:hover{background:var(--hover)}
.commerce-offer-title{color:var(--ink);font-size:15px;font-weight:500;text-decoration:none;overflow-wrap:anywhere}
.commerce-offer-title:hover{text-decoration:underline;text-decoration-style:dashed;text-decoration-color:var(--hover-underline,#d3d7db);text-decoration-thickness:1px;text-underline-offset:4px}
.commerce-list-row small,.commerce-payment-type small{display:block;color:var(--muted);font-size:12px;margin-top:5px}
.commerce-price{font-variant-numeric:tabular-nums;font-weight:500;font-size:14px}
.commerce-access-count{font-size:13px;color:var(--muted)}
.commerce-status{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;font-size:12px;color:var(--muted);background:var(--soft);border-radius:7px;padding:5px 8px}
.commerce-status::before{content:'';width:5px;height:5px;border-radius:50%;background:currentColor}
.commerce-status.is-active{color:var(--positive);background:var(--positive-soft)}
.commerce-status.is-paused{color:var(--warning);background:var(--warning-soft)}
.commerce-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;min-height:150px;padding:24px 20px;text-align:center;background:var(--surface);border:1px solid var(--line);border-radius:16px}
.commerce-empty>.icon{width:24px;height:24px;color:var(--muted)}
.commerce-empty h2{font-size:16px;margin:0;font-weight:500}.commerce-empty p{font-size:14px;max-width:420px;margin:0;color:var(--muted)}

.commerce-edit-tools{display:flex;gap:8px;align-items:center;flex-wrap:wrap;width:100%}.commerce-save-state{font-size:12px;color:var(--muted);margin-right:auto}
.commerce-back{display:flex;align-items:center;gap:4px;white-space:nowrap;font-size:13px}
.commerce-editor{display:grid;grid-template-columns:160px minmax(280px,1fr) 260px;gap:24px;max-width:1240px;margin:0 auto;align-items:start;padding:8px 0}
.commerce-editor-nav{display:flex;flex-direction:column;gap:4px}
.commerce-editor-nav button{border:0;background:none;color:var(--muted);font:inherit;font-size:13px;text-align:left;border-radius:8px;padding:12px;cursor:pointer}
.commerce-editor-nav button[aria-current=page]{background:var(--nav-active);color:var(--ink)}
.commerce-editor-form{min-width:0;background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:28px}
.commerce-editor-form fieldset{border:0;padding:0;margin:0;min-width:0;display:flex;flex-direction:column;gap:18px}
.commerce-editor-form h2{font-size:18px;font-weight:500;margin:0}.commerce-hint{font-size:13px;line-height:1.5;color:var(--muted);margin:0}
.commerce-editor-form textarea{resize:vertical;min-height:110px}.commerce-editor-form .account-field{margin:0}
.commerce-choice{display:flex;flex-direction:column;align-items:flex-start;gap:10px;padding:16px;border:1px solid var(--line);border-radius:12px;overflow-wrap:anywhere}
.commerce-choice>span{font-size:12px;color:var(--muted)}.commerce-choice>strong{font-size:14px;font-weight:500}
.commerce-summary{display:flex;flex-direction:column;gap:10px;padding:22px;background:var(--surface);border:1px solid var(--line);border-radius:14px;position:sticky;top:calc(var(--workspace-header-height) + 24px);overflow-wrap:anywhere}
.commerce-summary-label{font-size:12px;color:var(--muted)}.commerce-summary>strong{font-size:16px;font-weight:500;line-height:1.4}.commerce-summary-price{display:block;font-size:26px;letter-spacing:-.6px;font-weight:500;font-variant-numeric:tabular-nums}
.commerce-summary small{font-size:12px;line-height:1.5;color:var(--muted)}.commerce-summary>span:not(.commerce-summary-label){font-size:13px}.commerce-summary hr{width:100%;border:0;border-top:1px solid var(--line);margin:10px 0}
.commerce-published-note{margin-top:12px;padding-top:16px;border-top:1px solid var(--line);display:flex;flex-direction:column;gap:8px;font-size:12px}
.commerce-lifecycle{display:flex;flex-direction:column;align-items:flex-start;gap:8px;margin-top:10px}
.commerce-payment-type{display:flex;align-items:center;gap:12px;background:var(--soft);border-radius:10px;padding:16px}.commerce-payment-type strong{font-size:14px;font-weight:500}
.commerce-access-list{display:flex;flex-direction:column;gap:12px}.commerce-access-item{border:1px solid var(--line);border-radius:12px;padding:16px}.commerce-access-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:14px}.commerce-access-heading strong{font-size:14px;font-weight:500;overflow-wrap:anywhere}
.commerce-access-fields{display:grid;grid-template-columns:1fr 1.4fr;gap:10px}.commerce-access-item>small{display:block;color:var(--muted);font-size:12px;margin-top:10px}
.commerce-policy{border-top:1px solid var(--line);padding-top:14px}.commerce-policy h3{font-size:14px;font-weight:500}.commerce-policy p{font-size:13px;line-height:1.6;color:var(--muted)}
.commerce-error{display:flex;align-items:center;gap:12px;flex-wrap:wrap;background:var(--error-soft);color:var(--error);border-radius:10px;padding:14px 18px;font-size:13px;margin-bottom:18px}
.commerce-picker .crm-search{width:100%;margin-bottom:12px}.commerce-picker [data-commerce-picker-results]{max-height:380px;overflow:auto}.commerce-picker-item{display:flex;align-items:center;justify-content:space-between;gap:16px;border:0;border-bottom:1px solid var(--line);padding:14px 8px;width:100%;background:transparent;text-align:left;color:var(--ink);font:inherit;font-size:14px;cursor:pointer}.commerce-picker-item:hover{background:var(--hover)}.commerce-picker-item small{display:block;font-size:12px;color:var(--muted);margin-top:4px}.commerce-picker-item:disabled{opacity:.5;cursor:default}
.commerce-preview h3{font-size:22px;line-height:1.4;margin:0 0 16px}.commerce-preview p{white-space:pre-wrap;line-height:1.6;color:var(--muted);overflow-wrap:anywhere}.commerce-preview small{display:block;color:var(--muted);font-size:13px;margin-top:6px}.commerce-preview h4{font-size:14px;margin:24px 0 12px}.commerce-preview ul{padding:0;list-style:none}.commerce-preview li{padding:12px 0;border-bottom:1px solid var(--line)}.commerce-preview li strong{display:block;font-size:14px;font-weight:500}.commerce-preview li span{display:block;font-size:12px;color:var(--muted);margin-top:6px}
.commerce-test-note{font-size:12px;color:var(--warning);background:var(--warning-soft);padding:10px;border-radius:8px;margin:0}
.commerce-offers :is(a,button):focus-visible{outline:2px solid var(--ink);outline-offset:3px}
@media(max-width:1200px){.commerce-editor{grid-template-columns:150px minmax(260px,1fr);gap:16px}.commerce-summary{grid-column:2;position:static}.commerce-editor-nav{grid-row:1 / span 2}.commerce-summary .commerce-summary-label{display:none}}
@media(max-width:700px){.commerce-editor{display:flex;flex-direction:column;gap:14px;padding:0}.commerce-editor-nav{position:static;flex-direction:row;width:100%;overflow:auto;gap:4px;padding:3px}.commerce-editor-nav button{white-space:nowrap;padding:10px;font-size:12px}.commerce-editor-form{width:100%;padding:20px 16px;border-radius:12px;box-sizing:border-box}.commerce-summary{width:100%;box-sizing:border-box;padding:18px}.commerce-access-fields{grid-template-columns:1fr}.commerce-list-head{display:none}.commerce-list-row{grid-template-columns:1fr auto;gap:16px 10px;padding:18px 16px}.commerce-list-row>div:first-child{grid-column:1 / -1}.commerce-list-row>div:nth-child(4){grid-column:2;grid-row:2}.commerce-access-count{grid-column:1 / -1;grid-row:3}.commerce-edit-tools{gap:6px}.commerce-edit-tools .btn{font-size:12px;padding:8px 10px}.commerce-save-state{flex:1;min-width:130px}.commerce-edit-tools>.commerce-status{font-size:11px}.commerce-back{font-size:12px}.commerce-empty{min-height:140px}.commerce-error{padding:12px}.commerce-payment-type{padding:12px}}
@media(prefers-reduced-motion:reduce){.commerce-offers *{scroll-behavior:auto;animation:none;transition:none}}

/* Payment pages share the title and content axis with CRM. */
body[data-workspace=true] .content:has(:is(#commerce-cabinet,#commerce-offers,#commerce-payments,#commerce-external,#commerce-workflows)){max-width:none;padding-inline:var(--crm-page-inset)}
.commerce-menu>div{min-width:180px}
.commerce-menu>div .btn{justify-content:flex-start;white-space:nowrap}
.commerce-view-tabs{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:16px;border-bottom:1px solid var(--line);padding-bottom:8px}
.commerce-view-tabs .btn{background:none;border-color:transparent;color:var(--muted)}
.commerce-view-tabs .btn[aria-pressed=true]{background:var(--surface);border-color:var(--line);color:var(--ink)}
#commerce-payments>.payment-filters{margin-bottom:16px}
@media(max-width:700px){
 body[data-workspace=true] .workspace-page-tools .commerce-toolbar-actions{width:auto;margin-left:auto;flex-wrap:wrap}
 .commerce-menu>div .btn{min-height:40px}
}

.commerce-add-materials{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.commerce-access-heading small{display:block;font-size:12px;color:var(--muted);margin-top:3px}

.commerce-material-modes{display:flex;gap:8px}
.commerce-material-modes>.btn{flex:1;min-width:0;white-space:normal;justify-content:center}
.commerce-material-modes>.btn[aria-pressed=true]{background:var(--soft);border-color:var(--line)}
.commerce-material-modes .coherio-selection-mark{flex:none}
.commerce-group-select{position:relative}
.commerce-group-select>.btn{width:100%;justify-content:space-between;color:var(--muted);font-weight:400}
.commerce-group-options{position:absolute;inset:calc(100% + 4px) 0 auto;z-index:6;padding:8px;border:1px solid var(--line);border-radius:10px;background:var(--surface);box-shadow:var(--shadow)}
.commerce-group-options .commerce-picker [data-commerce-picker-results]{max-height:min(270px,38vh)}
.commerce-access-heading .commerce-connected-group{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.commerce-access-item .commerce-menu>div{right:0;left:auto}

/* On a school's first visit the whole offers workspace is the setup surface. */
body[data-workspace=true]:has(#commerce-offers[data-offer-entry]) .shell{background:var(--surface)}
body[data-workspace=true] .content:has(#commerce-offers[data-offer-entry]){box-sizing:border-box;width:100%;max-width:none;padding:0;margin:0;background:var(--surface)}
#commerce-offers[data-offer-entry]{display:flex;flex-direction:column;min-height:calc(var(--workspace-viewport-height,100dvh) - var(--workspace-header-height,52px));background:var(--surface)}
#commerce-offers[data-offer-entry] [data-offer-payment-setup]{display:flex;flex:1;min-width:0;margin:0;padding:24px 40px;box-sizing:border-box}
#commerce-offers[data-offer-entry] .payment-setup{align-self:flex-start;width:100%}
#commerce-offers[data-offer-entry] .payment-setup:is([data-ps-phase=choice],[data-ps-phase=loading]){align-self:center}
#commerce-offers[data-offer-entry] .ps-loading{justify-content:center}
.commerce-entry-permission{color:var(--muted);margin:0;font-size:14px}
@media(max-width:700px){
 #commerce-offers[data-offer-entry] [data-offer-payment-setup]{padding:24px 20px}
 #commerce-offers[data-offer-entry]{min-height:calc(var(--workspace-viewport-height,100dvh) - 58px)}
}
@media(max-height:570px){#commerce-offers[data-offer-entry] [data-offer-payment-setup]{padding-block:20px}}
