#spa-workspace, .sw-dialog {
  --sw-control-height: 44px;
  --sw-control-radius: 10px;
  --sw-control-padding: 14px;
  --sw-space: clamp(16px, 2vw, 24px);
}
.spa-workspace-body #main { min-height: 72svh; padding: var(--page-start) 0 var(--page-end); }
.spa-workspace-body .footer-wordmark { display: none; }
.sw-layout { width: min(var(--wrap), calc(100% - 2 * var(--gutter))); margin-inline: auto; display: grid; grid-template-columns: 220px minmax(0,1fr); gap: var(--content-gap); }
.sw-sidebar { align-self: start; position: sticky; top: calc(var(--header-height) + 24px); max-height: calc(100svh - var(--header-height) - 48px); overflow: auto; padding-right: 8px; scrollbar-width: thin; }
.sw-sidebar-title { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin: 0 12px 24px; }
.sw-nav-group { margin: 24px 0 8px; padding-inline: 12px; color: var(--text-3); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.sw-nav a { display: flex; align-items: center; min-height: 42px; padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.4; color: var(--text-2); text-decoration: none; }
.sw-nav a:hover { background: var(--panel); color: var(--text); }
.sw-nav a[aria-current=page] { background: var(--accent-soft); color: var(--accent); font-weight: 600; box-shadow: inset 2px 0 var(--accent); }
.sw-sidebar-account { border-top: 1px solid var(--line); padding: 20px 12px 0; margin-top: 24px; font-size: 12px; color: var(--text-3); overflow-wrap: anywhere; }
.sw-sidebar-account strong { display: block; color: var(--text); margin-bottom: 4px; }
.sw-mobile-nav { display: none; }
.sw-main,.sw-main > * { min-width: 0; }
[data-setting-editor] { scroll-margin-top: calc(var(--header-height) + 20px); }
[data-setting-editor] > .sw-panel > .sw-panel { padding: 0; border: 0; border-radius: 0; margin: 24px 0 0; }
.sw-team-permission-groups { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 16px; }
.sw-team-permissions { min-width: 0; margin: 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; }
.sw-team-permissions legend { padding-inline: 6px; color: var(--text); font-size: 13px; font-weight: 600; }
.sw-team-permission { align-items: flex-start; padding-block: 8px; margin: 4px 0; }
.sw-team-permission input { margin-top: 3px; }
.sw-team-permission strong { display: block; color: var(--text); font-size: 14px; font-weight: 550; }
.sw-team-permission small { display: block; font-size: 12px; line-height: 1.6; color: var(--text-3); margin-top: 3px; }
.sw-team-permission:has(input:disabled) { opacity: .6; }
.sw-team-email { overflow-wrap: anywhere; }
[data-setting-editor] > [data-setting-form="member"] > h3,[data-setting-editor] > [data-setting-form="team-invitation"] > h3 { margin-top: 0; font-size: 22px; }
.sw-team-form-actions { position: sticky; bottom: 0; z-index: 1; padding-block: 12px; background: var(--panel); border-top: 1px solid var(--line); }
.sw-team-form-actions .sw-button { flex: 1 1 auto; }
.sw-team-record > div:first-child { flex: 1 1 230px; }
.sw-team-record > .sw-actions { flex: 0 1 240px; }
.sw-team-grants { font-size: 13px; }
.sw-permission-summary { margin: 8px 0 16px; padding-inline-start: 20px; color: var(--text-2); font-size: 13px; line-height: 1.8; }
.sw-invitation-gate { width: min(720px,calc(100% - 2 * var(--gutter))); }
.sw-team-invitation { text-align: left; margin-block: 24px; }
.sw-team-invitation h2 { margin: 0; font-size: 23px; letter-spacing: -.03em; }
.sw-invite-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.sw-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: var(--content-gap); }
.sw-heading h1 { margin: 6px 0 12px; font-size: clamp(30px,4vw,42px); font-weight: 600; line-height: 1.12; letter-spacing: -.045em; }
/* The section title receives focus for screen reader orientation after navigation. */
.sw-heading h1[tabindex="-1"]:focus { outline: none; }
.sw-heading p { margin: 0; color: var(--text-2); font-size: 14px; max-width: 65ch; }
.sw-kicker { color: var(--accent); font-size: 11px; line-height: 1.5; letter-spacing: .08em; text-transform: uppercase; }
.sw-workspace-controls { flex: 0 1 300px; min-width: 200px; }
.sw-location { min-width: 0; }
.sw-location-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; line-height: 44px; }
.sw-location .sw-field { margin-bottom: 0; }
.sw-location a { font-size: 12px; color: var(--accent); display: inline-block; margin-top: 8px; text-decoration: none; }
.sw-panel { padding: var(--panel-padding); border: 1px solid var(--line); border-radius: 22px; background: var(--panel); margin: 0 0 var(--content-gap); min-width: 0; }
.sw-panel h2 { margin: 0 0 20px; font-size: 21px; line-height: 1.25; font-weight: 600; letter-spacing: -.03em; }
.sw-panel h3 { margin: 24px 0 12px; font-size: 17px; line-height: 1.35; letter-spacing: -.02em; }
.sw-panel p { font-size: 14px; color: var(--text-2); }
.sw-panel > :first-child { margin-top: 0; }
.sw-panel > :last-child { margin-bottom: 0; }
.sw-grid,.sw-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--sw-space); }
.sw-grid > *,.sw-fields > * { min-width: 0; }
.sw-stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(150px,100%),1fr)); gap: 16px; margin: 24px 0; }
.sw-stats > div { display: grid; align-content: start; gap: 10px; padding: 20px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
.sw-stats span { font-size: 12px; color: var(--text-2); }
.sw-stats strong { font-size: clamp(22px,2.3vw,30px); line-height: 1.2; letter-spacing: -.035em; font-weight: 600; }
.sw-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; font-size: 13px; font-weight: 500; color: var(--text-2); margin: 0 0 20px; }
.sw-field input,.sw-field select,.sw-field textarea,.sw-mobile-nav select { width: 100%; min-width: 0; min-height: var(--sw-control-height); border: 1px solid var(--line-2); border-radius: var(--sw-control-radius); background: var(--panel); color: var(--text); font: inherit; font-size: 15px; line-height: 1.5; padding: 9px var(--sw-control-padding); }
.sw-field select,.sw-mobile-nav select {
  box-sizing: border-box;
  max-width: 100%;
  padding-inline-end: 22px;
  text-overflow: ellipsis;
}
.sw-field textarea { min-height: 112px; resize: vertical; }
/* iPhone Safari draws date and time fields at their own width with the value centred, so
   they ran past the edge of narrow forms. Drawn plainly they fill their column and line up
   with every other field. */
.sw-field input:is([type=date],[type=time],[type=datetime-local],[type=month]) { display: block; -webkit-appearance: none; appearance: none; text-align: left; }
.sw-field input::-webkit-date-and-time-value { text-align: left; min-height: 1.5em; }
.sw-field input[type=file] { font-size: 13px; padding: 5px 8px; }
.sw-field input::file-selector-button { border: 0; border-radius: 6px; padding: 8px 10px; margin-inline-end: 10px; color: var(--text); background: var(--accent-soft); font: inherit; cursor: pointer; }
.sw-fields .sw-field { margin-bottom: 0; }
.sw-fields { margin-bottom: 24px; }
.sw-check { display: flex; align-items: center; gap: 10px; min-height: var(--sw-control-height); padding-block: 6px; margin: 8px 0; font-size: 14px; line-height: 1.6; color: var(--text-2); }
.sw-check input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.sw-button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: var(--sw-control-height); border: 1px solid var(--line-2); border-radius: var(--sw-control-radius); padding: 9px var(--sw-control-padding); background: var(--panel); color: var(--text); font: inherit; font-weight: 550; font-size: 13px; line-height: 1.4; text-align: center; text-decoration: none; cursor: pointer; }

.sw-button.primary,.sw-button-primary,button.sw-button[type=submit],.sw-panel form > button.sw-button:not([type]) { background: var(--accent); border-color: var(--accent); color: white; }
.sw-button:enabled:hover,.sw-button[href]:hover { box-shadow: inset 0 0 0 100px #00000009; }
.sw-button:enabled:active,.sw-button[href]:active { box-shadow: inset 0 0 0 100px #00000015; }
.sw-button.danger,.sw-button-danger { color: #a63345; border-color: #dfb7bd; }
.sw-button:disabled { opacity: .5; cursor: default; }
.sw-actions { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.sw-actions .sw-field { margin: 0; flex: 1 1 170px; max-width: 340px; }
.sw-actions .sw-button { flex: 0 1 auto; }
.sw-panel > .sw-actions:first-child { align-items: center; justify-content: space-between; }
.sw-panel > .sw-actions:first-child > h2 { margin: 0; }
.sw-fields > .sw-button { align-self: end; }
.sw-main > section > .sw-actions:first-child { margin-top: 0; }
.sw-table-wrap { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; border: 1px solid var(--line); border-radius: 14px; margin-block: 20px; }
.sw-table { border-collapse: collapse; width: 100%; text-align: left; font-size: 13px; line-height: 1.5; }
.sw-table th { color: var(--text-2); background: var(--bg); font-size: 12px; font-weight: 500; white-space: nowrap; }
.sw-table td,.sw-table th { padding: 15px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.sw-table tr:last-child td { border-bottom: 0; }
.sw-table td { min-width: 100px; overflow-wrap: anywhere; }
.sw-table td .sw-button { white-space: nowrap; }
.sw-list { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 12px; }
.sw-record { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); min-width: 0; }
.sw-record:is(section,fieldset),.sw-record:has(> :is(h3,h4,strong,img)) { display: grid; justify-content: stretch; gap: 10px; }
.sw-panel > .sw-record + .sw-record { margin-top: 12px; }
.sw-record :is(h3,h4) { margin: 0; }
.sw-record .sw-fields:last-child { margin-bottom: 0; }
.sw-record legend { padding-inline: 6px; font-size: 13px; font-weight: 600; }
.sw-photo { width: 112px; height: 84px; object-fit: cover; border-radius: var(--sw-control-radius); }
/* Treatment photos: the app's square thumbnail, or its soft placeholder. */
.sw-record.sw-service-record { display: grid; justify-content: stretch; gap: 12px; }
.sw-service-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; min-width: 0; }
.sw-service-head > div { min-width: 0; overflow-wrap: anywhere; }
.sw-service-thumb { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 10px; overflow: hidden; background: var(--accent-soft, #EFECFA); color: var(--text-3); }
.sw-service-thumb.large { width: 64px; height: 64px; border-radius: 12px; }
.sw-service-thumb.is-empty { opacity: .6; }
.sw-service-thumb:not(.is-empty) > svg,.sw-service-thumb > img[hidden] { display: none; }
.sw-service-thumb > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sw-service-thumb.is-uploading > img { opacity: .5; }
.sw-service-photo { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 8px; }
.sw-service-photo-pick { position: relative; flex: 1 1 260px; display: flex; align-items: center; gap: 14px; min-width: 0; min-height: 88px; padding: 12px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--panel); cursor: pointer; }
.sw-service-photo-pick.is-static { cursor: default; border-color: var(--line); }
.sw-service-photo-pick:not(.is-static):hover { box-shadow: inset 0 0 0 100px #00000006; }
.sw-service-photo-pick:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.sw-service-photo-pick:has(input:disabled) { cursor: progress; }
.sw-service-photo-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.sw-service-photo-copy { display: grid; gap: 2px; min-width: 0; }
.sw-service-photo-copy strong { color: var(--accent); font-size: 15px; font-weight: 600; }
.sw-service-photo-pick.is-static .sw-service-photo-copy strong { color: var(--text); }
.sw-service-photo-copy .sw-muted.is-error { color: #982d44; }
.sw-record p { margin: 6px 0; }
.sw-record > div { min-width: 0; overflow-wrap: anywhere; }
.sw-record .sw-actions { margin: 0; }
.sw-empty { padding: 32px 20px; text-align: center; color: var(--text-3); font-size: 14px; }
.sw-section-loading { min-height: 112px; margin: 0; }
.sw-notice { padding: 16px 20px; border-radius: 14px; background: var(--accent-soft); color: var(--text); font-size: 14px; line-height: 1.6; margin: 0 0 24px; overflow-wrap: anywhere; }
.sw-notice:is(.sw-error,.error),.sw-error { color: #982d44; background: #fff1f3; border-color: #f3d4dc; }
.sw-muted { color: var(--text-3); font-size: 12px; line-height: 1.7; }
.sw-prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.sw-preline { white-space: pre-line; overflow-wrap: anywhere; }
.sw-gate { width: min(600px,calc(100% - 2 * var(--gutter))); margin: 0 auto; padding: clamp(32px,5vw,56px) var(--panel-padding); border: 1px solid var(--line); border-radius: 24px; background: var(--panel); text-align: center; }
.sw-gate h1 { margin: 12px 0; font-size: 34px; line-height: 1.15; letter-spacing: -.04em; }
.sw-gate p { color: var(--text-2); font-size: 14px; }
.sw-gate .sw-actions { justify-content: center; margin-bottom: 0; }
.sw-dialog { width: min(780px,calc(100vw - 2 * var(--gutter))); max-height: calc(100dvh - 2 * var(--gutter)); padding: 0; border: 1px solid var(--line-2); border-radius: 22px; background: var(--panel); color: var(--text); box-shadow: 0 20px 90px #10101433; }
.sw-dialog::backdrop { background: #10101466; backdrop-filter: blur(4px); }
.sw-dialog-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 24px var(--panel-padding); border-bottom: 1px solid var(--line); background: var(--panel); }
.sw-dialog-head h2 { margin: 0; font-size: 20px; line-height: 1.3; letter-spacing: -.025em; }
.sw-dialog-body { padding: var(--panel-padding); }
.sw-dialog-body h3 { margin: var(--sw-space) 0 8px; }
.sw-dialog [data-dialog-error]:not(:empty) { margin: 12px var(--panel-padding) 0; }
.sw-dialog-body > :first-child { margin-top: 0; }
.sw-dialog :is(input,select,textarea) { max-width: 100%; }
.sw-dialog .sw-panel { border: 0; padding: 0; border-radius: 0; }
/* Add appointment: who is it for? A search, a scrolling list of Clients, and New client. */
.sw-client-picker { display: grid; gap: 14px; }
.sw-client-picker > p { margin: 0; }
.sw-client-new { width: 100%; }
.sw-client-new svg { flex: none; }
.sw-client-search { margin: 0; }
.sw-client-search-box { position: relative; }
.sw-client-search-box svg { position: absolute; inset-inline-start: 12px; top: 50%; translate: 0 -50%; color: var(--text-3); pointer-events: none; }
.sw-client-search-box input { width: 100%; min-width: 0; min-height: var(--sw-control-height); border: 1px solid var(--line-2); border-radius: var(--sw-control-radius); background: var(--panel); color: var(--text); font: inherit; font-size: 15px; line-height: 1.5; padding: 9px var(--sw-control-padding) 9px 40px; }
.sw-client-results { min-height: 180px; max-height: min(46dvh,420px); overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.sw-client-results[aria-busy=true] .sw-client-list { opacity: .6; }
.sw-client-results > .sw-empty,.sw-client-status { margin: 0; padding: 28px 18px; text-align: center; }
.sw-client-results > .sw-notice { margin: 12px; }
.sw-client-results > .sw-button { display: flex; width: calc(100% - 24px); margin: 4px 12px 12px; }
.sw-client-list { list-style: none; margin: 0; padding: 0; }
.sw-client-row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; margin: 0; padding: 10px 14px; border: 0; border-radius: 0; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.sw-client-list li + li .sw-client-row::before { content: ""; position: absolute; top: 0; inset-inline: 62px 0; border-top: 1px solid var(--line); }
.sw-client-row:hover { background: var(--bg); }
.sw-client-row:active { background: var(--accent-soft); }
.sw-client-row > svg { flex: none; color: var(--text-3); }
.sw-dialog .sw-client-row:focus-visible { outline-offset: -3px; }
.sw-client-avatar { flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.sw-client-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.sw-client-name,.sw-client-contact { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-client-name { font-size: 15px; font-weight: 500; }
.sw-client-contact { font-size: 13px; color: var(--text-2); }
.sw-client-picked { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.sw-client-picked .sw-button { flex: none; }
.sw-client-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 12px; }
.sw-dialog-body .sw-client-head h3 { margin: 0; font-size: 16px; }
#spa-workspace :is(a,button,input,select,textarea,summary):focus-visible,
.sw-dialog :is(a,button,input,select,textarea,summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* Keep the highlight inside the native control, even in a narrow form. */
#spa-workspace .sw-nav a:focus-visible,
#spa-workspace select:focus-visible,
.sw-dialog select:focus-visible { outline-offset: -3px; }
.sw-main details > summary { min-height: 44px; cursor: pointer; color: var(--accent); font-size: 14px; padding-block: 10px; }
.sw-main code { font-size: 12px; overflow-wrap: anywhere; }
@media(max-width:1100px) { .sw-layout { grid-template-columns: 190px minmax(0,1fr); } .sw-heading { flex-direction: column; } .sw-workspace-controls { flex: none; width: 100%; max-width: 420px; } }
@media(max-width:900px) {
  .sw-layout { display: block; }
  .sw-sidebar { display: none; }
  .sw-heading { gap: 16px; margin-bottom: 16px; }
  .sw-heading-copy { order: 1; }
  .sw-heading h1 { margin: 0; font-size: 28px; }
  .sw-heading p,.sw-heading .sw-kicker,.sw-location > a { display: none; }
  .sw-workspace-controls { order: 0; display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); gap: 10px; min-width: 0; max-width: none; width: 100%; }
  .sw-mobile-nav { display: block; min-width: 0; }
  .sw-workspace-controls .sw-field { margin: 0; }
  .sw-workspace-controls .sw-field > span,.sw-mobile-nav label,
  #spa-workspace[data-workspace-view="calendar"] .sw-heading-copy { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  #spa-workspace[data-workspace-view="calendar"] .sw-heading { margin-bottom: 12px; }
}
@media(max-width:600px) {
  #spa-workspace,.sw-dialog { --sw-control-padding: 12px; --sw-space: 14px; --panel-padding: 16px; }
  .spa-workspace-body #main { padding-top: 20px; }
  .sw-sidebar,.sw-heading,.sw-panel { margin-bottom: 16px; }
  .sw-heading { gap: 14px; }
  .sw-heading h1 { margin: 0; font-size: 26px; }
  .sw-location { min-width: 0; max-width: none; }
  .sw-grid,.sw-fields { grid-template-columns: minmax(0,1fr); }
  .sw-team-permission-groups { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .sw-team-permissions { padding: 10px 12px; }
  .sw-team-record > .sw-actions { flex-basis: 100%; }
  .sw-team-record > .sw-actions .sw-button { flex: 1 1 auto; }
  .sw-team-invitation { padding: 16px; }
  .sw-invitation-gate { padding-inline: 16px; }
  .sw-fields,.sw-field { margin-bottom: 16px; }
  .sw-stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .sw-stats > div { padding: 14px; }
  .sw-stats strong { font-size: 23px; }
  .sw-list { margin-block: 16px; }
  .sw-record { flex-wrap: wrap; padding: 14px; gap: 12px; }
  .sw-record .sw-actions { width: 100%; }
  .sw-actions { gap: 8px; margin-block: 16px; }
  .sw-field input,.sw-field select,.sw-field textarea,.sw-mobile-nav select,.sw-client-search-box input { font-size: 16px; }
  .sw-table-wrap { margin-inline: 0; }
  .sw-dialog-head { padding-block: 12px; gap: 10px; }
  .sw-dialog-head h2 { font-size: 18px; }
}
@media(max-width:380px) { .sw-stats { grid-template-columns: minmax(0,1fr); } }
@media(prefers-reduced-motion:reduce) { .sw-dialog::backdrop { backdrop-filter: none; } }

/* Month calendar: the viewport grows, while the page and controls stay at reading size. */
.sw-calendar-panel { padding: 24px; }
.sw-cal { --sw-cal-soft: var(--accent-soft, #EFECFA); --sw-cal-on-accent: var(--on-accent, #FFFFFF); --sw-cal-cell: 112px; }
.sw-cal-head { display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; align-items: center; gap: 12px; margin-bottom: 12px; }
.sw-panel .sw-cal-title { margin: 0; color: var(--text); text-align: center; font-size: 25px; font-weight: 600; line-height: 1.25; letter-spacing: -.035em; }
.sw-cal-step { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; }
.sw-cal-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.sw-cal-toolbar > [data-op=cal-today] { margin-right: auto; }
.sw-cal-zoom { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 11px; overflow: hidden; }
.sw-cal-zoom .sw-button { min-width: 44px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 0; font-size: 20px; }
.sw-cal-zoom .sw-cal-fit { min-width: 56px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sw-cal-add-button { background: var(--accent); color: var(--on-accent,#fff); border-color: var(--accent); white-space: nowrap; }
.sw-panel p.sw-cal-status { margin: 0 0 12px; }
.sw-cal-viewport { width: 100%; max-height: min(72svh,760px); overflow: auto; overscroll-behavior-x: contain; touch-action: pan-x pan-y; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); scrollbar-width: thin; }
.sw-cal-grid { width: calc(100% * var(--sw-cal-zoom,1)); min-width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; background: var(--panel); }
.sw-cal-grid th { padding: 10px 6px; border-bottom: 1px solid var(--line); color: var(--text-3); font-size: 12px; font-weight: 500; line-height: 1.4; text-align: center; }
.sw-cal-wd-narrow { display: none; }
.sw-cal-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.sw-cal-grid td { padding: 0; vertical-align: top; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sw-cal-grid td:last-child { border-right: 0; }
.sw-cal-grid tbody tr:last-child td { border-bottom: 0; }
.sw-cal-day { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 4px; width: 100%; min-height: calc(var(--sw-cal-cell) * var(--sw-cal-zoom,1)); margin: 0; padding: 7px 8px 9px; border: 0; border-radius: 0; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.sw-cal-day:enabled:hover { box-shadow: inset 0 0 0 100px #00000007; }
.sw-cal-day:enabled:active { box-shadow: inset 0 0 0 100px #00000010; }
.sw-cal-day:disabled { cursor: default; }
.sw-cal-grid[aria-busy=true] .sw-cal-day { color: var(--text-3); }
#spa-workspace .sw-cal-day:focus-visible { outline-offset: -3px; border-radius: 9px; }
.sw-cal-outside,.sw-cal-grid td:has(> .sw-cal-outside) { background: color-mix(in srgb,var(--line) 16%,var(--panel)); }
.sw-cal-outside { color: var(--text-3); }
.sw-cal-outside .sw-cal-events { opacity: .7; }
.sw-cal-day[aria-pressed=true],.sw-cal-grid td:has(> .sw-cal-day[aria-pressed=true]) { background: var(--sw-cal-soft); }
.sw-cal-num { display: flex; align-items: center; min-height: 28px; font-size: 13px; font-weight: 500; line-height: 1; }
.sw-cal-mon { font-weight: 600; }
.sw-cal-digit { display: inline-flex; justify-content: center; align-items: center; min-width: 28px; height: 28px; padding: 0 5px; border-radius: 50%; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sw-cal-day[aria-pressed=true] .sw-cal-digit { box-shadow: inset 0 0 0 1.5px var(--accent); font-weight: 600; }
.sw-cal-today .sw-cal-digit { background: var(--accent); color: var(--sw-cal-on-accent); font-weight: 600; }
.sw-cal-today[aria-pressed=true] .sw-cal-digit { box-shadow: 0 0 0 2px var(--panel),0 0 0 3.5px var(--accent); }
.sw-cal-count { display: none; }
.sw-cal-events { display: grid; gap: 3px; min-width: 0; }
.sw-cal-event { position: relative; display: block; min-width: 0; padding-left: 11px; overflow: hidden; color: var(--text); font-size: 12px; line-height: 18px; white-space: nowrap; text-overflow: ellipsis; }
.sw-cal-event::before { content: ""; position: absolute; left: 1px; top: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.sw-cal-time { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.sw-cal-event-cancelled { color: var(--text-3); text-decoration: line-through; }
.sw-cal-event-cancelled .sw-cal-time { color: inherit; }
.sw-cal-event-cancelled::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.sw-cal-more { padding-left: 11px; color: var(--text-3); font-size: 11px; font-weight: 600; line-height: 16px; }
.sw-panel .sw-cal-hint { margin: 10px 0 0; font-size: 11px; }
.sw-cal-agenda { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header-height) + 12px); }
.sw-cal-agenda-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.sw-panel .sw-cal-agenda-head h3 { margin: 0; font-size: 19px; }
.sw-panel .sw-cal-agenda-head p { margin: 0; }
.sw-cal-agenda .sw-list { margin: 12px 0 0; gap: 0; }
.sw-cal-agenda .sw-record { padding: 16px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.sw-cal-agenda .sw-record:last-child { border-bottom: 0; }
.sw-cal-agenda .sw-record h3 { font-size: 16px; }
.sw-cal-agenda .sw-empty { padding: 20px 0; text-align: left; }
.sw-cal-cancelled h3 { color: var(--text-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.sw-cal-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 20px; }
.sw-cal-add p { margin: 0; flex: 1 1 260px; }
.sw-cal-event-manual::before { border-radius: 1px; }
.sw-cal-event-manual.sw-cal-event-cancelled::before { background: transparent; }
.sw-cal-help { margin-top: 20px; border-top: 1px solid var(--line); }
.sw-cal-help summary { font-size: 12px; }
.sw-panel p.sw-cal-zone { margin: 8px 0; }
.sw-panel p.sw-cal-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 6px 0 0; }
.sw-cal-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.sw-cal-key { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.sw-cal-key-manual { border-radius: 1px; }
.sw-panel h3.sw-subhead { margin: 24px 0 10px; font-size: 15px; font-weight: 600; }
@media(max-width:900px) { .sw-cal-day { padding-inline: 6px; } }
@media(max-width:600px) {
  .sw-calendar-panel { padding: 12px; }
  .sw-cal { --sw-cal-cell: clamp(44px,calc((100svh - 300px) / 6),66px); }
  .sw-cal-head { gap: 8px; margin-bottom: 8px; }
  .sw-panel .sw-cal-title { font-size: 21px; }
  .sw-cal-toolbar { gap: 6px; margin-bottom: 12px; }
  .sw-cal-toolbar > .sw-button { padding-inline: 12px; }
  .sw-cal-add-label { display: none; }
  .sw-cal-zoom .sw-button { padding-inline: 6px; }
  .sw-cal-zoom .sw-cal-fit { min-width: 46px; }
  .sw-cal-viewport { max-height: max(310px,calc(100svh - 260px)); border-radius: 10px; }
  .sw-cal-grid th { padding: 8px 0; font-size: 11px; }
  .sw-cal-wd { display: none; }
  .sw-cal-wd-narrow { display: inline; }
  .sw-cal-day { align-items: center; gap: 2px; padding: 4px 1px 5px; }
  .sw-cal-mon,.sw-cal-events { display: none; }
  .sw-cal-num { min-height: 28px; font-size: 13px; }
  .sw-cal-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 15px; padding: 0 4px; border-radius: 7px; background: var(--sw-cal-soft); color: var(--accent); font-size: 10px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
  .sw-cal-day[aria-pressed=true] .sw-cal-count { background: var(--panel); }
  .sw-cal[data-cal-detail=true] .sw-cal-day { align-items: stretch; padding-inline: 5px; }
  .sw-cal[data-cal-detail=true] .sw-cal-events { display: grid; }
  .sw-cal[data-cal-detail=true] .sw-cal-count { display: none; }
  .sw-cal[data-cal-detail=true] .sw-cal-wd { display: inline; }
  .sw-cal[data-cal-detail=true] .sw-cal-wd-narrow { display: none; }
  .sw-cal-agenda { margin-top: 18px; padding-top: 16px; }
  .sw-cal-agenda .sw-record .sw-actions { width: auto; }
}
@media(max-width:350px) {
  .sw-calendar-panel { padding: 10px; }
  .sw-cal-toolbar { gap: 4px; }
  .sw-cal-toolbar > .sw-button { padding-inline: 9px; }
  .sw-cal-zoom .sw-button { min-width: 44px; }
  .sw-cal-zoom .sw-cal-fit { min-width: 44px; }
}
@media(max-width:600px) and (max-height:700px) {
  .sw-cal[data-cal-detail=false] .sw-cal-day { gap: 0; padding-block: 2px; }
  .sw-cal[data-cal-detail=false] .sw-cal-num { min-height: 24px; }
  .sw-cal[data-cal-detail=false] .sw-cal-digit { height: 24px; min-width: 24px; }
  .sw-cal[data-cal-detail=false] .sw-cal-count { height: 12px; min-width: 16px; font-size: 9px; }
}

/* Waitlist: each opening lists the clients it fits, each with its own contact buttons. */
.sw-waitlist-opening > div { flex: 1; min-width: 0; }
.sw-waitlist-matches { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.sw-waitlist-match { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.sw-waitlist-match:first-child { padding-top: 0; border-top: 0; }
.sw-waitlist-match > div:first-child { min-width: 0; flex: 1 1 220px; }
.sw-waitlist-match p { margin: 3px 0 0; }

/* My schedule: inset grouped lists and sheets in the style of the booking pop-up. */
.sw-schedule-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.sw-schedule-head h3 { margin: 0 0 4px; }
.sw-schedule-head p { margin: 0; max-width: 56ch; }
.sw-schedule-head .sw-button { flex: none; }
.sw-schedule-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--panel); }
.sw-schedule-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 10px 16px; }
.sw-schedule-row + .sw-schedule-row { border-top: 1px solid var(--line); }
.sw-schedule-label { display: grid; gap: 2px; min-width: 0; }
.sw-schedule-day { font-size: 15px; font-weight: 550; color: var(--text); }
.sw-schedule-salon { font-size: 12px; line-height: 1.4; color: var(--text-3); }
.sw-schedule-value { flex: none; font-size: 15px; line-height: 1.45; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.sw-schedule-value > span { display: block; white-space: nowrap; }
.sw-schedule-salon { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-schedule-row.is-off .sw-schedule-value { color: var(--text-3); }
.sw-schedule-row .sw-button { min-height: 36px; padding-block: 6px; }
.sw-schedule-dialog { width: min(560px,calc(100vw - 2 * var(--gutter))); }
.sw-schedule-sheet > p:first-child { margin-top: 0; }
.sw-sheet-day { padding: 12px 0; border-top: 1px solid var(--line); }
.sw-sheet-day:first-of-type { border-top: 0; }
.sw-sheet-day-head { display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "day toggle" "salon toggle"; align-items: center; column-gap: 12px; }
.sw-sheet-day-title { grid-area: day; font-size: 15px; font-weight: 600; color: var(--text); }
.sw-sheet-salon { grid-area: salon; font-size: 12px; color: var(--text-3); }
.sw-sheet-day-head .sw-switch,.sw-sheet-closed { grid-area: toggle; }
.sw-sheet-closed { font-size: 14px; color: var(--text-3); }
.sw-sheet-ranges { display: grid; gap: 8px; margin-top: 10px; }
.sw-sheet-ranges[hidden],.sw-sheet-range[hidden],.sw-sheet-add[hidden],[data-off-times][hidden],[data-off-through][hidden] { display: none; }
.sw-sheet-range { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) auto; align-items: center; gap: 8px; }
.sw-sheet-range > span { color: var(--text-3); font-size: 13px; }
.sw-sheet-range select { box-sizing: border-box; width: 100%; min-width: 0; min-height: var(--sw-control-height); border: 1px solid var(--line-2); border-radius: var(--sw-control-radius); background: var(--panel); color: var(--text); font: inherit; font-size: 15px; padding: 9px 22px 9px var(--sw-control-padding); font-variant-numeric: tabular-nums; }
.sw-sheet-range:first-child { grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); }
.sw-sheet-add,.sw-sheet-remove { min-height: 36px; border-color: transparent; background: none; color: var(--accent); padding-inline: 8px; }
.sw-sheet-add { justify-self: start; padding-inline: 0; }
.sw-sheet-remove { color: #a63345; }
.sw-switch { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.sw-switch input { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 51px; height: 31px; margin: 0; border-radius: 999px; background: var(--line-2); cursor: pointer; transition: background .2s ease; }
.sw-switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px #00000026,0 1px 1px #00000029; transition: transform .2s ease; }
.sw-switch input:checked { background: #34C759; }
.sw-switch input:checked::after { transform: translateX(20px); }
.sw-switch input:disabled { opacity: .45; cursor: default; }
.sw-switch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sw-sheet-switch { margin: 4px 0 16px; }
.sw-sheet-actions { position: sticky; bottom: calc(-1 * var(--panel-padding)); z-index: 1; display: flex; justify-content: flex-end; gap: 10px; margin: 16px calc(-1 * var(--panel-padding)) calc(-1 * var(--panel-padding)); padding: 12px var(--panel-padding); border-top: 1px solid var(--line); background: var(--panel); }
@media (prefers-reduced-motion: reduce) { .sw-switch input,.sw-switch input::after { transition: none; } }
@media(max-width:600px) {
  .sw-schedule-head { flex-direction: column; gap: 12px; }
  .sw-schedule-head .sw-button { width: 100%; }
  .sw-schedule-row { padding-inline: 14px; }
  .sw-sheet-range select { font-size: 16px; padding-inline-start: 10px; }
  .sw-sheet-actions .sw-button { flex: 1 1 0; }
  .sw-schedule-dialog[open] { width: 100%; max-width: none; max-height: calc(100dvh - 12px); margin: auto 0 0; border-radius: 22px 22px 0 0; border-bottom: 0; }
}

/* Card on file (late-cancellation and no-show fees) on the appointment panel. */
.sw-cof { display: grid; gap: 10px; margin: 24px 0 0; padding: 20px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); }
.sw-cof h4 { margin: 0; }
.sw-cof-row { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; overflow-wrap: anywhere; }
.sw-cof-row span { color: var(--text-2); font-size: 14px; }
.sw-cof-total { padding-top: 10px; border-top: 1px solid var(--line); font-size: 17px; }
.sw-cof-history ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.sw-team-fee-charging { margin-top: 8px; }
