/* Calendar layout owns its responsive geometry; shared portal tokens keep the visual language. */
.workspace .calendar-workspace .cal-toolbar {
  display:flex!important;flex-wrap:nowrap;align-items:center;justify-content:flex-start;
  min-height:68px;gap:12px;padding:10px 16px!important;
}
.workspace .calendar-workspace .cal-menu {width:44px;min-width:44px;height:44px;padding:0;flex:none}
.workspace .calendar-workspace .cal-range {order:0;flex:1 1 auto;min-width:0;margin:0;font-size:20px;text-align:left;line-height:1.35;white-space:nowrap}
.workspace .calendar-workspace .cal-date-nav {order:0;flex:none;margin:0;gap:0;padding:2px}
.workspace .calendar-workspace .cal-date-nav a {height:44px;min-width:44px;padding:0 10px}
.workspace .calendar-workspace .cal-filter-toggle {display:none!important;margin:0;width:44px;min-width:44px;height:44px;padding:0;flex:none}
.workspace .calendar-workspace .cal-filter-toggle .toolbar-label {display:none}
.workspace .calendar-workspace .cal-filter-toggle[aria-expanded=true] {background:var(--fill-tint);border-color:var(--accent)}
.workspace .calendar-workspace .cal-viewbar {display:flex;flex-wrap:nowrap;align-items:center;gap:12px;padding:8px 16px}
.workspace .calendar-workspace .cal-views {order:0;flex:0 0 auto;display:flex;gap:0;padding:2px;margin:0;min-width:0}
.workspace .calendar-workspace .cal-views a {flex:1 1 0;min-width:44px;min-height:44px;padding:6px 10px;font-size:13px;text-align:center;white-space:nowrap}
.workspace .calendar-workspace .cal-search {order:1;display:block;flex:1 1 180px;min-width:130px;max-width:260px;margin:0 0 0 auto}
.workspace .calendar-workspace .cal-search input {box-sizing:border-box;width:100%;height:44px;min-height:44px;margin:0}
.workspace .calendar-workspace .cal-staff {order:2;display:flex;align-items:center;flex:0 1 208px;min-width:0;gap:6px;margin:0}
/* Keep native selection behavior while giving text and arrow predictable insets. */
.workspace .calendar-workspace .cal-staff-select {position:relative;display:block;flex:1;min-width:0}
.workspace .calendar-workspace .cal-staff select {box-sizing:border-box;appearance:none;width:100%;min-width:0;max-width:none;height:44px;min-height:44px;margin:0;padding:10px 40px 10px 16px;line-height:22px;text-overflow:ellipsis}
.workspace .calendar-workspace .cal-staff-select>.symbol {position:absolute;right:14px;top:50%;transform:translateY(-50%);width:18px;height:18px;pointer-events:none;color:var(--ink-2)}
/* A single inset focus stroke keeps all filter edges aligned at 44px. */
.workspace .calendar-workspace .cal-viewbar :is(input,select,button):focus-visible {outline:2px solid var(--focus-ring);outline-offset:-2px;border-color:var(--focus-ring);box-shadow:none}
@media (forced-colors:active) {
  .workspace .calendar-workspace .cal-viewbar :is(input,select,button):focus-visible {outline-color:Highlight;border-color:Highlight}
  .workspace .calendar-workspace .cal-staff select {appearance:auto;padding-right:16px}
  .workspace .calendar-workspace .cal-staff-select>.symbol {display:none}
}
.workspace .calendar-workspace .cal-staff button {flex:none;width:44px;min-width:44px;height:44px;min-height:44px;margin:0;padding:0}
.workspace .calendar-workspace .cal-scroll-hint {display:none}
.workspace .calendar-workspace .hub-calendar-shell {padding:0!important;border-radius:0;border-width:0;box-shadow:none}
.workspace .calendar-workspace .hub-day>h2 {margin:0;min-height:52px;padding:4px 8px;gap:4px;box-sizing:border-box}
.workspace .calendar-workspace .hub-day>h2>a:first-child {gap:4px;min-height:44px;white-space:nowrap;font-size:13px}
.workspace .calendar-workspace .hub-event[data-task^="shared-"] {background:var(--fill-tint);color:var(--ink);border-radius:6px}
.workspace .calendar-workspace .hub-event[data-task^="shared-"] time {color:var(--ink-2);font-variant-numeric:tabular-nums;font-size:11px;white-space:nowrap}
.workspace .calendar-workspace .hub-event[data-task^="shared-"] strong {font-weight:600;line-height:1.45}

/* Narrow desktops and tablets keep six views together and disclose filters on demand. */
@media (max-width:1180px) {
  .workspace .calendar-workspace .cal-filter-toggle {display:inline-flex!important;align-items:center;justify-content:center}
  .workspace .calendar-workspace .cal-viewbar {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}
  .workspace .calendar-workspace .cal-views {grid-column:1/-1;justify-self:start;max-width:100%}
  .workspace .calendar-workspace .cal-search,
  .workspace .calendar-workspace .cal-staff {display:none;min-width:0;max-width:none;margin:0}
  .workspace .calendar-workspace .cal-viewbar.filters-open .cal-search {display:block;grid-column:1}
  .workspace .calendar-workspace .cal-viewbar.filters-open .cal-staff {display:flex;flex-wrap:nowrap;grid-column:2}
  .workspace .calendar-workspace .cal-main .hub-calendar.week {min-width:640px;grid-template-columns:repeat(7,minmax(0,1fr))}
  .workspace .calendar-workspace .cal-main .hub-calendar.workweek {min-width:560px}
}
@media (max-width:600px) {
  .workspace .calendar-workspace .cal-toolbar {display:grid!important;grid-template-columns:44px minmax(0,1fr) 44px;gap:8px;padding:12px 12px 8px!important}
  .workspace .calendar-workspace .cal-range {grid-column:1/-1;grid-row:1;font-size:18px;line-height:26px}
  .workspace .calendar-workspace .cal-menu {grid-column:1;grid-row:2}
  .workspace .calendar-workspace .cal-date-nav {grid-column:2;grid-row:2;justify-self:center}
  .workspace .calendar-workspace .cal-filter-toggle {grid-column:3;grid-row:2}
  .workspace .calendar-workspace .cal-viewbar {padding:8px;gap:8px}
  .workspace .calendar-workspace .cal-views {justify-self:stretch;width:auto}
  .workspace .calendar-workspace .cal-views a {padding:6px 2px}
  .workspace .calendar-workspace .cal-viewbar.filters-open .cal-search,
  .workspace .calendar-workspace .cal-viewbar.filters-open .cal-staff {grid-column:1/-1}
  .workspace .calendar-workspace .cal-main .hub-calendar.week {min-width:840px}
  .workspace .calendar-workspace .cal-main .hub-calendar.workweek {min-width:600px}
  .workspace .calendar-workspace .cal-main .hub-calendar.three {min-width:360px}
  .workspace .calendar-workspace .cal-main .hub-calendar:is(.day,.agenda) {min-width:0}
}

/* Shared event forms: consistent field edges, readable labels and one action row. */
.workspace .calendar-dialog.cal-detail {box-sizing:border-box;padding:20px;scrollbar-gutter:stable}
.workspace .calendar-dialog .cal-panel-title {display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 16px;padding:0 0 12px;border-bottom:1px solid var(--rule)}
.workspace .calendar-dialog .cal-panel-title h2 {margin:0;line-height:1.4}
.workspace .calendar-dialog .cal-panel-title button {flex:none;width:44px;min-width:44px;height:44px;padding:0}
.workspace .calendar-dialog .cal-muted {margin:0 0 16px;line-height:1.6}
.workspace .calendar-dialog .cal-quick-form,
.workspace .shared-event-form {display:flex;flex-direction:column;gap:16px;min-width:0}
.workspace .calendar-dialog .shared-event-form {padding:0;margin:0;border:0;border-radius:0;box-shadow:none;background:transparent}
.workspace :is(.cal-quick-form,.shared-event-form) .hub-field {margin:0;min-width:0}
.workspace :is(.cal-quick-form,.shared-event-form) .hub-field label {display:block;margin:0 0 6px;line-height:1.5}
.workspace :is(.cal-quick-form,.shared-event-form) :is(input:not([type=checkbox]):not([type=hidden]),select,textarea) {box-sizing:border-box;display:block;width:100%;min-width:0;max-width:100%;min-height:44px;margin:6px 0 0;font-size:16px}
.workspace :is(.cal-quick-form,.shared-event-form) [hidden] {display:none!important}
.workspace :is(.cal-quick-form,.shared-event-form) [data-field=all_day] {display:flex;align-items:center;gap:10px}
.workspace .cal-quick-form [data-field=all_day] label {display:flex;align-items:center;gap:10px;width:100%}
.workspace :is(.cal-quick-form,.shared-event-form) [data-field=all_day] input {width:20px;min-width:20px;height:20px;min-height:20px;margin:0;flex:none;order:-1}
.workspace :is(.cal-quick-form,.shared-event-form) details {margin:0;border-top:1px solid var(--rule);padding:4px 0 0}
.workspace :is(.cal-quick-form,.shared-event-form) details summary {min-height:44px;align-content:center;padding:0;font-size:14px}
.workspace :is(.cal-quick-form,.shared-event-form) details[open]>.hub-field {margin-top:16px}
.workspace .cal-quick-form [role=alert]:empty {display:none}
.workspace .cal-form-actions,
.workspace .shared-event-form .office-form-actions {display:flex;flex-wrap:wrap;gap:8px;margin:0;padding-top:16px;border-top:1px solid var(--rule);position:static}
.workspace :is(.cal-form-actions,.shared-event-form .office-form-actions)>:is(button,a) {display:inline-flex;align-items:center;justify-content:center;min-height:44px;margin:0;padding:10px 20px}
.workspace .cal-form-actions button[type=submit],
.workspace .shared-event-form button[value=save] {background:var(--accent);color:var(--on-accent);border-color:var(--accent)}
.workspace .shared-event-form .danger {margin-left:auto!important}
@media (max-width:600px) {
  .workspace .calendar-dialog.cal-detail {padding:16px;max-height:calc(100dvh - 24px - env(safe-area-inset-bottom,0px));height:auto;min-height:0;border-radius:24px;inset:auto 8px calc(8px + env(safe-area-inset-bottom,0px));width:auto;max-width:none}
  .workspace .calendar-dialog.cal-quick-dialog {min-height:0;height:fit-content;inset:auto 8px calc(8px + env(safe-area-inset-bottom,0px))!important;margin:0!important}
  .workspace .cal-form-actions>* {flex:1}
  .workspace .shared-event-form .office-form-actions .danger {flex-basis:100%;margin-left:0!important}
}

/* Month cells stack the count below the date so it cannot spill into the next day. */
.workspace .calendar-workspace .hub-calendar.month .hub-day>h2>a:first-child {flex-direction:column;align-items:flex-start;justify-content:center;gap:2px;line-height:1.3}
.workspace .calendar-workspace .hub-calendar.month .month-count {margin:0;font-size:10px;line-height:1.3;white-space:nowrap}
/* The owner-only assignment button must not cover the date on seven-column views. */
.workspace .calendar-workspace .hub-day>h2:has(.hub-day-add) {padding-inline:4px;gap:2px}
.workspace .calendar-workspace .hub-day>h2:has(.hub-day-add)>a:first-child {flex-direction:column;align-items:flex-start;justify-content:center;gap:0;line-height:1.35}
.workspace .calendar-workspace .hub-day>h2:has(.hub-day-add) .hub-day-weekday {font-size:11px;white-space:nowrap}
@media (max-width:600px) {
  /* The date opens the full day, where the assignment action retains its 44px target. */
  .workspace .calendar-workspace .hub-calendar.month .hub-day-add {display:none!important}
}

/* Month rows grow with their events; no clipped entries or nested cell scrolling. */
.workspace .calendar-workspace .hub-calendar.month {height:auto;grid-template-rows:none;grid-auto-rows:minmax(176px,auto);align-items:stretch}
.workspace .calendar-workspace .hub-calendar.month .hub-day {height:auto;min-height:176px;overflow:visible}
.workspace .calendar-workspace .hub-calendar.month .hub-month-events {flex:1 0 auto;min-height:0;overflow:visible;padding:2px}
.workspace .calendar-workspace .hub-calendar.month .hub-month-events :is(.hub-all-day,.hub-day-events) {height:auto;max-height:none;min-height:0;overflow:visible;pointer-events:auto;padding:0}
.workspace .calendar-workspace .hub-calendar.month .hub-event {display:flex;flex-direction:column;align-items:flex-start;box-sizing:border-box;min-height:44px;height:auto;padding:6px;gap:2px;line-height:1.4;font-size:12px;white-space:normal;opacity:1}
.workspace .calendar-workspace .hub-calendar.month .hub-event strong {font-size:12px;line-height:1.4;overflow-wrap:anywhere}
.workspace .calendar-workspace .hub-calendar.month .hub-event time {font-size:10px;line-height:1.3;white-space:normal;overflow-wrap:anywhere}
@media(max-width:600px){
 .workspace .calendar-workspace .hub-calendar.month .hub-event {padding:4px 2px}
 .workspace .calendar-workspace .hub-calendar.month .hub-event strong {font-size:11px}
}

/* All-day events have content-driven height; only timed blocks use size containment. */
.workspace .calendar-workspace .hub-timed .hub-all-day {height:auto;max-height:none;overflow:visible;flex:none}
.workspace .calendar-workspace .hub-timed .hub-all-day .hub-event {position:static;display:flex;flex-direction:column;container-type:normal;min-height:44px;height:auto;margin:3px 0;padding:6px 8px;gap:2px;overflow:visible;white-space:normal}
.workspace .calendar-workspace .hub-timed .hub-all-day .hub-event strong {font-size:12px;line-height:1.4;white-space:normal;overflow-wrap:anywhere}
.workspace .calendar-workspace .hub-timed .hub-all-day .hub-event time {display:block;font-size:10px;line-height:1.3}
