/* Customer detail workspace: neutral facts, ranked sales and a compact visit timeline. */
.customer-profile-drawer {
  --profile-paper:var(--surface-solid,var(--paper,#fff));
  --profile-soft:color-mix(in srgb,var(--ink,#27303f) 3%,var(--profile-paper));
  width:min(760px,calc(100% - 24px));background:var(--profile-paper);border:1px solid var(--line);border-radius:16px;
}
.customer-profile-drawer .drawer-head{padding:22px 24px 19px;align-items:center;border-bottom:1px solid var(--line);background:var(--profile-paper)}
.customer-profile-drawer .drawer-head>div{display:grid;grid-template-columns:44px minmax(0,1fr);gap:0 13px;flex:1}
.customer-profile-drawer .drawer-head .eyebrow{display:none}
.customer-profile-drawer .drawer-head h2{grid-column:2;font-size:20px;font-weight:650;line-height:1.4;color:var(--ink)}
.customer-profile-drawer .drawer-head p{grid-column:2;margin:3px 0 0;font-size:12px;color:var(--ink-2)}
.customer-profile-avatar{grid-column:1;grid-row:1 / span 3;align-self:center;display:grid;place-items:center}
.customer-profile-drawer .customer-profile-avatar .store-avatar{width:44px;height:44px;border:1px solid var(--line);border-radius:11px;background:var(--profile-soft);color:var(--ink-2);box-shadow:none}
.customer-profile-drawer .drawer-head .close{background:var(--profile-soft);border:1px solid var(--line)}
.customer-profile-drawer .drawer-body{padding:0 24px 24px;scrollbar-gutter:auto}
.customer-profile-workspace{container-type:inline-size;min-width:0}
.customer-profile-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:19px 16px;margin:0;padding:20px 0}
.customer-profile-field{min-width:0}
.customer-profile-field.is-full{grid-column:1 / -1}
.customer-profile-field dt{font-size:12px;color:var(--ink-2);line-height:1.5;margin:0 0 5px}
.customer-profile-field dd{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;font-size:14px;font-weight:500;color:var(--ink);margin:0;line-height:1.55;overflow-wrap:anywhere}
.customer-profile-field dd>a:not(.customer-profile-map-link){color:inherit;text-decoration:none}
.customer-profile-field .customer-visit-fact{color:var(--ink);font-weight:500}
.customer-profile-field .customer-visit-caption{font-size:11px;color:var(--ink-2);font-weight:400}
.customer-profile-status{display:inline-flex;align-items:center;gap:6px}
.customer-profile-status:before{content:'';width:5px;height:5px;border-radius:50%;background:var(--accent);opacity:.7}
.customer-profile-map-link{display:inline-flex;align-items:center;gap:4px;flex:none;font-size:12px;font-weight:400;white-space:nowrap;color:var(--accent);text-decoration:none}
.customer-profile-map-link:hover{text-decoration:underline}
.customer-profile-missing{font-size:12px;font-weight:400;color:var(--ink-2)}
.customer-profile-drawer .customer-detail-disclosures{gap:8px;margin:0 0 20px}
.customer-profile-drawer .customer-detail-fold{border:1px solid var(--line);background:transparent;border-radius:8px}
.customer-profile-drawer .customer-detail-fold>summary{padding:9px 11px;min-height:37px;font-size:13px;gap:7px}
.customer-profile-drawer .customer-detail-fold>summary small{font-size:11px}
.customer-profile-drawer .customer-detail-fold-body{border-top:1px solid var(--line);padding:11px}
.customer-profile-drawer .customer-detail-code{padding:0 0 8px;margin:0 0 5px;border-bottom:1px solid var(--line);font-size:12px}
.customer-profile-drawer .customer-detail-info>div{padding:7px 0;background:transparent;font-size:12px}
.customer-profile-drawer .customer-detail-info :is(dt,dd){font-size:12px}
.customer-profile-drawer .customer-sales-summary,.customer-profile-drawer .customer-detail-history{padding-top:18px;margin-top:18px;border-top:1px solid var(--line)}
.customer-profile-drawer .customer-sales-summary>summary{gap:8px;margin:0 0 13px;font-weight:600;min-height:32px}
.customer-profile-drawer .customer-sales-summary>summary>span:first-child{font-size:15px}
.customer-profile-drawer .customer-sales-disclosure-icon{background:transparent;color:var(--ink-2);border:1px solid var(--line);flex-basis:24px}
.customer-profile-help{display:inline-flex;align-items:center;justify-content:center;flex:none;width:20px;height:24px;padding:0;background:none;border:0;color:var(--ink-2);cursor:pointer}
.customer-profile-help:hover{color:var(--accent)}
.customer-profile-help:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:4px}
.customer-profile-help-panel{position:fixed;inset:auto;margin:0;width:min(320px,calc(100vw - 24px));padding:12px 14px;border:1px solid var(--line);border-radius:10px;background:var(--profile-paper,var(--surface-solid,#fff));color:var(--ink-2);font-size:12px;line-height:1.8;box-shadow:0 10px 36px -15px rgba(15,25,40,.3)}
.customer-profile-drawer .brand-sales .bs-summary-tools.is-customer-summary{gap:6px}
.customer-profile-drawer .brand-sales .bs-summary-tools.is-customer-summary .bs-field{flex:0 1 150px;min-width:115px;max-width:170px}
.customer-profile-drawer .brand-sales .bs-summary-tools .bs-btn{min-height:28px;padding:3px 9px;font-size:12px}
.customer-profile-drawer .brand-sales .bs-summary-tools .select-trigger{min-height:28px;height:28px;padding:3px 9px;font-size:12px;background:var(--profile-paper)}
.customer-profile-drawer .brand-sales .bs-source-tabs{border-radius:7px;gap:0;background:var(--profile-soft)}
.customer-profile-drawer .brand-sales .bs-source-tabs .bs-btn.is-active{background:var(--profile-paper);color:var(--ink);box-shadow:none}
.customer-profile-drawer .customer-brand-sales-meta{padding:10px 12px;margin:0 0 12px;gap:7px 14px;border:1px solid var(--line);border-radius:8px;background:var(--profile-soft);color:var(--ink-2)}
.customer-profile-drawer .customer-sales-total-grade{display:inline-flex;align-items:center;gap:7px;font-size:12px;color:var(--ink-2)}
.customer-profile-drawer .customer-sales-total-grade .bs-grade{margin:0;font-size:13px;font-weight:650;padding:0 5px;line-height:20px;border:0;background:transparent;color:var(--ink)}
.customer-profile-drawer .customer-sales-total-amount{display:inline-flex;align-items:baseline;gap:8px}
.customer-profile-drawer .customer-sales-total-amount>small{font-size:12px;color:var(--ink-2)}
.customer-profile-drawer .customer-sales-total-amount strong{color:var(--ink);font-size:17px;font-weight:650;font-variant-numeric:tabular-nums}
.customer-profile-drawer .customer-sales-total-amount strong small{font-size:11px;font-weight:400;margin-left:3px;color:var(--ink-2)}
.customer-profile-drawer .customer-sales-context{display:flex;align-items:center;flex-wrap:wrap;gap:3px 10px;margin-left:auto;font-size:11px;line-height:1.5}
.customer-profile-drawer .customer-sales-context .customer-sales-source{color:var(--ink-2);font-weight:400}
.customer-profile-drawer .customer-detail-history{margin-bottom:0}
.customer-profile-drawer .customer-history-toolbar.is-heading{margin:0 0 4px;gap:9px}
.customer-profile-drawer .customer-history-toolbar.is-heading .store-tabs{background:var(--profile-soft);border:1px solid var(--line);box-shadow:none}
.customer-profile-drawer .customer-history-toolbar.is-heading .store-tab{font-size:12px;min-height:24px;height:24px;padding:1px 9px}
.customer-profile-drawer .customer-history-toolbar.is-heading .store-tab.is-active{background:var(--profile-paper);color:var(--ink);box-shadow:none}
.customer-profile-drawer .customer-history-count,.customer-profile-drawer .customer-history-count strong{font-size:12px;font-weight:400;color:var(--ink-2)}
.customer-profile-drawer .customer-profile-visit{display:grid;grid-template-columns:30px minmax(0,1fr);gap:10px;padding:15px 0;border-bottom:1px solid var(--line);color:var(--ink)}
.customer-profile-drawer .customer-profile-visit:last-of-type{border-bottom:0}
.customer-profile-visit-avatar{display:grid;place-items:center;width:30px;height:30px;border:1px solid var(--line);border-radius:50%;background:var(--profile-soft);font-size:12px;font-weight:550;color:var(--ink-2)}
.customer-profile-drawer .customer-history-row>.customer-profile-visit-main{display:block;min-width:0;font-size:13px}
.customer-profile-visit-heading{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 8px;min-height:23px;line-height:1.6}
.customer-profile-visit-heading>strong{font-size:13px;color:var(--ink);font-weight:600}
.customer-profile-visit-heading>span{font-size:11px;color:var(--ink-2)}
.customer-profile-drawer .customer-profile-visit-heading time{font-size:11px;color:var(--ink-2);margin-left:auto;white-space:nowrap}
.customer-profile-visit-status{display:inline-flex;align-items:center;gap:5px;font-size:11px;line-height:1.6;color:var(--ink-2)}
.customer-profile-visit-status:before{content:'';width:4px;height:4px;border-radius:50%;background:var(--ink-2);opacity:.6}
.customer-profile-drawer .customer-profile-visit p.customer-visit-content{margin:5px 0;font-size:13px;line-height:1.75;color:var(--ink)}
.customer-profile-companions{display:block;font-size:11px;color:var(--ink-2);margin:3px 0}
.customer-profile-record-link{display:inline-flex;align-items:center;gap:5px;padding:3px 0;min-height:24px;background:none;border:0;font-size:12px;color:var(--ink-2);cursor:pointer}
.customer-profile-record-link:hover{color:var(--accent)}
.customer-profile-record-link:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:3px}
.customer-profile-drawer .drawer-foot{padding:13px 24px;gap:8px;min-height:62px;background:var(--profile-paper)}
.customer-profile-drawer .drawer-foot .btn{font-size:13px;min-height:33px;padding:5px 11px;border-radius:7px}
.customer-profile-drawer .drawer-foot [data-store-availability]{margin-right:auto}
.customer-profile-drawer .drawer-foot:has(.store-delete-reason){flex-wrap:wrap}
.customer-profile-drawer .store-delete-reason{order:-1;flex:1 0 100%;margin:0;color:var(--ink-2);font-size:12px;line-height:1.5}
.customer-profile-drawer .drawer-foot .btn[data-store-delete]:disabled{color:var(--ink-3);border-color:var(--line);background:var(--profile-soft);box-shadow:none;opacity:1;cursor:not-allowed}
@container(max-width:580px){
  .customer-profile-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}
  .customer-profile-drawer .customer-sales-summary>summary{flex-wrap:wrap}
  .customer-profile-drawer .customer-sales-control-row{order:3;flex-basis:100%}
  .customer-profile-drawer .customer-sales-context{flex-basis:100%;margin-left:0}
  .customer-profile-drawer .brand-sales .bs-summary-tools.is-customer-summary .bs-field{flex:1;max-width:180px}
}
@container(max-width:450px){
  .customer-profile-drawer .customer-detail-disclosures{grid-template-columns:1fr}
  .customer-profile-drawer .customer-detail-fold[open]{grid-column:auto}
  .customer-profile-drawer .customer-detail-info{grid-template-columns:1fr}
  .customer-profile-drawer .customer-profile-visit-heading time{flex-basis:100%;margin-left:0}
}
@media(max-width:520px){
  .customer-profile-drawer .drawer-head{padding:17px 16px}
  .customer-profile-drawer .drawer-head h2{font-size:18px}
  .customer-profile-drawer .drawer-body{padding:0 16px 20px}
  .customer-profile-drawer .drawer-foot{padding:11px 16px}
}
