/* Shared surface geometry. Keep it last so page variants use the same corners. */
:root {
 --card-outer-corner:38.4px;
 --surface-corner:var(--card-outer-corner);
 --surface-curve:squircle;
 --card-inner-corner:33.6px;
 --inset-corner:var(--card-inner-corner);
 --popover-corner:55.2px;
 --sheet-corner:62.4px;
 --compact-corner:31.2px;
 --field-corner:min(var(--small-control-corner),calc(var(--control-height,48px) / 3));
 --small-control-corner:min(var(--compact-corner),19.2px);
 --menu-item-corner:max(0px,min(var(--compact-corner),calc(var(--popover-corner) - var(--compact-gap,8px) - var(--compact-gap,8px))));
}
/* Mobile panels use a concentric pair at the standard 12px content inset.
   Keep concrete lengths here for the WebKit continuous-corner renderer. */
@media (max-width:650px) {
 body:is(.panel-typography,.owner-page) {
  --card-outer-corner:44px;
  --card-inner-corner:32px;
  --surface-corner:var(--card-outer-corner);
  --inset-corner:var(--card-inner-corner);
 }
}
html[data-theme] body :is(.button,.custom-select-trigger,.date-trigger,input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=range]),textarea){corner-shape:var(--surface-curve)}
html[data-theme] body .button{border-radius:var(--compact-corner);corner-shape:var(--surface-curve)}
html[data-theme] body .week-day-switch>button{corner-shape:var(--surface-curve)}
@supports not (corner-shape:squircle){
 html[data-theme] body .continuous-corner-measuring{transition-property:transform,box-shadow,opacity,color,filter!important}
 html[data-theme] body .continuous-native-surface.continuous-corner-ready:is(:hover:where(:not(html[data-hover-disabled] *)),:focus,:focus-visible,:focus-within,[aria-expanded="true"]):not(:disabled){border-color:transparent!important}
 html[data-theme] body .continuous-native-surface{border-radius:0!important;clip-path:var(--continuous-path);border-color:transparent!important;background-image:var(--continuous-surface-border),var(--continuous-surface-image)!important;background-size:100% 100%,var(--continuous-surface-size)!important;background-position:0 0,var(--continuous-surface-position)!important;background-repeat:no-repeat,var(--continuous-surface-repeat)!important;background-origin:border-box,padding-box!important;background-clip:border-box!important}
 .date-month-selects .custom-select-trigger.continuous-native-surface { --field-state-border:transparent; }
 html[data-theme] body .continuous-native-surface:focus-visible{outline-offset:-2px}
 /* Solid panels paint the fill and contour together, avoiding a second
    background edge in Safari's squircle fallback. */
 html[data-theme] body .continuous-native-surface.continuous-solid-surface{background-color:transparent!important;background-image:var(--continuous-solid-paint)!important;background-size:100% 100%!important;background-position:0 0!important;background-origin:border-box!important;background-repeat:no-repeat!important}
 html[data-theme] body .planner-add.continuous-native-surface{transition-property:color,opacity,transform,box-shadow!important}
 html[data-theme] body .week-day-switch>button.continuous-corner-ready::before,html[data-theme] body .week-day-switch>.segment-selection.continuous-corner-ready{border-radius:0!important;clip-path:var(--continuous-path)}
 html[data-theme] body .continuous-corner-surface{isolation:isolate;background:transparent!important;border-color:transparent!important}
 html[data-theme] body :is(.continuous-corner-surface,.continuous-corner-measuring).continuous-positioned{position:relative}
 html[data-theme] body .continuous-corner-surface::after{content:'';display:block;position:absolute;inset:calc(-1 * var(--continuous-surface-border-width,0px));width:auto;height:auto;border:0;border-radius:0;z-index:-1;pointer-events:none;background-color:var(--continuous-surface-fill);background-image:var(--continuous-surface-border),var(--continuous-surface-image);background-size:100% 100%,var(--continuous-surface-size);background-position:0 0,var(--continuous-surface-position);background-repeat:no-repeat;clip-path:var(--continuous-path)}
 html[data-theme] body .continuous-corner-surface.continuous-solid-surface::after{background-color:transparent;background-image:var(--continuous-solid-paint);background-size:100% 100%;background-position:0 0;background-repeat:no-repeat}
 html[data-theme] body .week-day-switch>button.continuous-corner-ready:has(>strong[aria-current='date']){box-shadow:none!important}
 html[data-theme] body .week-day-switch>button.continuous-corner-ready:has(>strong[aria-current='date'])::after{content:'';position:absolute;inset:0;width:auto;height:auto;border:0;border-radius:0;z-index:2;pointer-events:none;background:var(--continuous-today-border) 0 0/100% 100% no-repeat}
}
html[data-theme] body :is(
 .panel,.team-list.panel,.mini-person,.employee-card,.staff-card,.location-card,
 .signin-card,.entry-card,.entry-form-panel,.entry-story,.settings-card,.team-summary-metric,
 .install-panel
) {
 border-radius:var(--surface-corner);
 corner-shape:var(--surface-curve);
}
html[data-theme] body :is(
 .location-now-idle,.workday-result,.location-now-empty,.settings-brand,.owner-sidebar-profile,.owner-inset:not(.owner-kpi-value),.owner-server-database,.owner-message-preview,.replacement-transfer,.owner-payment-total,.owner-backup-key-row,.owner-security-session,.owner-security-attempts,.owner-health-job,.owner-health-clear,.replacement-row,.employee-week-day,.employee-week-slot,.planner-shift,.planner-add,.staff-card-next,.team-list-metrics,
 .personal-report-secondary,.personal-report-note,.employee-personal-progress,
 .person-report-totals,.person-report-totals>div,.person-report-comparison,.person-report-comparison>div,.person-report-graph-section,
 .absence-review-period,.account-access-card,.account-person-card,.shift-timing-summary,.access-view-fields,
 .location-delete-counts,.trainee-toggle,.manager-personal-totals,.notification-change
 ,.staffing-report-role-card,.staffing-coverage,.staffing-week-coverage
) {
 border-radius:var(--inset-corner);
 corner-shape:var(--surface-curve);
}
/* Select menus follow the shared card radius; item corners derive from this token. */
html[data-theme] body .custom-select-popover { --popover-corner:var(--surface-corner); }
html[data-theme] body :is(dialog:not(.onboarding-tour),.profile-dropdown,.notification-dropdown,.custom-select-popover,.date-popover) {
 border-radius:var(--popover-corner);
 corner-shape:var(--surface-curve);
}
html[data-theme] body :is(#account-form,#employment-form) .trainee-toggle {
 border-radius:var(--inset-corner); corner-shape:var(--surface-curve);
}
/* Low surfaces need smaller corners than full cards, regardless of viewport. */
html[data-theme] body :is(.shift-timing-summary,
 .trainee-toggle,.notification-change,.personal-report-note,.team-list-metrics,
 .personal-report-secondary,.location-delete-counts,.manager-personal-totals) {
 border-radius:var(--compact-corner);
}
html[data-theme] body :is(#toast,.undo-toast) {
 border-radius:var(--inset-corner); corner-shape:var(--surface-curve);
}
html[data-theme] body :is(.heading-count,.pill,.directory-total,.location-capacity,.notification-total,.shift-state-chip) {
 border-radius:12px;
 corner-shape:var(--surface-curve);
}
/* Plain list rows and table cells must stay square so separators are straight.
   Keep this in the geometry layer, after all page styles. */
html[data-theme] body :is(
 .team-list-row,.workload-row,.position-settings-row,.location-manager-row,
 .statistics-table .statistics-person-row,.statistics-table td,
 .directory-table tbody tr,.directory-table tbody td
) {
 border-radius:0;
 corner-shape:round;
}
@media(max-width:650px) {
 /* Action controls are capsules; equal-size icon controls naturally become circles.
    Clickable cards and form-field triggers retain their own surface geometry. */
 html[data-theme] body button:not(
  .button,.settings-theme-option,.date-day,.setup-review > button,.setup-form .period-presets > button,
  .custom-select-trigger,.date-trigger,.custom-select-option,
  .profile-dropdown > button,.profile-dropdown .account-actions > button,.notification-item,
  .record-list-row,.owner-priority-row,.training-side-list > .training-event,.training-side-list > .training-check,
  .mini-person,.owner-team-faces .owner-team-person,.planner-shift,.planner-add,.employee-week-slot,
  .location-stat-summary,.statistics-person-open,.desktop-context-location,.staffing-report-launch,.director-attention-row,.pay-position-row,.employee-profile-link,
  .week-day-switch > button,.motion-segments > button
 ) {
  border-radius:999px!important;
  corner-shape:round!important;
 }
 html[data-theme] body :is(.team-view-switch,.team-status-switch,.period-presets,.directory-role-filter,.install-tabs) {
  border-radius:var(--compact-corner);
  corner-shape:var(--surface-curve);
 }
 html[data-theme] body :is(dialog:not(.onboarding-tour),.mobile-sheet) {
  border-radius:var(--sheet-corner) var(--sheet-corner) 0 0!important;
  corner-shape:var(--surface-curve);
 }
 @supports not (corner-shape:squircle) {
  /* The clip-path supplies the curve. A second native radius trims it again. */
  html[data-theme] body :is(dialog:not(.onboarding-tour),.mobile-sheet).continuous-native-surface {
   border-radius:0!important;
  }
 }
}
/* Menu rows retain the same contour in every interaction state.
   Do not override the fallback's zero radius: its clip-path already draws the curve. */
html[data-theme] body .profile-dropdown { padding:10px; }
html[data-theme] body :is(.profile-dropdown > button,.profile-dropdown > a,.profile-dropdown .account-actions > button) {
 border-radius:var(--menu-item-corner);
 corner-shape:var(--surface-curve);
}
html[data-theme] body .custom-select-option {
 border-radius:var(--menu-item-corner);
 corner-shape:var(--surface-curve);
}

/* One interaction fill for action menus and select options in both themes. */
html[data-theme] body :is(.profile-dropdown>button,.profile-dropdown>a,.profile-dropdown .account-actions>button,.custom-select-option):not(.billing-profile):is(:hover:where(:not(html[data-hover-disabled] *)),:focus-visible,:active) {
 background-color:var(--surface-subtle);
}

/* Selected options use the same quiet fill as the other menu states. */
html[data-theme='light'] body .custom-select-option[aria-selected='true'] {
 background-color:var(--surface-subtle);
}

/* Numeric counters: one tabular digit fits a circle; longer values grow into a pill.
   Status labels and statistical values are not counters. */
html[data-theme] body :is(.heading-count,.pill,.directory-total,.notification-total,.notification-badge,.open-shift-response-badge,.segment-count,.mini-team-heading h2 > span) {
 --count-size:28px;
 font-family:Inter,sans-serif;
 font-weight:500;
 box-sizing:border-box;
 display:inline-flex;
 align-items:center;
 justify-content:center;
 flex-shrink:0;
 width:auto!important;
 min-width:var(--count-size)!important;
 height:var(--count-size)!important;
 min-height:var(--count-size)!important;
 padding:0 .6em!important;
 border-radius:999px!important;
 corner-shape:round!important;
 font-size:13px;
 line-height:1!important;
 font-variant-numeric:tabular-nums;
 white-space:nowrap;
}
html[data-theme] body :is(.segment-count,.notification-total) { --count-size:20px!important; font-size:11px!important; }
html[data-theme] body :is(.notification-badge.notification-badge,.open-shift-response-badge.open-shift-response-badge) { --count-size:18px!important; font-size:10px!important; padding:0 4px!important; }
html[data-theme] body :is(.notification-badge,.open-shift-response-badge)[hidden] { display:none; }
/* Requests needing attention share the inbox badge palette, counts stay neutral. */
html[data-theme] body :is(.segment-count.attention-count,.heading-count.attention-count,.notification-badge,.absence-nav-badge,.open-shift-response-badge,.support-unread-badge) { background:var(--control-accent); color:var(--control-accent-ink); }
html[data-theme] body :is(.location-admin-title,.replacement-heading) .heading-count { --count-size:24px!important; font-size:12px!important; }

/* Staffing assignment is an icon action: a true circle, not a squircle. */
html[data-theme] body #modal .button.staffing-role-assign{box-sizing:border-box;aspect-ratio:1;width:48px;height:48px;min-width:48px;max-width:48px;min-height:48px;max-height:48px;padding:0;border-radius:50%!important;corner-shape:round!important}

/* The customer conversation keeps the common phone sheet contour at the top. */
@media(max-width:650px){
 html[data-theme] body #modal.support-conversation-dialog{inset:auto 0 var(--sheet-keyboard-offset,0px)!important;height:calc(var(--sheet-height,100dvh) - max(32px,env(safe-area-inset-top)))!important;max-height:calc(var(--sheet-height,100dvh) - max(32px,env(safe-area-inset-top)))!important;overflow:hidden!important}
 html[data-theme] body #modal.support-conversation-dialog{border-radius:var(--sheet-corner) var(--sheet-corner) 0 0!important}
 @supports not (corner-shape:squircle){html[data-theme] body #modal.support-conversation-dialog.continuous-native-surface{border-radius:0!important;clip-path:var(--continuous-path)}}
}

/* A tariff prompt is one surface, without a second dialog frame. */
html[data-theme] body #modal.plan-access-dialog{width:min(380px,calc(100% - 32px));padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;overflow:auto;max-height:calc(100dvh - 48px)}
html[data-theme] body #modal.plan-access-dialog::before{display:none!important}
#modal.plan-access-dialog .plan-access-card{width:100%;box-shadow:none}
#modal.plan-access-dialog .plan-access-close{justify-self:center;font-size:var(--person-title-size)}
@media(max-width:650px){html[data-theme] body #modal.plan-access-dialog{height:auto!important;max-height:calc(100dvh - 48px)!important;inset:auto 0 16px!important;margin-inline:auto!important;padding-bottom:0!important}}

/* Phone shift and absence cards share the capsule of the assign action. */
@media(max-width:650px) {
 html[data-theme] body .mobile-shift-slots > .planner-shift {
  border-radius:999px!important; corner-shape:round!important;
 }
}

/* Mobile search uses a true capsule in every interaction state. */
@media (max-width:650px) {
 html[data-theme] body input[type="search"],
 html[data-theme] body input[type="search"]:is(:hover:where(:not(html[data-hover-disabled] *)),:focus,:focus-visible) {
  border-radius:999px!important; corner-shape:round!important;
 }
}

/* Cards share close radii; only very short surfaces shrink to avoid capsule ends. */
html[data-theme] body .surface-radius-bounded {
 border-top-left-radius:var(--bounded-top-left)!important;
 border-top-right-radius:var(--bounded-top-right)!important;
 border-bottom-right-radius:var(--bounded-bottom-right)!important;
 border-bottom-left-radius:var(--bounded-bottom-left)!important;
}

/* Text fields use one native contour; phone search keeps its capsule above. */
html[data-theme] body input:not([type='checkbox']):not([type='radio']):not([type='hidden']):not([type='range']):not([type='submit']):not([type='button']):not([type='file']):not([type='color']),
html[data-theme] body textarea { border-radius:var(--field-corner); }
@media(max-width:650px) {
 html[data-theme] body input[type='search'] { border-radius:999px!important; }
}

/* Search is a capsule only on phones; larger screens use the field contour. */
@media(min-width:651px) {
 html[data-theme] body input[type="search"] { border-radius:var(--field-corner)!important; corner-shape:var(--surface-curve)!important; }
}

/* Hide scroll tracks in overlays without disabling scrolling or keyboard access. */
html[data-theme] body :is(dialog,.mobile-sheet,.profile-dropdown,.notification-dropdown,.custom-select-popover,.date-popover),
html[data-theme] body :is(dialog,.mobile-sheet,.profile-dropdown,.notification-dropdown,.custom-select-popover,.date-popover) * {
 scrollbar-width:none; -ms-overflow-style:none;
}
html[data-theme] body :is(dialog,.mobile-sheet,.profile-dropdown,.notification-dropdown,.custom-select-popover,.date-popover)::-webkit-scrollbar,
html[data-theme] body :is(dialog,.mobile-sheet,.profile-dropdown,.notification-dropdown,.custom-select-popover,.date-popover) *::-webkit-scrollbar {
 display:none; width:0; height:0;
}
