/* CreedStack Loyalty 1.0.6: layout follows available container width, not viewport.
   Intentionally limited to Loyalty-owned surfaces and embedded management panels. */
:is(.cp7,.lra-dashboard,.lra-staff,.lra-scanner,.creed-card,.creed-catalog,.creed-inbox,.creed-analytics,.creed-redemptions-list,.creed-loyalty-db,.creed-loyalty-status,.creed-mail-admin,.creedstack-current-status) {
  box-sizing:border-box; min-width:0!important; max-width:100%!important;
  overflow-wrap:anywhere; container-type:inline-size; container-name:creed-loyalty;
}
.cp7 {width:100%!important;max-width:100%!important}
.lra-dashboard {width:100%!important;max-width:100%!important}
.creed-catalog {width:100%!important;max-width:100%!important}
.creed-card:not(.creed-member-dashboard) {width:100%;max-width:min(540px,100%)!important;padding:clamp(12px,4%,32px)}
.creed-card.creed-member-dashboard.creed-phase6 {width:100%!important;max-width:100%!important;padding:clamp(12px,4%,36px)}
:is(.creed-loyalty-db,.creed-loyalty-status,.creed-mail-admin).wrap {width:auto}
:is(.cp7,.lra-dashboard,.lra-staff,.lra-scanner,.creed-card,.creed-catalog,.creed-inbox,.creed-analytics,.creed-redemptions-list,.creed-loyalty-db,.creed-loyalty-status,.creed-mail-admin,.creedstack-current-status) :where(form,fieldset,label,section,article,nav,main,header,details,div,dl,dd,pre) {
  box-sizing:border-box; min-width:0;
}
:is(.cp7,.lra-dashboard,.lra-staff,.lra-scanner,.creed-card,.creed-catalog,.creed-inbox,.creed-analytics,.creed-redemptions-list,.creed-loyalty-db,.creed-loyalty-status,.creed-mail-admin,.creedstack-current-status) :where(form,fieldset,section,article,nav,main,header,details,pre) {max-width:100%}
:is(.cp7,.lra-dashboard,.lra-staff,.lra-scanner,.creed-card,.creed-catalog,.creed-inbox,.creed-analytics,.creed-redemptions-list,.creed-loyalty-db,.creed-loyalty-status,.creed-mail-admin,.creedstack-current-status) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea,button,.button) {
  box-sizing:border-box;max-width:100%!important;min-width:0;
}
:is(.cp7,.lra-dashboard,.lra-staff,.lra-scanner,.creed-card,.creed-catalog,.creed-inbox,.creed-analytics,.creed-redemptions-list,.creed-loyalty-db,.creed-loyalty-status,.creed-mail-admin,.creedstack-current-status) :is(button,.button,summary) {white-space:normal;overflow-wrap:anywhere}
:is(.cp7,.lra-dashboard,.lra-staff,.creed-card,.creed-catalog) :is(img,svg,video,canvas) {max-width:100%;height:auto}
:is(.cp7,.creed-mail-admin) :is(.wp-editor-wrap,.wp-editor-container,.mce-tinymce,.mce-container-body,.mce-edit-area,.quicktags-toolbar) {max-width:100%!important;min-width:0!important;box-sizing:border-box}
:is(.cp7,.creed-mail-admin) :is(.wp-editor-container,.mce-container-body,.quicktags-toolbar) {overflow-wrap:anywhere}
:is(.cp7,.creed-mail-admin) pre {max-width:100%;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere}

/* Tables: a stable, keyboard-focusable local scroll area. Never squeeze or hide
   columns, nor turn table rows/cells into blocks. */
.creed-table-scroll {
  display:block!important; width:100%!important; max-width:100%!important;
  min-width:0!important; box-sizing:border-box; overflow-x:auto!important;
  overflow-y:auto!important; max-height:min(70vh,42rem)!important;
  overscroll-behavior-inline:contain; scrollbar-width:auto!important;
}
.creed-table-scroll:focus-visible {outline:2px solid #185a91;outline-offset:2px}
:is(.cp7,.lra-dashboard,.creed-card,.creed-catalog,.creed-redemptions-list,.creed-loyalty-db,.creed-mail-admin) .creed-table-scroll > table,
.creed-table-scroll > table {
  display:table!important; width:100%!important; min-width:var(--creed-table-min,34rem)!important;
  max-width:none!important; table-layout:auto!important; border-collapse:collapse;
  margin:0!important; overflow:visible!important; overflow-wrap:normal;
}
.creed-table-scroll > table > thead {display:table-header-group!important}
.creed-table-scroll > table > tbody {display:table-row-group!important}
.creed-table-scroll > table > tfoot {display:table-footer-group!important}
.creed-table-scroll > table > :is(thead,tbody,tfoot) > tr {display:table-row!important}
.creed-table-scroll > table > :is(thead,tbody,tfoot) > tr > :is(th,td) {
  display:table-cell!important;white-space:normal!important;overflow-wrap:anywhere;word-break:normal;
  vertical-align:middle;box-sizing:border-box;
}
.creed-table-scroll > table > :is(thead,tbody,tfoot) > tr > :is(th,td)::before {content:none!important}
.creed-table-scroll > table > :is(thead,tbody,tfoot) > tr > :is(th,td) > :is(form,details) {max-width:100%;min-width:0}
.creed-table-scroll > table .cm-points {white-space:nowrap!important;min-width:74px}
.creed-table-scroll :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea) {max-width:100%;box-sizing:border-box}
.creed-redemptions-list .creed-table-scroll :is(th,td) {padding:10px;border-bottom:1px solid #e2e8f0;text-align:left}
/* Suppress obsolete navigation controls if an old cached script still runs. */
.creed-table-tools {display:none!important}
.cp7 .cm-scroll-hint {overflow-wrap:anywhere}
.cp7 .cm-scroll-hint[hidden] {display:none!important}

/* Grid tracks shrink to one column in narrow website containers even on desktop. */
.cp7 .cp7-cards {grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr))!important}
.cp7 .creed-settings-tabs,.creed-loyalty-admin .cp7 .creed-settings-tabs {grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr))!important}
.cp7 .creed-general-settings .cp7-form,.cp7 .creed-wizard-grid {grid-template-columns:repeat(auto-fit,minmax(min(100%,265px),1fr))!important}
.cp7 .creed-backup-actions {grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr))!important}
.lra-customer-details,.lra-dashboard .lra-customer-details {grid-template-columns:repeat(auto-fit,minmax(min(100%,170px),1fr))!important}
.lra-dashboard .lra-dashboard-links,.creed-card .creed-tiles {grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr))!important}
.creed-catalog .creed-catalog-grid {grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr))!important}
.creed-metric-grid {grid-template-columns:repeat(auto-fit,minmax(min(100%,155px),1fr))!important}
:is(.cp7 .cp7-cards,.cp7 .creed-settings-tabs,.cp7 .creed-wizard-grid,.cp7 .cp7-form,.cp7 .creed-backup-actions,.lra-customer-details,.lra-dashboard-links,.creed-tiles,.creed-catalog-grid,.creed-metric-grid)>* {min-width:0;max-width:100%;overflow-wrap:anywhere}
.cp7 .cp7-form {grid-template-columns:minmax(0,1fr)}
.cp7 > main {width:100%;max-width:100%;min-width:0!important;padding:clamp(12px,3%,28px)}
.cp7 > header {padding:clamp(12px,3%,25px)}
.cp7 > nav:not(.creed-settings-tabs),.creed-loyalty-admin .cp7 > nav:not(.creed-settings-tabs),
.cp7 .creed-cm nav.cm-tabs,.creed-loyalty-admin .cp7 .creed-cm nav.cm-tabs {
  display:flex;flex-wrap:wrap!important;min-width:0;max-width:100%;overflow:visible!important;gap:6px;
}
.cp7 > nav .cp7-tab {min-width:0;max-width:100%}
.cp7 > nav .cp7-tab a,.creed-loyalty-admin .cp7 > nav .cp7-tab a {white-space:normal!important;overflow-wrap:anywhere;max-width:100%}
.cp7 .creed-cm nav.cm-tabs a.cm-tab {flex:1 1 72px;max-width:100%;white-space:normal;overflow-wrap:anywhere}
.cp7 .cm-bar,.creed-loyalty-admin .cp7 .cm-bar,.creed-mail-admin .cu-toolbar,.cp7 .cu-toolbar {flex-wrap:wrap!important;max-width:100%;min-width:0}
.cp7 .cm-bar>*,.cp7 .cu-toolbar>*,.creed-mail-admin .cu-toolbar>* {min-width:0!important;max-width:100%!important}
.cp7 .creed-general-settings,.cp7 .creed-wizard-panel,.cp7 .creed-backup-panel,
.lra-dashboard .lra-history,.lra-dashboard .lra-hero,.lra-staff,.creed-catalog .creed-catalog-hero,.creed-catalog .creed-catalog-card-body,.creed-catalog .creed-catalog-requests,
.creed-inbox,.creed-analytics,.creed-balance {padding:clamp(12px,3%,24px)}
.lra-dashboard .lra-history,.creed-catalog .creed-catalog-requests,.cp7 .creed-module-settings,.cp7 .creed-migration-panel {min-width:0;max-width:100%;overflow-x:auto}
.lra-staff form,.creed-analytics form {max-width:100%;margin-inline:0}
.lra-scanner {display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.lra-scanner label {flex:1 1 100%;min-width:0}
.lra-scanner input[type=text] {flex:1 1 180px;min-width:0!important}
.lra-scanner button {flex:0 1 auto}
.creed-member-head,.creed-balance-actions,.lra-hero .lra-balance-row {flex-wrap:wrap;min-width:0;max-width:100%}
.creed-member-head>* {min-width:0;max-width:100%}
.creed-member-head .creed-avatar {max-width:100%;flex-shrink:0}
.lra-hero .lra-balance-row strong,.creed-balance-actions>strong {min-width:0;max-width:100%;overflow-wrap:anywhere}
.creed-catalog-card-footer>* {min-width:0;max-width:100%}
.cp7 .creed-notifications .cn-event summary,.cp7 .creed-notifications .cn-master {flex-wrap:wrap;min-width:0}
.cp7 .creed-notifications .cn-event-title {min-width:0;overflow-wrap:anywhere}
.cp7 .creed-notifications .cn-options label,.cp7 .creed-notifications .cn-roles label {max-width:100%;min-width:0}
.creed-mail-admin .nav-tab-wrapper,.cp7 .creed-module-settings .nav-tab-wrapper {flex-wrap:wrap!important;max-width:100%}
.creed-mail-admin .nav-tab,.cp7 .creed-module-settings .nav-tab {white-space:normal!important;overflow-wrap:anywhere;max-width:100%}
/* Smaller component, not necessarily smaller device. Fallback tracks above
   still reflow when container queries are unsupported. */
@container creed-loyalty (max-width:480px) {
  .cp7 > main,.cp7 > header,.cp7 .creed-wizard-panel,.cp7 .creed-wizard-grid {padding:12px!important}
  .lra-hero .lra-balance-row strong,.creed-balance-actions>strong {font-size:32px!important}
  .lra-redeem-button,.creed-redeem-cta {max-width:100%;width:100%!important;box-sizing:border-box}
  .creed-member-head {gap:10px}
  .creed-member-head .creed-avatar {width:64px;height:64px}
  .cp7 .creed-cm nav.cm-tabs {max-width:100%;gap:4px}
  .cp7 .creed-settings-tab {padding:10px!important}
}

/* Full available theme content width for application pages, not 100vw.
   Keep login/sign-in cards and intentionally compact controls unchanged.
   Constrained block theme shortcode wrappers are expanded only when they
   directly contain a CreedStack application root. */
:is(.cp7,.lra-dashboard,.creed-catalog,.lra-staff,.lra-scanner,.creed-inbox,.creed-analytics,.creed-redemptions-list,.creed-card.creed-member-dashboard.creed-phase6),
.creed-loyalty-admin .cp7 {
  box-sizing:border-box;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  margin-inline:0!important;
}
.wp-block-shortcode:has(> :is(.cp7,.lra-dashboard,.creed-catalog,.lra-staff,.lra-scanner,.creed-inbox,.creed-analytics,.creed-redemptions-list,.creed-card.creed-member-dashboard.creed-phase6)) {
  box-sizing:border-box;width:100%!important;max-width:100%!important;min-width:0!important;margin-inline:0!important;
}
.cp7 :is(.creed-wizard,.creed-notifications,.creed-backup-panel,.creed-module-settings,.creed-migration-panel,.creed-cm) {
  width:100%;max-width:100%!important;min-width:0!important;box-sizing:border-box;
}

/* Record table controls; keep native scroll and existing action forms. */
.creed-grid-toolbar{display:flex;flex-wrap:wrap;align-items:end;gap:8px;margin:12px 0;min-width:0;max-width:100%;box-sizing:border-box}
.creed-grid-toolbar label{display:flex;flex-direction:column;gap:4px;max-width:100%;min-width:0}
.creed-grid-toolbar input,.creed-grid-toolbar select{min-width:0;max-width:100%;box-sizing:border-box}
.creed-grid-count{font-size:13px;color:#526477;align-self:center}
.creed-table-scroll th .creed-grid-sort,.creed-table-scroll th .creed-sort-link{display:inline!important;background:transparent!important;color:inherit!important;border:0!important;padding:0!important;margin:0!important;font:inherit!important;text-align:inherit;min-height:0!important;box-shadow:none!important;text-decoration:none;cursor:pointer;white-space:normal!important}
.creed-table-scroll th .creed-grid-sort:focus-visible,.creed-table-scroll th .creed-sort-link:focus-visible{outline:2px solid #185a91;outline-offset:3px}
.creed-table-scroll tr[hidden]{display:none!important}
