#workEditorBody .we-overview{display:grid;grid-template-columns:1.3fr 1fr 1fr;gap:10px;margin-bottom:10px;}
#workEditorBody .we-overview-card{min-width:0;border:1px solid var(--ui-border);border-radius:8px;background:var(--ui-surface);padding:12px;}
#workEditorBody .we-overview-card h3,#workEditorBody .we-payment-heading{font-size:12px;margin:0 0 10px;font-weight:650;color:var(--ui-heading);}
#workEditorBody .we-client-car{display:grid;grid-template-columns:1fr 1fr;gap:12px;}
#workEditorBody .we-overview .work-summary-cell{padding:0!important;border:0!important;background:none!important;min-width:0;}
#workEditorBody .we-overview .work-summary-cell__val{font-size:13px;white-space:normal!important;overflow-wrap:anywhere;}
#workEditorBody .we-overview .work-summary-cell__label{font-size:10px;margin-bottom:4px;}
#workEditorBody .we-overview .work-summary-cell__sub{font-size:11px;line-height:1.5;}
#workEditorBody .we-history{margin-top:10px;font-size:11px;line-height:1.5;}
#workEditorBody .we-history summary{cursor:pointer;color:var(--ui-heading);padding:4px 0;}
#workEditorBody .we-history>div{max-height:160px;overflow:auto;}
#workEditorBody .we-history p{margin:5px 0;color:var(--ui-muted);}
#workEditorBody .work-editor-shell--compact .work-editor-sticky{position:static;margin:0 0 10px;padding:0;}
#workEditorBody .work-editor-shell--compact .work-editor-grid{grid-template-columns:minmax(0,1fr) 220px;gap:10px;}
#workEditorBody .we-payment-settings{padding:12px!important;margin-bottom:10px;}
#workEditorBody .we-payment-settings .work-summary-grid{display:block!important;}
#workEditorBody .we-payment-settings .work-summary-cell--price{padding:0!important;background:none!important;border:0!important;}
#workEditorBody .work-editor-shell--compact .work-calc-mode{margin-top:8px;}
#workEditorBody .work-editor-shell--compact .work-exp-block{padding:12px!important;margin-bottom:10px;}
#workEditorBody .work-editor-shell--compact .work-exp-block__head{margin-bottom:8px;}
#workEditorBody .work-editor-shell--compact .work-calc-step__num{display:none;}
#workEditorBody .work-editor-shell--compact .we-step-hint-inline{font-size:11px;margin:4px 0 8px;}
#workEditorBody .work-editor-shell--compact .we-service-card__panel-inner{padding:10px;gap:8px;}
#workEditorBody .work-editor-shell--compact .we-service-card__sub{padding:8px;}
#workEditorBody .work-editor-shell--compact .we-service-card__bar{padding:8px;}
#workEditorBody .work-editor-shell--compact :is(input.input,select.input){min-height:32px;font-size:12px;}
#workEditorBody .work-editor-shell--compact .work-editor-actions{padding:10px;gap:6px;}
#workEditorBody .work-editor-shell--compact .work-summary-cell__val--truncate{white-space:normal;}
@media(max-width:1000px){#workEditorBody .we-overview{grid-template-columns:1fr 1fr;}#workEditorBody .we-overview-card:first-child{grid-column:1/-1;}#workEditorBody .work-editor-shell--compact .work-editor-grid{grid-template-columns:minmax(0,1fr);}}
@media(max-width:600px){#workEditorBody .we-overview{grid-template-columns:1fr;}#workEditorBody .we-client-car{grid-template-columns:1fr;} }

#workEditorBody .we-overview .work-car-photo__preview:empty{display:none!important;}
#workEditorBody .we-overview .work-car-photo{margin:6px 0!important;gap:4px!important;}
#workEditorBody .we-overview .btn{min-height:26px!important;padding:4px 8px!important;font-size:11px!important;}
#workEditorBody .we-overview .work-car-photo__actions{gap:4px!important;}
#workEditorBody .work-editor-shell--compact .work-live-totals__item{padding:9px 12px!important;min-height:38px!important;}
#workEditorBody .we-financial-details{margin-top:8px;border:1px solid var(--ui-border);border-radius:7px;padding:10px;}
#workEditorBody .we-financial-details>summary{font-size:12px;cursor:pointer;font-weight:600;}
#workEditorBody .work-editor-shell--compact .work-summary-cell--price{background:transparent!important;}
#workEditorBody .work-editor-shell--compact .work-editor-side{position:static;}

#workEditorBody .we-client-car{align-items:start;}
#workEditorBody .we-overview-card h3{padding:0!important;line-height:1.3!important;}
#workEditorBody .we-overview .work-summary-cell{gap:3px!important;}
#workEditorBody .work-editor-shell--compact .work-calc-mode .btn{min-height:30px!important;padding:5px 10px!important;}
#workEditorBody .work-editor-shell--compact .we-payment-heading{line-height:1.3;padding:0;margin:0 0 6px;}
#workEditorBody .work-editor-shell--compact .work-summary-card .work-summary-cell--price{padding:0!important;background:transparent!important;gap:6px!important;}
#workEditorBody .work-editor-shell--compact .work-summary-price-field{margin:0!important;}

/* Compact service rows: keep every control, remove excess card spacing. */
@media (min-width: 900px) {
  #workEditorBody .work-editor-shell--compact .we-service-card { border-radius:8px; margin:0; min-height:0; }
  #workEditorBody .work-editor-shell--compact .we-service-card__bar { padding:6px 8px!important; gap:4px 8px; grid-template-columns:32px minmax(0,1fr) auto; align-items:center; }
  #workEditorBody .work-editor-shell--compact .we-service-card__flags { grid-column:3; padding:0; max-width:190px; gap:4px; align-self:center; }
  #workEditorBody .work-editor-shell--compact .we-service-card__toggle { margin:12px 0 0; min-height:30px; }
  #workEditorBody .work-editor-shell--compact .we-service-card__field-labels { margin:0 0 3px; font-size:9px; line-height:1.2; }
  #workEditorBody .work-editor-shell--compact .we-service-card__compact { gap:6px; }
  #workEditorBody .work-editor-shell--compact .we-service-card :is(input.input,select.input,.we-card-del) { height:32px!important; min-height:32px!important; padding:5px 8px!important; }
  #workEditorBody .work-editor-shell--compact .we-service-card .we-chip { min-height:26px; padding:3px 7px; font-size:10px; }
  #workEditorBody .work-editor-shell--compact .work-exp-block:has(.we-service-card) { padding:8px!important; }
  #workEditorBody .work-editor-shell--compact .work-exp-block:has(.we-service-card) .work-exp-block__head { min-height:30px; margin-bottom:4px; }
}
#workEditorBody .we-service-card__panel[hidden] { display:none!important; }
@media (min-width:900px) {
  #workEditorBody .work-editor-shell--compact .we-service-card__bar { grid-template-columns:32px minmax(0,1fr) 190px; }
  #workEditorBody .work-editor-shell--compact .we-service-card__flags { width:190px; }
}

#workEditorBody .work-exp-block--optional:not(:has(#weWashList .work-row)) { display:none!important; }
#workEditorBody .work-editor-shell--compact .work-calc-mode {
  display:inline-grid; grid-template-columns:repeat(2,minmax(88px,1fr));
  width:auto; max-width:100%; padding:2px; gap:2px; margin-top:6px;
}
#workEditorBody .work-editor-shell--compact .work-calc-mode .btn {
  min-height:28px!important; padding:4px 16px!important; font-size:11px!important;
}

#workEditorBody .work-editor-shell--compact .we-service-card__toggle {
  display:inline-flex; align-items:center; justify-content:center;
  width:32px; height:32px; padding:0; border:1px solid #8f84aa;
  border-radius:8px; color:#eee9ff; background:linear-gradient(145deg,#655777,#39334d);
  box-shadow:inset 0 1px 0 #ffffff24,0 2px 4px #0002; cursor:pointer;
}
#workEditorBody .we-service-card__toggle:hover { filter:brightness(1.18); }
#workEditorBody .we-service-card__toggle:focus-visible { outline:2px solid #bda7ec; outline-offset:2px; }
#workEditorBody .we-service-card__toggle[aria-expanded="true"] { background:#79628d; border-color:#c9afd9; }

/* Readable financial breakdown, with amounts on their own unbroken line. */
#workEditorBody .we-financial-details { padding:8px; }
#workEditorBody #workEditorFinancials .work-fin-panel { padding:8px; }
#workEditorBody #workEditorFinancials .work-fin-dl { display:flex; flex-direction:column; gap:3px; }
#workEditorBody #workEditorFinancials .work-fin-dl dt { margin:8px 0 0; font-size:11px; }
#workEditorBody #workEditorFinancials .work-fin-dl dd {
  margin:0; max-width:none; width:auto; overflow:visible; text-overflow:clip;
  white-space:nowrap; word-break:normal; font-size:14px; text-align:left; align-self:flex-start;
}
#workEditorBody .we-service-card__flags .we-svc-badge--upsell { display:none; }
#workEditorBody .we-service-card__flags .we-chip {
  border-radius:6px; border:1px solid #8a7c9a; background:#ffffff08; color:#ddd6e8;
}
#workEditorBody .we-service-card__flags .we-chip.is-on { background:#625274; border-color:#b79bc9; color:#fff; }
#workEditorBody .we-service-card__flags .we-chip:disabled { opacity:1; cursor:default; }
#workEditorBody .we-contact-card {
  background:linear-gradient(120deg,#244149,#23323d); border-color:#527781;
  box-shadow:inset 0 1px 0 #ffffff18;
}
#workEditorBody .we-contact-card :is(h3,.work-summary-cell__val,.work-client-link) { color:#e7f8fa!important; }
#workEditorBody .we-contact-card :is(.work-summary-cell__label,.work-summary-cell__sub,summary) { color:#b9d3d8; }
#workEditorBody .we-contact-card .we-client-car > .work-summary-cell:first-child {
  display:grid!important; grid-template-columns:40px minmax(0,1fr); column-gap:10px!important; align-content:start;
}
#workEditorBody .we-contact-avatar {
  grid-column:1; grid-row:1 / span 4; display:grid; place-items:center; width:40px; height:40px;
  border-radius:12px; background:linear-gradient(145deg,#56838b,#355c68); color:#fff; font-weight:700; font-size:15px;
}
#workEditorBody .we-contact-card .we-client-car > .work-summary-cell:first-child > :not(.we-contact-avatar) { grid-column:2; }
#workEditorBody .we-contact-card .work-client-link:disabled { opacity:1; }
/* Keep historical pattern expenses intact while removing this optional editor. */
#workEditorBody .we-pattern-purchase { display:none!important; }
#workEditorBody .work-editor-shell--compact .we-service-card__sub--expenses {
  background:linear-gradient(120deg,#403b32,#302f30)!important;
  border:1px solid #796b52!important;
  box-shadow:inset 0 1px 0 #ffffff12;
}
#workEditorBody .we-service-card__sub--expenses :is(.we-row-head,.we-row-head__cell,.we-service-card__sub-head) { color:#e4d5b6; }
#workEditorBody .we-service-card__sub--expenses .work-row { background:#ffffff05; border-color:#74674f; }
#workEditorBody .we-service-card__sub--expenses :is(input,select) { background:#29282b!important; color:#f2ece0; border-color:#82765f; }

/* The thumbnail and its actions belong to the visit summary. */
#workEditorBody .work-car-photo--editor {
  margin-top: 10px !important;
  padding-top: 10px;
  border-top: 1px solid var(--ui-border);
  align-items: flex-start;
  gap: 8px !important;
}
#workEditorBody .work-car-photo--editor .work-car-photo__preview {
  width: 88px;
  height: 64px;
  flex: 0 0 88px;
  overflow: visible;
  border-color: var(--ui-border-strong);
}
.we-photo-link { display: block; height: 100%; border-radius: inherit; }
.we-photo-link img { border-radius: inherit; }
.we-photo-content { flex: 1 1 110px; min-width: 0; }
.we-photo-status { margin: 4px 0 0; font-size: .75rem; line-height: 1.4; }
#workEditorBody .work-car-photo__actions .btn { min-height: 32px !important; }
#workEditorBody #btnWeCarPhotoClear[hidden] { display: none !important; }
#workEditorBody .we-payment-settings .work-summary-grid {
  background: transparent !important;
  border: 0 !important;
}
@media (max-width: 768px) {
  #workEditorBody .work-car-photo__actions .btn { min-height: 44px !important; }
}

.we-photo-link {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.work-photo-dialog {
  width: fit-content;
  min-width: min(320px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  padding: 14px;
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--dm-dialog-radius, 16px);
  background: var(--ui-surface);
  color: var(--ui-text);
}
.work-photo-dialog::backdrop { background: var(--ui-backdrop); }
.work-photo-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.work-photo-dialog__head h3 { margin: 0; font-size: 1rem; }
.work-photo-dialog > img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: calc(100dvh - 106px);
  margin: 0 auto;
  border-radius: 8px;
  object-fit: contain;
}
.work-photo-dialog > [hidden], .work-list-preview[hidden] { display: none; }
.work-list-preview {
  position: fixed;
  z-index: 150;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  width: min(336px, calc(100vw - 16px));
  padding: 10px;
  background: var(--ui-surface-alt);
  color: var(--ui-text);
  border: 1px solid var(--ui-border-strong);
  border-radius: 12px;
}
.work-list-preview__media {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  border-radius: 7px;
  overflow: hidden;
  background: var(--ui-input);
  color: var(--ui-muted);
  padding: 0;
  text-align: center;
  font-size: .72rem;
}
.work-list-preview__media img { width: 100%; height: 100%; object-fit: cover; }
.work-list-preview__summary { display: grid; align-content: start; gap: 3px; overflow-wrap: anywhere; font-size: .82rem; }
.work-list-preview__summary p { margin: 2px 0 0; color: var(--ui-muted); font-size: .75rem; }
