
/* Final cleaning-calendar composition. Scoped to Ménage workspace only. */
body.sg-workspace-mode:has(#cleaningView.active-view) #app .content-area {
  overflow: hidden;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-planner {
  width: min(100%, 1320px);
  margin-left: 0;
  margin-right: auto;
  gap: 12px;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-planner-title {
  display: block;
  min-width: 0;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-planner-title h2 {
  font-size: clamp(24px, 2.2vw, 34px);
  line-height: 1.15;
  letter-spacing: -.65px;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-planner-title p {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--sg-text-muted);
}

body.sg-workspace-mode #cleaningView .sg-cleaning-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-summary-card.sg-cleaning-summary-legacy-tomorrow {
  display: none !important;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-summary-card.sg-cleaning-summary-metric {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-content: center;
  gap: 3px 12px;
  padding: 12px 18px;
  border: 1px solid var(--sg-border-ui);
  border-radius: 14px;
  background: var(--sg-card-bg);
  box-shadow: 0 3px 14px rgba(19, 45, 69, .04);
}

body.sg-workspace-mode #cleaningView .sg-cleaning-summary-metric .sg-cleaning-summary-heading {
  grid-column: 1;
  grid-row: 1;
  min-height: 0;
  align-items: center;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-summary-metric .sg-cleaning-summary-footer {
  display: contents;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-summary-metric strong {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  margin: 0;
  color: var(--sg-text);
  font-size: 28px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-summary-metric .sg-cleaning-summary-caption {
  grid-column: 1;
  grid-row: 2;
  font-size: 11px;
  color: var(--sg-text-muted);
}

body.sg-workspace-mode #cleaningView .sg-cleaning-summary-metric.completed .sg-cleaning-summary-icon {
  background: #edf1f5;
  color: #536171;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-summary-metric.remaining .sg-cleaning-summary-icon {
  background: #fff4da;
  color: #b87911;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-desktop-summary {
  display: none;
}

@media (min-width: 1181px) {
  body.sg-workspace-mode #cleaningView .sg-cleaning-summary,
  body.sg-workspace-mode #cleaningView .sg-workspace-actions {
    display: none !important;
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-desktop-summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--sg-border-ui);
    border-radius: 12px;
    background: var(--sg-card-bg);
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-desktop-summary-card {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 72px;
    min-height: 72px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 5px;
    padding: 11px 18px;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: var(--sg-card-bg);
    box-shadow: none;
    color: var(--sg-text);
    font: inherit;
    text-align: left;
    appearance: none;
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-desktop-summary-card + .sg-cleaning-desktop-summary-card::before {
    content: '';
    position: absolute;
    inset-block: 14px;
    inset-inline-start: 0;
    width: 1px;
    background: var(--sg-border-ui);
  }

  body.sg-workspace-mode #cleaningView button.sg-cleaning-desktop-summary-card {
    cursor: pointer;
  }

  body.sg-workspace-mode #cleaningView button.sg-cleaning-desktop-summary-card:hover {
    background: var(--sg-surface-soft, #f8fafc);
  }

  body.sg-workspace-mode #cleaningView button.sg-cleaning-desktop-summary-card:focus-visible {
    outline: 2px solid var(--sg-selection-text);
    outline-offset: 2px;
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-desktop-summary-label {
    min-width: 0;
    color: var(--sg-text-muted);
    font-size: 14px;
    line-height: 1.2;
    font-weight: 600;
    overflow-wrap: anywhere;
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-desktop-summary-value {
    min-width: 0;
    color: var(--sg-text);
    font-size: 21px;
    line-height: 1.05;
    font-weight: 780;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-desktop-summary-card.statistics .sg-cleaning-desktop-summary-value {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--sg-selection-text);
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-desktop-summary-arrow {
    font-size: 29px;
    line-height: .8;
    font-weight: 500;
  }
}

body.sg-workspace-mode #cleaningView .sg-workspace-actions {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) minmax(220px, 1.4fr) minmax(130px, .75fr);
  gap: 10px;
}

body.sg-workspace-mode #cleaningView .sg-workspace-tomorrow,
body.sg-workspace-mode #cleaningView .sg-workspace-stats {
  box-sizing: border-box;
  min-height: 48px;
  border: 1px solid var(--sg-control-border);
  border-radius: var(--sg-radius-control);
  background: var(--sg-card-bg);
  color: var(--sg-text);
  font: inherit;
  cursor: pointer;
}

body.sg-workspace-mode #cleaningView .sg-workspace-tomorrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px;
  font-size: 13px;
}

body.sg-workspace-mode #cleaningView .sg-workspace-tomorrow strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-planner-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(280px, 1fr);
  gap: 18px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

@media (min-width: 1181px) {
  body.sg-workspace-mode #cleaningView .sg-workspace-month .sg-cleaning-calendar-grid {
    grid-auto-rows: minmax(74px, auto);
  }

  body.sg-workspace-mode #cleaningView .sg-workspace-month .sg-cleaning-calendar-day {
    box-sizing: border-box;
    min-height: 74px;
  }
}

body.sg-workspace-mode #cleaningView .sg-cleaning-calendar-panel,
body.sg-workspace-mode #cleaningView .sg-cleaning-day-panel {
  min-height: 0;
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(25, 50, 73, .045);
}

body.sg-workspace-mode #cleaningView .sg-cleaning-day-panel {
  display: flex !important;
  max-height: none;
  padding: 0;
  overflow: hidden;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-day-header {
  flex: none;
  min-height: 86px;
  padding: 17px 18px 14px;
  margin: 0;
}

body.sg-workspace-mode #cleaningView #cleaningSelectedDateTitle {
  margin: 0 0 3px;
  font-size: 20px;
}

body.sg-workspace-mode #cleaningView #cleaningSelectedDateCount {
  font-size: 13px;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-selected-day-content {
  flex: 1;
  min-height: 0;
  padding: 0 16px 18px;
  overflow: auto;
  scrollbar-gutter: stable;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-compact-card {
  position: relative;
  padding: 15px 0;
  cursor: pointer;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-compact-card:focus-visible {
  outline: 2px solid var(--sg-selection-text);
  outline-offset: -2px;
  border-radius: 10px;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-compact-card[data-cleaning-state="completed"] {
  color: #536171;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-compact-top {
  margin: 8px 0 10px;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-compact-property strong {
  font-size: 16px;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-compact-property > span:not(.sg-cleaning-card-state) {
  display: none;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-compact-property .sg-cleaning-provider-name {
  display: block;
  margin-top: 2px;
  color: var(--sg-text-muted);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.sg-workspace-mode #cleaningView #cleaningSelectedDayContent [data-cw-state] > .cw-status {
  display: none;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-card-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: var(--sg-text-muted);
  font-size: 12px;
  font-weight: 650;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-state-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-sizing: border-box;
}

:is(body.sg-workspace-mode #cleaningView, #cleaningDetailModal.cw-action-modal) .sg-cleaning-status-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: #138f97;
}

:is(body.sg-workspace-mode #cleaningView, #cleaningDetailModal.cw-action-modal) .sg-cleaning-status-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:is(body.sg-workspace-mode #cleaningView, #cleaningDetailModal.cw-action-modal) .sg-cleaning-broom-motion {
  --sg-brush-travel: 2.5px;
}

:is(body.sg-workspace-mode #cleaningView, #cleaningDetailModal.cw-action-modal) .sg-cleaning-brush {
  transform-box: view-box;
  transform-origin: 16px 16px;
}

:is(body.sg-workspace-mode #cleaningView, #cleaningDetailModal.cw-action-modal) .sg-cleaning-broom-motion:not(.sg-cleaning-broom-still) .sg-cleaning-brush {
  animation: sg-cleaning-sweep .6s ease-in-out infinite;
}

:is(body.sg-workspace-mode #cleaningView, #cleaningDetailModal.cw-action-modal) .sg-cleaning-sweep-lines {
  opacity: .45;
}

:is(body.sg-workspace-mode #cleaningView, #cleaningDetailModal.cw-action-modal) .sg-cleaning-broom-motion:not(.sg-cleaning-broom-still) .sg-cleaning-sweep-lines {
  animation: sg-cleaning-sweep-lines .6s ease-in-out infinite;
}

#cleaningDetailModal.cw-action-modal #cwWork .cw-running .sg-cleaning-broom-motion {
  --sg-brush-travel: 3.55px;
}

/* Enlarge only the artwork: keep the existing inline slot and text coordinates. */
#cleaningDetailModal.cw-action-modal #cwWork .cw-running .sg-cleaning-status-icon svg {
  width: 27px;
  height: 27px;
}

body.sg-workspace-mode #cleaningView [data-cleaning-status-legend] .sg-cleaning-status-icon svg {
  width: 16px;
  height: 16px;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-complete-icon {
  border-radius: 50%;
  background: #15989c;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

@keyframes sg-cleaning-sweep {
  0%, 100% { transform: translateX(calc(-1 * var(--sg-brush-travel))) rotate(-12deg); }
  50% { transform: translateX(var(--sg-brush-travel)) rotate(12deg); }
}

@keyframes sg-cleaning-sweep-lines {
  0%, 100% { opacity: .25; }
  50% { opacity: .65; }
}

@media (prefers-reduced-motion: reduce) {
  :is(body.sg-workspace-mode #cleaningView, #cleaningDetailModal.cw-action-modal) .sg-cleaning-broom-motion :is(.sg-cleaning-brush, .sg-cleaning-sweep-lines) { animation: none !important; }
}

body.sg-workspace-mode #cleaningView .cw-calendar-state-text {
  color: #536171;
  font-size: 10px;
  font-weight: 700;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-calendar-panel .sg-cleaning-cleaner-pill:not(.cw-completed) .sg-cleaning-state-dot {
  color: currentColor;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-calendar-panel .sg-cleaning-cleaner-pill.cw-in-progress {
  background: #e8f8f7 !important;
  border-color: #b9e6e3 !important;
  color: #126f77 !important;
}

@media (min-width: 761px) {
  body.sg-workspace-mode #cleaningView .sg-workspace-month .sg-cleaning-cleaner-pill {
    height: 30px;
    min-height: 30px;
    max-height: 30px;
    flex-wrap: nowrap;
  }

  body.sg-workspace-mode #cleaningView .sg-workspace-month .sg-cleaning-event-label {
    display: flex;
    align-items: center;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
  }

  body.sg-workspace-mode #cleaningView .sg-workspace-month .sg-cleaning-event-property {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

body.sg-workspace-mode #cleaningView .sg-cleaning-calendar-panel .sg-cleaning-cleaner-pill.cw-completed .sg-cleaning-event-state {
  order: 3;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-calendar-panel .sg-cleaning-cleaner-pill.cw-completed .cw-calendar-check {
  display: none !important;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-cot-indicator {
  width: 11px;
  height: 12px;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-cleaner-pill.sg-has-cot:not(.sg-cot-installed) > .sg-cleaning-cot-indicator,
body.sg-workspace-mode #cleaningView .sg-cleaning-cot-row.pending {
  color: #c93535;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-cleaner-pill.sg-cot-installed > .sg-cleaning-cot-indicator,
body.sg-workspace-mode #cleaningView .sg-cleaning-cot-row.installed {
  color: #7b8795;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-cot-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 8px 0 3px;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 600;
}

body.sg-workspace-mode #cleaningView .sg-cleaning-cot-row .sg-cleaning-cot-indicator {
  width: 14px;
  height: 16px;
}

@media (max-width: 1180px) {
  body.sg-workspace-mode #cleaningView .sg-cleaning-planner-layout {
    display: flex;
    flex-direction: column;
    overflow: auto;
    scrollbar-gutter: stable;
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-calendar-panel {
    flex: 0 0 min(64vh, 700px);
    min-height: 460px;
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-day-panel {
    flex: none;
    min-height: 260px;
    max-height: none;
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-selected-day-content {
    max-height: none;
  }
}

@media (max-width: 760px) {
  body.sg-workspace-mode:has(#cleaningView.active-view) #app .content-area {
    overflow: hidden;
    padding: 8px 8px calc(7px + env(safe-area-inset-bottom));
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-planner {
    gap: 7px;
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-planner-title.sg-cleaning-mobile-heading {
    display: flex;
    min-height: 40px;
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-mobile-heading h2 {
    font-size: 19px;
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-mobile-heading p {
    display: none;
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-summary-card.sg-cleaning-summary-metric {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 59px;
    padding: 7px 6px;
    gap: 3px;
    border-radius: 11px;
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-summary-metric .sg-cleaning-summary-heading {
    display: block;
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-summary-metric .sg-cleaning-summary-icon {
    display: none;
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-summary-metric .sg-cleaning-summary-label {
    font-size: 10px;
    line-height: 1.2;
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-summary-metric .sg-cleaning-summary-footer {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 3px;
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-summary-metric strong {
    font-size: 20px;
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-summary-metric .sg-cleaning-summary-caption {
    max-width: 54px;
    font-size: 8px;
    line-height: 1.15;
    text-align: right;
  }

  body.sg-workspace-mode #cleaningView .sg-workspace-actions {
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.25fr) minmax(0, .8fr);
    gap: 5px;
  }

  body.sg-workspace-mode #cleaningView .sg-workspace-actions :is(.sg-workspace-tomorrow, .cw-issue-summary, .sg-workspace-stats) {
    min-height: 44px;
    padding: 5px 6px;
    font-size: 10px;
  }

  body.sg-workspace-mode #cleaningView .sg-workspace-tomorrow {
    flex-direction: column;
    gap: 0;
    line-height: 1.15;
  }

  body.sg-workspace-mode #cleaningView .sg-workspace-tomorrow strong {
    font-size: 15px;
  }

  body.sg-workspace-mode #cleaningView .sg-workspace-actions .cw-warning,
  body.sg-workspace-mode #cleaningView .sg-workspace-actions .sg-workspace-stats svg {
    display: none;
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-planner-layout {
    gap: 9px;
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-calendar-panel {
    flex-basis: min(55vh, 520px);
    min-height: 360px;
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-day-panel {
    min-height: 250px;
    margin-bottom: max(64px, env(safe-area-inset-bottom));
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-day-header {
    min-height: 68px;
    padding: 13px 14px 10px;
  }

  body.sg-workspace-mode #cleaningView #cleaningSelectedDateTitle {
    font-size: 17px;
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-selected-day-content {
    padding: 0 76px max(96px, calc(70px + env(safe-area-inset-bottom))) 13px;
    overflow: visible;
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-compact-card {
    padding: 13px 0;
  }

  body.sg-workspace-mode #cleaningView .sg-cleaning-calendar-panel .sg-cleaning-cleaner-pill {
    min-height: 46px;
  }

  body.sg-workspace-mode #cleaningView .sg-workspace-month .sg-cleaning-event-property {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.sg-workspace-mode #cleaningView .sg-workspace-month .sg-cleaning-event-state {
    position: static;
    grid-row: 3;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  body.sg-workspace-mode #cleaningView .sg-workspace-month .sg-cleaning-cleaner-pill [data-workspace-warning] {
    position: absolute;
    top: 3px;
    right: 2px;
    width: 11px;
    height: 11px;
    margin: 0;
  }

  body.sg-workspace-mode #cleaningView .sg-workspace-month .sg-cleaning-cleaner-pill.cw-issue .sg-cleaning-event-code {
    padding-right: 11px;
  }

  body.sg-workspace-mode #cleaningView .sg-workspace-month .sg-cleaning-cleaner-pill {
    grid-template-rows: 16px 14px 14px;
  }

  body.sg-workspace-mode #cleaningView .sg-workspace-month .sg-cleaning-cleaner-pill.sg-has-cot > .sg-cleaning-cot-indicator {
    width: 10px;
    height: 12px;
  }
}
