/* Customer workspace refinement. Login/admin are deliberately outside this scope. */
body.sba-redesign[data-workspace-appearance='on']::before {
  inset: -24px;
  background: linear-gradient(180deg, rgb(246 248 253 / 26%), rgb(238 242 250 / 40%)), var(--sba-wallpaper) center / cover no-repeat;
  filter: blur(var(--sba-wallpaper-blur, 3px));
  transform: scale(1.025);
}
body.sba-redesign[data-workspace-appearance='on'][data-wallpaper-motion='gentle']::before {
  animation: sba-wallpaper-drift 48s ease-in-out infinite alternate;
}
@keyframes sba-wallpaper-drift {
  from { transform: translate3d(-.35%, -.2%, 0) scale(1.025); }
  to { transform: translate3d(.35%, .2%, 0) scale(1.045); }
}
body.sba-redesign[data-workspace-appearance='on'][data-page-hidden='true']::before {
  animation-play-state: paused;
}
body.sba-redesign[data-workspace-appearance='on'][data-motion='paused']::before { animation: none; }

.customer-portal-shell {
  --sba-widget-radius: 24px;
  --sba-glass: linear-gradient(145deg, rgb(255 255 255 / 88%), rgb(248 250 254 / 79%));
  --sba-glass-shadow: 0 12px 36px rgb(18 30 51 / 10%), inset 0 1px 0 rgb(255 255 255 / 96%);
  -webkit-font-smoothing: antialiased;
}
body.sba-redesign .customer-portal-shell :is(.panel, .sba-ref-welcome, .sba-ref-project-card, .sba-ref-contact-card, .sba-chart-card, .project-widget-card) {
  border-radius: var(--sba-widget-radius);
}
body.sba-redesign .customer-portal-shell .sba-ref-dock {
  justify-self: center;
  width: min(100%, 1000px);
  border-radius: 30px;
  padding: 17px 18px 13px;
  gap: 8px;
  background: linear-gradient(150deg, rgb(255 255 255 / 84%), rgb(239 244 252 / 74%));
  box-shadow: 0 16px 42px rgb(16 30 54 / 14%), inset 0 1px 0 white;
}
.customer-portal-shell .sba-ref-dock button {
  min-height: 88px;
  gap: 9px;
  color: #24324b;
  font-size: 11px;
  font-weight: 550;
  letter-spacing: -.015em;
}
.customer-portal-shell .sba-ref-dock .sba-ref-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  corner-shape: squircle;
  border: 1px solid rgb(255 255 255 / 95%);
  background: linear-gradient(155deg, #fff 2%, #f2f5fa 45%, #dce4ef 100%);
  color: #273c59;
  box-shadow: 0 5px 10px rgb(24 40 69 / 12%), inset 0 1px 1px white, inset 0 -1px 2px rgb(91 113 144 / 12%);
  transition: transform .22s ease, box-shadow .22s ease;
}
.customer-portal-shell .sba-ref-dock .sba-ref-icon svg { width: 28px; height: 28px; }
.customer-portal-shell .sba-ref-dock button:active .sba-ref-icon { transform: scale(.95); }
.customer-portal-shell :is(button, input, select):focus-visible { outline: 3px solid #305ead; outline-offset: 4px; }
.customer-portal-shell .sba-ref-section-head,
.customer-portal-shell .sba-settings-page > .section-heading,
.customer-portal-shell .sba-ref-footer {
  padding: 15px 18px;
  border-radius: 20px;
  background: rgb(250 252 255 / 87%) !important;
  color: #304565;
}
.customer-portal-shell .sba-ref-section-head button { color: #254b85; }
body.sba-redesign .customer-portal-shell .portal-main > section > :is(.sba-vnext-heading, .section-heading, .invoice-hero) {
  padding: 22px;
  border-radius: 24px;
  background: rgb(250 252 255 / 89%) !important;
}
body.sba-redesign .customer-portal-shell .sba-ref-finance-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
body.sba-redesign .customer-portal-shell .sba-ref-finance-nav > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid rgb(255 255 255 / 90%);
  border-radius: 14px;
  background: rgb(250 252 255 / 90%);
  color: #263f61;
  font-size: 13px;
}
.customer-portal-shell .sba-ref-finance-nav svg { flex: 0 0 18px; width: 18px; height: 18px; }
body.sba-redesign .customer-portal-shell .sba-vnext-filter-pills { flex-wrap: wrap; overflow: visible; min-width: 0; max-width: 100%; }
body.sba-redesign .customer-portal-shell .customer-mobile-bottom-nav {
  border-radius: 26px;
  padding: 7px;
  border: 1px solid rgb(255 255 255 / 92%);
  background: rgb(248 250 254 / 92%);
  box-shadow: 0 8px 32px rgb(20 35 59 / 16%), inset 0 1px 0 white;
}
body.sba-redesign .customer-portal-shell .customer-mobile-bottom-nav > button { border-radius: 20px; color: #46556c; }
body.sba-redesign .customer-portal-shell .customer-mobile-bottom-nav > button.active { background: rgb(225 233 246 / 92%); color: #1c3763; }
body.sba-redesign .customer-portal-shell .mobile-avatar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  background: linear-gradient(140deg, #fff, #e6edf6);
  color: #263b5a;
  border: 1px solid rgb(255 255 255 / 95%);
  box-shadow: 0 3px 12px rgb(25 44 75 / 9%);
}
body.sba-redesign .customer-portal-shell .mobile-avatar-button svg { width: 23px; height: 23px; }
body.sba-redesign .customer-portal-shell .mobile-nav-drawer {
  border-radius: 0 28px 28px 0;
  padding: 24px 18px;
  background: rgb(248 250 254 / 96%);
}
.customer-portal-shell .mobile-drawer-brand small { display: none; }
.customer-portal-shell .mobile-drawer-nav { gap: 5px; }
.customer-portal-shell .mobile-drawer-item { border-radius: 15px; min-height: 48px; color: #354762; }
.customer-portal-shell .mobile-drawer-item.active { background: #e4ebf6; color: #142e54; }
.customer-portal-shell .mobile-drawer-item > svg { width: 22px; height: 22px; }
.customer-portal-shell .mobile-drawer-item em { background: #e9edf4; color: #52647f; }
.customer-portal-shell .mobile-expert-toggle.readonly { display: none; }
body.sba-redesign .customer-portal-shell .mobile-drawer-brand strong { color: #203653; }
body.sba-redesign .customer-portal-shell .mobile-drawer-nav { padding: 7px; border-radius: 20px; background: rgb(255 255 255 / 72%); gap: 2px; }
body.sba-redesign .customer-portal-shell .mobile-drawer-item {
  border: 0;
  border-radius: 13px;
  min-height: 48px;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  color: #354762;
}
body.sba-redesign .customer-portal-shell .mobile-drawer-item.active { background: #e4ebf6 !important; color: #183354; }

/* Grouped, immediately effective preferences: clear controls, no full-page rerenders. */
body.sba-redesign .customer-portal-shell .sba-appearance-panel { padding: 28px; }
.sba-appearance-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.sba-appearance-heading h2 { margin: 6px 0 4px; font-size: 28px; letter-spacing: -.04em; }
.sba-appearance-heading p { margin: 0; font-size: 14px; color: #52637c; }
.sba-appearance-badge { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 20px; background: #e5ebf4; color: #344969; font-size: 12px; }
.sba-appearance-badge svg { width: 17px; height: 17px; }
.sba-appearance-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(275px, 1fr); gap: 32px; align-items: start; }
.sba-appearance-panel fieldset { min-width: 0; border: 0; margin: 0; padding: 0; }
.sba-appearance-panel legend { padding: 0; margin-bottom: 15px; font-size: 14px; font-weight: 650; color: #263a56; }
.sba-wallpaper-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 14px; }
.sba-wallpaper-option { position: relative; display: grid; align-content: start; gap: 4px; cursor: pointer; min-width: 0; }
.sba-wallpaper-option > input, .sba-segmented input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.sba-wallpaper-thumb { display: block; position: relative; border-radius: 16px; overflow: hidden; margin-bottom: 4px; box-shadow: 0 4px 12px rgb(26 45 74 / 10%); border: 3px solid transparent; }
.sba-wallpaper-thumb img { display: block; width: 100%; height: auto; aspect-ratio: 1.5; object-fit: cover; border-radius: 12px; clip-path: inset(0 round 12px); }
.sba-wallpaper-option > input:checked + .sba-wallpaper-thumb { border-color: #2e558d; }
.sba-wallpaper-option > input:focus-visible + .sba-wallpaper-thumb { outline: 3px solid #305ead; outline-offset: 3px; }
.sba-wallpaper-check { position: absolute; right: 6px; bottom: 6px; display: none; align-items: center; justify-content: center; width: 23px; height: 23px; border-radius: 50%; background: white; color: #1c467e; box-shadow: 0 2px 6px #25334b33; }
.sba-wallpaper-check svg { width: 15px; height: 15px; }
.sba-wallpaper-option > input:checked + .sba-wallpaper-thumb .sba-wallpaper-check { display: flex; }
.sba-wallpaper-option strong { font-size: 12px; line-height: 1.35; color: #20354f; }
.sba-wallpaper-option small { font-size: 10px; line-height: 1.4; color: #52637b; }
.sba-photo-credit { margin: 22px 0 0; color: #5e6d82; font-size: 10px; line-height: 1.6; }
.sba-appearance-controls { min-width: 0; border-left: 1px solid rgb(109 130 162 / 18%); padding-left: 28px; }
.sba-appearance-preview { position: relative; isolation: isolate; height: 160px; border-radius: 18px; overflow: hidden; border: 1px solid rgb(255 255 255 / 85%); box-shadow: 0 8px 24px #1a2c441f; margin-bottom: 22px; }
body.sba-redesign .customer-portal-shell .sba-appearance-preview { overflow: hidden !important; }
.sba-appearance-preview > img { position: absolute; z-index: -1; inset: -12px; width: calc(100% + 24px); max-width: none; height: calc(100% + 24px); object-fit: cover; filter: blur(var(--sba-wallpaper-blur, 3px)); }
.sba-mini-chrome { display: flex; gap: 4px; height: 20px; padding: 7px; background: #ffffff9e; }
.sba-mini-chrome i { width: 5px; height: 5px; border-radius: 50%; background: #3b4b6b7a; }
.sba-mini-widgets { display: flex; gap: 10px; padding: 14px 14px 10px; }
.sba-mini-widgets span { display: grid; place-items: center; width: 40%; height: 67px; border-radius: 12px; color: #3c526f; background: #ffffffc9; }
.sba-mini-widgets span + span { width: 60%; }
.sba-mini-dock { display: flex; justify-content: center; gap: 18px; width: 58%; margin: auto; padding: 6px; border-radius: 9px; background: #ffffffd4; color: #334c70; }
.sba-mini-dock svg { width: 17px; height: 17px; }
.sba-preference-group { padding: 18px 0 !important; border-top: 1px solid rgb(109 130 162 / 18%) !important; }
.sba-preference-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 13px; }
.sba-preference-title label, .sba-switch-row label { font-size: 13px; font-weight: 650; color: #293b55; }
.sba-preference-title output { white-space: nowrap; color: #546682; font-size: 11px; font-variant-numeric: tabular-nums; }
.sba-appearance-controls input[type='range'] { display: block; width: 100%; min-height: 30px; padding: 0; margin: 0; accent-color: #345888; cursor: pointer; }
.sba-range-labels { display: flex; justify-content: space-between; font-size: 10px; color: #617088; }
.sba-preference-group p, .sba-system-motion-note, .sba-appearance-save { font-size: 11px; line-height: 1.55; color: #53647e; margin: 9px 0 0; }
.sba-appearance-panel .sba-preference-group legend { margin: 0; padding-top: 18px; font-size: 13px; }
.sba-segmented { display: grid; grid-template-columns: 1fr 1fr; border-radius: 12px; background: #dee5ef; padding: 3px; gap: 3px; margin-top: 10px; }
.sba-segmented label { position: relative; cursor: pointer; min-width: 0; }
.sba-segmented span { display: grid; place-items: center; min-height: 44px; padding: 6px; border-radius: 9px; color: #4c5c75; font-size: 12px; font-weight: 550; }
.sba-segmented input:checked + span { background: white; color: #203756; box-shadow: 0 2px 5px #2037561a; }
.sba-segmented input:focus-visible + span { outline: 3px solid #305ead; outline-offset: 2px; }
.sba-switch-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.sba-switch-row .sba-switch { appearance: none; position: relative; flex: 0 0 44px; width: 44px; height: 44px; min-height: 44px; border: 0; border-radius: 12px; background: transparent; padding: 0; cursor: pointer; }
.sba-switch-row .sba-switch::before { content: ''; position: absolute; width: 44px; height: 27px; top: 8px; left: 0; background: #b7c2d2; border-radius: 20px; transition: background .2s; }
.sba-switch-row .sba-switch::after { content: ''; position: absolute; width: 21px; height: 21px; top: 11px; left: 3px; background: white; border-radius: 50%; box-shadow: 0 1px 3px #20375633; transition: transform .2s; }
.sba-switch-row .sba-switch:checked::before { background: #315782; }
.sba-switch-row .sba-switch:checked::after { transform: translateX(17px); }
.sba-appearance-reset { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; border: 1px solid #c5d0de; border-radius: 12px; margin-top: 18px; background: #ffffff82; color: #345074; font-size: 12px; }
.sba-appearance-reset svg { width: 16px; height: 16px; }
.sba-appearance-save { text-align: center; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .customer-portal-shell .sba-ref-dock button:hover .sba-ref-icon { transform: translateY(-3px); box-shadow: 0 8px 15px rgb(24 40 69 / 15%), inset 0 1px 1px white; }
}
@media (max-width: 1080px) {
  body.sba-redesign .customer-portal-shell > .mobile-portal-topbar { grid-template-columns: minmax(0, 1fr) auto; }
  body.sba-redesign .customer-portal-shell .mobile-menu-button { display: none; }
  .sba-appearance-layout { grid-template-columns: minmax(0, 1.3fr) minmax(255px, 1fr); gap: 22px; }
  .sba-wallpaper-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sba-appearance-controls { padding-left: 20px; }
}
@media (max-width: 640px) {
  body.sba-redesign .customer-portal-shell .property-news-line { grid-template-columns: 30px minmax(0, 1fr); gap: 10px; }
  body.sba-redesign .customer-portal-shell .property-news-line > .compact-action { grid-column: 2; justify-self: start; width: auto !important; min-width: 100px; white-space: nowrap; word-break: normal; }
  body.sba-redesign .customer-portal-shell .sba-vnext-quick-grid.sba-vnext-archive-folders { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px; }
  body.sba-redesign .customer-portal-shell .sba-vnext-archive-folders .sba-vnext-quick-card { padding: 16px; border-radius: 22px; gap: 8px; }
  .customer-portal-shell .sba-vnext-archive-folders h3 { font-size: 15px; overflow-wrap: anywhere; }
  body.sba-redesign .customer-portal-shell .sba-vnext-filter-pills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  body.sba-redesign .customer-portal-shell .sba-vnext-filter-pills button { min-width: 0; min-height: 44px; white-space: normal; padding: 8px; font-size: 12px; }
  body.sba-redesign .customer-portal-shell .sba-ref-finance-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.sba-redesign[data-workspace-appearance='on']::before { background-image: linear-gradient(180deg, rgb(248 250 255 / 32%), rgb(242 246 252 / 44%)), var(--sba-wallpaper-compact); }
  body.sba-redesign .customer-portal-shell .sba-ref-welcome { padding: 16px; border-radius: 22px; background: rgb(250 252 255 / 86%); }
  body.sba-redesign .customer-portal-shell .sba-ref-project-card { border-radius: 19px; }
  body.sba-redesign .customer-portal-shell .sba-ref-dock { border-radius: 26px; padding: 18px 10px 12px; gap: 16px 4px; }
  .customer-portal-shell .sba-ref-dock .sba-ref-icon { width: 52px; height: 52px; border-radius: 16px; }
  .customer-portal-shell .sba-ref-dock button { min-height: 77px; font-size: 10px; }
  .customer-portal-shell .sba-ref-section-head { padding: 13px; gap: 10px; }
  body.sba-redesign .customer-portal-shell .sba-appearance-panel { padding: 20px 16px; }
  .sba-appearance-heading { margin-bottom: 24px; gap: 8px; }
  .sba-appearance-heading h2 { font-size: 25px; }
  .sba-appearance-badge { display: none; }
  .sba-appearance-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .sba-appearance-controls { border-left: 0; padding-left: 0; }
  .sba-wallpaper-grid { gap: 17px 12px; }
  .sba-appearance-preview { height: 180px; }
  .sba-mini-widgets span { height: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  body.sba-redesign[data-workspace-appearance='on']::before { animation: none !important; transform: scale(1.025); }
  .customer-portal-shell :is(.sba-ref-dock .sba-ref-icon, .sba-switch, .sba-switch::before) { transition: none; }
}
@media (prefers-reduced-transparency: reduce) {
  body.sba-redesign .customer-portal-shell { --sba-glass: #f8fafc; }
  body.sba-redesign .customer-portal-shell :is(.sba-ref-dock, .customer-mobile-bottom-nav) { background: #f8fafc; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
}
