/* Shared Atelier layouts for calendar event tabs. */

.event-editor .flow-off { display: none !important; }

/* Header: dialog title and, for office, the Guided / Quick switch. */
.event-editor .visit-steps { display: flex; flex-direction: column; gap: 16px; padding: 20px 24px 4px; background: var(--card, #fff); color: var(--foreground, #123457); }
.visit-steps .flow-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.visit-steps .flow-title { margin: 0; font-family: var(--font-serif, Newsreader, Georgia, serif); font-size: 26px; font-weight: 400; line-height: 1.15; letter-spacing: -.01em; }

/* Tabs for an existing office visit: every section one click away, Save stays in the top bar. */
.visit-steps .flow-tabs { display: flex; gap: 4px; margin: 0; flex-wrap: wrap; border-bottom: 1px solid var(--border, #e6dfd3); overflow-x: visible; }
.visit-steps .flow-tabs button { position: relative; min-height: 44px; padding: 0 14px; border-radius: 10px 10px 0 0; background: none; color: var(--muted-foreground, #5f6f80); font-size: 14px; font-weight: 600; white-space: nowrap; }
.visit-steps .flow-tabs button:hover { color: var(--foreground, #123457); filter: none; }
.visit-steps .flow-tabs button[aria-selected="true"] { color: var(--foreground, #123457); }
.visit-steps .flow-tabs button[aria-selected="true"]::after { content: ""; position: absolute; inset: auto 14px -1px; height: 2px; border-radius: 2px; background: var(--primary, #123457); }
form[data-flow="office"] .visit-steps { padding-bottom: 0; }
/* Same height on every tab, so the dialog does not jump when the section changes. */
.event-editor form[data-flow="office"] { min-height: min(760px, calc(100dvh - 48px)); }
form[data-flow="office"] .visit-step-footer, form[data-flow="office"] .visit-step-error { display: none; }

/* A section whose every part belongs to another step leaves no gap or divider behind. */
.event-editor.has-flow .event-section:not(:has(> :not(.flow-off))) { display: none; }

/* Footer: Back is quiet, the step's one action is navy. */
.event-editor .visit-step-footer { display: flex; align-items: center; gap: 8px; padding: 12px 24px; background: var(--card, #fff); border-top: 1px solid var(--border, #e6dfd3); position: sticky; bottom: 0; z-index: 2; }
.visit-step-footer .flow-spacer { flex: 1; }
.visit-step-footer .primary-button { min-height: 44px; min-width: 132px; padding: 0 22px; }

/* Problems: named once above the footer, and marked on each field. */
.event-editor .visit-step-error { margin: 0; padding: 0 24px 12px; background: none; color: var(--destructive, #a52121); font-size: 13px; font-weight: 600; }
.event-editor .visit-step-error:empty { display: none; }
.event-editor [aria-invalid="true"] { border-color: var(--destructive, #a52121) !important; box-shadow: 0 0 0 1px var(--destructive, #a52121) !important; }

.event-editor .flow-property-hint { margin-top: -6px; font-size: 13px; color: var(--muted-foreground, #5f6f80); }
.event-editor .flow-property-hint:empty { display: none; }
.event-editor .flow-property-hint[data-state="new"] { display: flex; flex-direction: column; gap: 2px; color: var(--foreground, #123457); }
.event-editor .flow-property-hint small { color: var(--muted-foreground, #5f6f80); }

/* Who goes: how busy each worker already is that day. */
.event-editor .operator-option .flow-load { display: block; font-size: 12px; font-weight: 500; color: var(--muted-foreground, #5f6f80); }
.event-editor .operator-option:has(input:checked) .flow-load { color: inherit; opacity: .8; }

/* Review: a plain list divided by hairlines. */
.event-editor .flow-warning { margin: 0; padding: 10px 14px; border-radius: var(--radius-control, 12px); background: var(--warning-soft, #f4eadb); color: var(--warning, #7a5530); font-size: 14px; }

/* Field, before leaving: when, and what to take. */
.event-editor .flow-leave { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 4px 24px 8px; color: var(--foreground, #123457); }
.event-editor .flow-leave > strong { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-foreground, #5f6f80); }
.event-editor .flow-leave ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.event-editor .flow-leave li { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-top: 1px solid var(--border, #e6dfd3); font-size: 15px; font-weight: 600; }
.event-editor .flow-leave li small { color: var(--muted-foreground, #5f6f80); font-size: 13px; font-weight: 500; }
.event-editor .flow-leave p { margin: 0; font-size: 14px; color: var(--muted-foreground, #5f6f80); }
.event-editor .flow-leave .flow-leave-when { font-family: var(--font-serif, Newsreader, Georgia, serif); font-size: 24px; color: var(--foreground, #123457); }

@media (max-width: 760px) {
  .event-editor .visit-steps { padding: 16px 16px 0; gap: 12px; }
  .visit-steps .flow-title { font-size: 22px; }
  /* A finished step is only its bar on a phone: keep a finger-sized target around it. */
  .event-editor .visit-step-footer { padding: 12px 16px; }
  .visit-step-footer :is([type="submit"], [data-flow-next]) { flex: 1; min-height: 48px; }
  .event-editor .visit-step-error { padding: 0 16px 12px; }
  .event-editor .flow-leave { padding: 4px 16px 8px; }
}

dialog.event-editor .event-actionbar,
dialog.event-editor .event-toolbar-actions,
dialog.event-editor .event-visit-controls { flex-wrap: wrap; min-width: 0; overflow: visible; }
dialog.event-editor .event-actionbar button { white-space: normal; }
.event-property-row, .event-property-location { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; }
.event-property-row .event-property-field { flex: 1 1 14rem; min-width: 0; }
.event-property-row .flow-kind { margin: 0; padding: 0; min-width: 0; }
.event-property-location .secondary-button { display: inline-flex; gap: .4em; align-items: center; text-decoration: none; }
.event-editor.has-flow .event-header { display:grid; gap:16px; }
.event-editor.has-flow .event-header > * { margin-block:0; }
.event-editor.has-flow .event-job-row { display:flex; flex-wrap:wrap; align-items:end; gap:12px; }
.event-editor.has-flow .event-job-field { flex:1 1 16rem; }
.event-editor.has-flow .event-schedule { display:flex; flex-wrap:wrap; align-items:end; gap:12px; }
.event-editor.has-flow .arrival-times {
  display:grid; grid-template-columns: minmax(6rem,auto) auto auto;
  align-items:center; gap:6px; max-width:100%;
}
.arrival-times .arrival-label { grid-column:1 / -1; color:var(--text-secondary); font-size:13px; font-weight:600; }
.arrival-times input[name=time] { width:100%; min-width:0; font-variant-numeric:tabular-nums; }
.arrival-times output { font-variant-numeric:tabular-nums; white-space:nowrap; }
.arrival-times:has([name=time]:enabled) [data-arrival-start] {
 position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%);
}
.arrival-times:has([name=time]:disabled) output { grid-column:1 / -1; min-height:44px; align-content:center; }
.arrival-times .appointment-time-error { grid-column:1 / -1; }
.arrival-times .appointment-time-error:empty { display:none; }
.event-editor .event-protocol-panel {
  display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px;
  padding:12px 0; border-bottom:1px solid var(--border);
}
.event-protocol-panel h3 { margin:0; margin-inline-end:auto; font-size:1rem; }
.event-protocol-panel [data-protocol-complete] { color:var(--success); background:var(--success-soft); border-color:var(--success); }
.save-blocker { outline: 2px solid var(--destructive, var(--danger, currentColor)); outline-offset: 3px; }
.save-blocker-description, .visit-step-error { color: var(--destructive, var(--danger, currentColor)); }


#field-workspace .flow-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); }
#field-workspace .flow-tabs button[aria-pressed="true"] { border-bottom: 2px solid var(--primary); background: var(--secondary); }
#field-workspace [data-field-property-search] { width: min(100%, 28rem); margin-block-end: 12px; }

.leftover-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.leftover-fields [data-unrecorded-material]:not([hidden]) { display: contents; }
.leftover-fields [data-unrecorded-material] > :not(:has([data-stock-unit])) { grid-column: 1 / -1; }
.property-note-dialog .property-note-text { white-space: pre-wrap; overflow-wrap: anywhere; }

.event-editor .field-visit-header {
  position: sticky;
  z-index: 11;
  top: 0;
  background: var(--card);
  flex-shrink: 0;
}
.event-editor .field-visit-header .event-actionbar { position: static; }

.stock-section-tabs.visit-steps { padding:0; margin-block:0 16px; }

html.atelier .event-editor .event-form { background:var(--background); }
html.atelier .event-editor :is(.event-header,.information-section,.materials-section,.invoice-section) {
 background:var(--card); padding:16px; border:1px solid var(--border); border-radius:var(--radius-item);
}
html.atelier .event-editor :is(.flow-head,.event-property-row,.event-property-location) {
 display:flex; flex-wrap:wrap; align-items:center; gap:8px;
}
html.atelier .event-editor.has-flow .event-schedule .event-keys-needed { align-self:end; }
html.atelier .event-editor.has-flow .event-content { background:var(--background); }
html.atelier .event-editor.has-flow .event-section:is(.information-section,.materials-section,.invoice-section) {
 padding:16px; border:1px solid var(--border);
}
html.atelier .event-editor .event-property-field[hidden] { display:none; }
html.atelier .event-editor .arrival-times:has([name=time]:disabled) :is(input[name=time],[data-duration]) { display:none; }
html.atelier .event-editor .extra-hours-control { flex:0 1 auto; }
html.atelier .event-editor .extra-hours-control[open] {
 display:grid; grid-template-columns:max-content minmax(65px,90px); align-items:stretch;
}
html.atelier .event-editor .extra-hours-control[open]::details-content { display:contents; }
html.atelier .event-editor .extra-hours-control[open] > summary { border-start-end-radius:0; border-end-end-radius:0; }
html.atelier .event-editor .extra-hours-control[open] > label { margin:0; }
html.atelier .event-editor .extra-hours-control[open] input {
 height:100%; border-start-start-radius:0; border-end-start-radius:0; margin-inline-start:-1px;
}
html.atelier .event-editor .extra-hours-control[open] [data-extra-hours-value] { display:none; }

html.atelier .event-editor.has-flow .event-header { margin:12px 16px 0; padding:16px; }
html.atelier .event-editor.has-flow .event-content { padding:12px 16px 16px; }
html.atelier .event-editor.has-flow .event-content > .event-section { margin:0; }
html.atelier .event-editor.has-flow .event-property-row > .event-property-field { flex-basis:100%; }
html.atelier .event-editor.has-flow .event-property-row .flow-property-hint { flex-basis:100%; }
html.atelier .event-editor.has-flow .event-actions { gap:8px; }
@media (max-width:480px) {
  html.atelier .event-editor.has-flow .event-header { margin:8px 8px 0; padding:12px; }
  html.atelier .event-editor.has-flow .event-content { padding:8px; }
  html.atelier .event-editor.has-flow .event-section:is(.information-section,.materials-section,.invoice-section) { padding:12px; }
}
/* Event surfaces and controls. */
html.atelier dialog.event-editor { border-top:0; }
.event-editor [data-event-band] { display:none !important; }
html.atelier .event-editor .event-actionbar,
html.atelier .event-editor .event-bottom-ribbon {
  background:var(--text-secondary); color:var(--primary-foreground);
  display:flex; flex-wrap:wrap; align-items:center; gap:8px;
  padding:12px 16px;
}
html.atelier .event-editor .event-actionbar {
  position:sticky; inset-block-start:0; z-index:4;
}
html.atelier .event-editor .field-visit-header .event-actionbar { position:static; }
html.atelier .event-editor .event-actionbar :is(select[name=kind],button) {
  box-sizing:border-box; min-height:40px; padding:4px 12px; border:1px solid var(--border);
  border-radius:var(--radius-control); background-color:var(--card); color:var(--primary);
  font:650 13px/1.2 var(--font-sans);
}
html.atelier .event-editor .event-actionbar select[name=kind] { appearance:auto; padding-inline-end:12px; }
html.atelier .event-editor .event-actionbar button:is([data-delete-report],[type=submit]) { border-color:transparent; color:var(--primary-foreground); }
html.atelier .event-editor .event-actionbar button[data-delete-report] { background-color:var(--destructive); color:var(--destructive-foreground); }
html.atelier .event-editor .event-actionbar button[type=submit] { background-color:var(--success); }
html.atelier .event-editor .event-actionbar :focus-visible { outline:2px solid var(--primary-foreground); outline-offset:2px; }
html.atelier .event-editor .event-bottom-ribbon :is(button,summary) {
  min-height:30px; padding:3px 10px; border-radius:var(--radius-control);
  border:1px solid var(--border); background-color:var(--card); color:var(--primary);
  font-size:12px;
}
html.atelier .event-editor .event-bottom-ribbon .event-save-feedback {
  background:transparent; color:inherit; margin-inline-start:auto; padding:0; text-align:end;
}
html.atelier .event-editor .event-bottom-ribbon [data-visit-save-error] { color:inherit; }
html.atelier .event-editor .visit-steps { background:var(--background); }
.event-editor .visit-steps .flow-tabs { border-bottom-color:transparent; }
.event-property-title {
  border:0; padding:0; background:transparent; color:inherit; font:inherit; text-align:start;
  text-decoration:underline dotted; text-underline-offset:.18em;
}
.event-editor .flow-head .event-property-field { flex:1 1 16rem; }
html.atelier .event-editor .visit-steps .flow-head { justify-content:flex-start; align-items:baseline; }
html.atelier .event-editor .visit-steps .flow-title { font-size:clamp(1.7rem, 3.2vw, 2.45rem); }
.event-editor .flow-head .event-progress-summary { margin:0; color:var(--text-secondary); font-size:.85rem; }
.event-editor .flow-head [data-assigned-operators] { margin-inline-start:auto; }
.event-editor .flow-head .flow-title[hidden] { display:none; }
.assigned-operator-names { display:flex; flex-wrap:wrap; gap:6px; }
.event-editor .assigned-operator-name { border-radius:var(--radius-pill); font-size:.8rem; font-weight:650; }
.event-editor #event-subtitle { field-sizing:content; min-height:44px; resize:none; overflow:hidden; }
.event-editor.has-flow .arrival-times {
  grid-template-columns:6ch minmax(7ch,max-content) auto;
  column-gap:4px;
  padding:0 8px; border:1px solid var(--input); border-radius:var(--radius-control);
  background:var(--card); position:relative; margin-top:1.35rem;
}
.arrival-times .arrival-label { position:absolute; inset-inline-start:0; inset-block-start:-1.35rem; }
html.atelier .event-editor .arrival-times :is([name=time],#atelier-boost) { border:0; padding-inline:4px; background:transparent; }
.event-editor.has-flow .arrival-times [data-duration] { grid-column:auto; min-width:36px; padding:0; }
.event-editor.has-flow .arrival-times [data-duration][aria-pressed=true] { background:var(--secondary); color:var(--primary); }
.arrival-stopwatch {
  position:relative; display:grid; place-items:center; width:24px; height:24px;
  border:1.5px solid currentColor; border-radius:50%;
  font-size:10px; font-weight:750; font-variant-numeric:tabular-nums;
}
.arrival-stopwatch::before {
  content:""; position:absolute; inset-block-start:-4px; inset-inline-start:50%;
  transform:translateX(-50%); width:7px; height:3px; border-radius:1px; background:currentColor;
}
.event-editor .event-bottom-ribbon { position:static; margin-top:12px; }
.event-bottom-ribbon[hidden],.event-bottom-ribbon details[hidden] { display:none !important; }
.event-bottom-ribbon details[open] { display:flex; align-items:center; flex-wrap:wrap; gap:8px; flex:1 1 32rem; }
.event-bottom-ribbon details[open]::details-content { display:contents; }
.event-bottom-ribbon summary { display:inline-flex; align-items:center; cursor:pointer; }
.event-bottom-ribbon .event-field { flex:1 1 12rem; color:inherit; }
.event-editor .event-bottom-ribbon .event-field textarea { min-height:3rem; padding:6px 8px; font-size:13px; }
.event-bottom-ribbon .visit-guidance { color:inherit; }
.event-editor .office-comment { display:grid; gap:10px; }
html.atelier .event-editor [data-flow-current=plan] .information-section {
  border:0; background:transparent; padding:0;
}
.event-editor .event-team-panel, .event-editor [data-flow-current=plan] .office-comment {
  background:var(--card); border:1px solid var(--border);
  border-radius:var(--radius-item); padding:16px; margin:0 0 12px;
}
.event-team-panel { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; }
.event-team-panel .operator-picker, .event-team-panel .subcontractor-controls { flex-basis:100%; }
.event-team-panel > .check-label {
  border:1px solid var(--input); border-radius:var(--radius-control);
  min-height:44px; margin:0; padding:0 12px;
}
.event-editor .office-comment .comment-heading { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.event-editor .office-comment .comment-heading strong { margin-inline-end:auto; }
[data-office-note-preview], [data-property-note-selection], .property-note-dialog-cards { display:grid; gap:8px; }
.event-note-card, .property-note-dialog-cards > .property-note-choice {
  border:1px solid var(--border); border-radius:var(--radius-control);
  background:var(--muted); padding:8px 12px; margin:0;
}
.event-note-card { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.event-note-card[draggable=true] { cursor:grab; }
.event-note-order { display:flex; flex:none; }
.property-note-composer { position:relative; }
.property-note-composer textarea { padding-top:2.55rem; }
.property-note-composer .property-note-toggle { position:absolute; inset:24px 12px auto auto; padding:4px; cursor:pointer; }
.property-note-toggle input { position:absolute; opacity:0; }
.property-note-switch-track {
  display:block; width:34px; height:18px; border-radius:var(--radius-pill);
  background:var(--neutral-soft); border:1px solid var(--input);
}
.property-note-switch-track::before {
  content:''; display:block; width:12px; height:12px; border-radius:50%;
  background:var(--card); margin:2px; box-shadow:0 0 0 1px var(--input);
}
.property-note-toggle input:checked + span { background:var(--success); }
.property-note-toggle input:checked + span::before { transform:translateX(15px); }
.property-note-toggle input:focus-visible + span { outline:2px solid var(--ring); outline-offset:3px; }
.event-editor .attachment-media .section-file-preview { aspect-ratio:1; overflow:hidden; }
.event-editor .attachment-media :is(.preview-image,.preview-video) { width:100%; height:100%; object-fit:cover; }
.event-editor .attachment-media .preview-image-link { display:block; width:100%; height:100%; }
.event-editor .attachment-media .file-remove-control { inset:6px 6px auto auto; }
dialog.event-photo-viewer {
  position:fixed; inset:0; width:100%; max-width:none; height:100%; max-height:none;
  margin:0; padding:0; border:0; background:transparent; overflow:hidden; touch-action:none;
}
.event-photo-viewer::backdrop { background:rgb(0 0 0 / .78); backdrop-filter:blur(8px); }
.event-photo-viewer img {
  position:absolute; inset:0; margin:auto; max-width:100%; max-height:100%;
  object-fit:contain; user-select:none;
}
.event-photo-viewer button { position:absolute; inset:16px 16px auto auto; z-index:1; font-size:1.5rem; }

/* The visit keeps purchasing and stock actions in separate panels. */
html.atelier .event-editor [data-flow-current=material] .materials-section {
  background:transparent; border:0; padding:0;
}
html.atelier .event-editor [data-flow-current=material] #material-categories {
  margin:0; padding:0; border:0;
}
html.atelier .event-editor [data-flow-current=material] .event-material-area {
  background:var(--card); border:1px solid var(--border);
  border-radius:var(--radius-item); padding:16px;
}
.event-editor .installation-material[data-installation-card] { cursor:pointer; }
.event-editor .installation-card-link {
  padding:0; border:0; background:transparent; color:var(--primary);
  text-align:start; text-decoration:underline; text-underline-offset:.18em;
}
.event-editor .field-pickup { margin-block-start:12px; }
.event-editor [data-stock-summary] h5 { margin:16px 0 6px; font-size:.875rem; color:var(--primary); }

/* Consistent event surfaces and unobtrusive scrolling. */
html.atelier .event-editor .event-form { scrollbar-color:var(--muted-foreground) var(--background); scrollbar-width:thin; }
html.atelier .event-editor.has-flow .event-header { margin:12px 12px 0; }
html.atelier :is(.event-editor.has-flow .event-content,#atelier-boost) { padding:12px; }
html.atelier .event-editor .event-form::-webkit-scrollbar { width:8px; background:var(--background); }
html.atelier .event-editor .event-form::-webkit-scrollbar-thumb { background:var(--muted-foreground); border-radius:8px; }
html.atelier .event-editor .event-form::-webkit-scrollbar-button { display:none; }
html.atelier .event-editor.has-flow .event-actionbar { padding:12px; }
html.atelier .event-editor :is(.event-header,.event-content) { padding-inline:12px; }
html.atelier .event-editor .event-content { gap:12px; padding-block:0 12px; }
html.atelier .event-editor .event-team-panel,
html.atelier .event-editor [data-flow-current=plan] .office-comment { margin:0 0 12px; }
.event-property-location { align-items:center; }
.event-property-location [data-property-location] { display:contents; }
.event-property-location .event-keys-needed { min-height:44px; margin:0; }
.event-editor .event-team-panel [data-office-assignment] { display:inline-flex; }
html.atelier .event-editor .event-bottom-ribbon :is(button,summary) { min-height:32px; }

/* Only the ivory body owns scrolling. Ribbons span the complete dialog. */
html.atelier dialog.event-editor.has-flow .event-form { overflow:hidden; scrollbar-gutter:auto; display:flex; flex-direction:column; }
html.atelier .event-editor .event-ivory-scroll { flex:1 1 auto; min-height:0; overflow-y:auto; overflow-x:hidden; scrollbar-gutter:auto; background:var(--background); }
html.atelier .event-editor .event-ivory-scroll .event-content { overflow:visible; flex-shrink:0; }
html.atelier .event-editor .event-ivory-scroll { scrollbar-width:none; }
.event-editor.has-flow .event-form { position:relative; }
.event-scroll-rail { position:absolute; inset-inline-end:0; width:8px; overflow-y:scroll; overflow-x:hidden; z-index:2; }
.event-scroll-rail::-webkit-scrollbar { width:8px; background:var(--background); }
.event-scroll-rail::-webkit-scrollbar-thumb { background:var(--muted-foreground); border-radius:8px; }
.event-scroll-rail::-webkit-scrollbar-button { display:none; height:0; width:0; }
html.atelier .event-editor .event-bottom-ribbon { margin:0; padding:10px 12px; }
html.atelier .event-editor .event-bottom-ribbon .save-feedback { color:var(--primary-foreground); margin:0 0 0 auto; padding:0; background:transparent; text-align:right; }
html.atelier .event-editor .event-bottom-ribbon :is(summary,[data-appointment-action]) { box-sizing:border-box; height:32px; min-height:32px; padding:4px 10px; font-size:12px; line-height:22px; }
html.atelier .event-editor .flow-head { display:grid; grid-template-columns:1fr auto 1fr; align-items:baseline; }
html.atelier .event-editor .flow-head .flow-title { font-family:var(--font-serif); }
.event-property-change { border:0; background:transparent; color:var(--primary); font:inherit; font-size:22px; margin-inline-start:8px; cursor:pointer; }
.event-editor [data-office-assignment] { border-color:var(--subcontract-edge); background:var(--subcontract-soft); color:var(--subcontract-edge); }
.event-editor [data-office-assignment] .operator-avatar { background:var(--subcontract-edge); color:var(--card); }
@media(max-width:640px){ html.atelier .event-editor .flow-head { display:flex; flex-wrap:wrap; } }

html.atelier .event-editor.has-flow .event-header { margin:12px 12px 0; }
html.atelier .event-editor.has-flow .event-content { padding:12px; }
html.atelier .event-editor .event-material-area { margin-inline:0; }
html.atelier .event-editor .event-bottom-ribbon #unschedule-reason { margin:0 0 0 auto; text-align:end; }
.event-editor .event-form > .save-feedback:empty { display:none; }
.event-editor .event-team-panel .operator-option { padding:4px 8px; border-radius:var(--radius-control); }
.event-editor .crew-reports > details, .event-editor [data-visit-charges] { background:var(--card); }
.event-editor:has(.field-visit-header) :is([data-crew-reports],[data-office-assignment],[data-custody-reassignment]) { display:none !important; }
.event-editor [data-team-report-guidance] { margin:0 0 8px; }
.event-editor [data-visit-charges] table { width:100%; border-collapse:collapse; text-align:start; table-layout:fixed; }
.event-editor [data-visit-charges] :is(th,td) { text-align:start; border-bottom:1px solid var(--border); padding:6px; overflow-wrap:anywhere; }
html.atelier .event-editor .event-bottom-ribbon #unschedule-reason { color:var(--primary-foreground); }

html.atelier body .event-editor :is(.attachment-media,.item-photo) .file-remove-control {
  background:transparent; border-radius:0; box-shadow:none;
}
html.atelier body .event-editor :is(.attachment-media,.item-photo) .file-remove-control circle { display:none; }
html.atelier body .event-editor :is(.attachment-media,.item-photo) .file-remove-control path {
  stroke:var(--destructive); stroke-width:3;
}
html.atelier body .event-editor :is(.attachment-media,.item-photo) :is(.preview-image,.preview-video) {
  aspect-ratio:1; object-fit:cover;
}
.event-property-change:disabled { color:var(--muted-foreground); opacity:.5; cursor:default; }
.event-editor [data-property-change-reason] { font:400 12px var(--font-sans); color:var(--muted-foreground); white-space:normal; }
html.atelier .event-editor .event-bottom-ribbon .event-ribbon-control {
  display:inline-flex; align-items:center; justify-content:center;
  width:152px; height:32px; min-height:32px; padding:0 6px; border:1px solid var(--border);
  border-radius:var(--radius-control); font:600 12px/1 var(--font-sans);
  background:var(--card); color:var(--primary);
}
html.atelier .event-editor .event-bottom-ribbon .event-ribbon-control:hover:not(:disabled) { background:var(--muted); }
.event-ribbon-control::-webkit-details-marker { display:none; }
html.atelier .event-editor .event-bottom-ribbon { flex-wrap:nowrap; }
html.atelier .event-editor .event-bottom-ribbon .event-cancellation {
  flex:1 1 0; min-width:0;
}
html.atelier .event-editor .event-bottom-ribbon .event-cancellation[open] {
  display:flex; flex:1 1 0; flex-wrap:nowrap; gap:6px;
}
.event-cancellation > summary { flex-shrink:0; }
.event-bottom-ribbon #unschedule-reason { flex:0 1 25%; }
.event-cancellation-field {
  position:relative; flex:1 1 0; min-width:0; max-width:320px; height:32px;
  display:flex; align-items:center; background:var(--card); border-radius:var(--radius-control);
}
html.atelier :is(.event-editor .event-cancellation-field input,#atelier-boost) {
  box-sizing:border-box; min-height:0; height:32px; min-width:0; flex:1; width:0; padding:0 8px;
  background:transparent; border:0; font-size:12px;
}
html.atelier .event-editor .event-bottom-ribbon .event-cancellation-submit {
  height:26px; min-height:26px; margin-inline-end:3px; white-space:nowrap;
  background:var(--destructive); color:var(--primary-foreground);
}
@media(max-width:600px) {
  html.atelier .event-editor .event-bottom-ribbon .event-cancellation[open] { display:contents; }
  html.atelier .event-editor .event-bottom-ribbon .event-ribbon-control { width:min(152px,calc((100vw - 56px) / 2)); }
  .event-cancellation-field { flex-basis:100%; }
}
html.atelier :is(.event-editor .event-team-panel .operator-option,#atelier-boost) {
  padding:4px 8px; min-height:34px; font-size:13px;
  border-color:transparent; background:var(--background);
}
html.atelier :is(.event-editor .event-team-panel .operator-option:has(input:checked),#atelier-boost) {
  border-color:var(--ring); background:var(--muted);
}
.event-editor .event-team-panel .operator-options { display:flex; flex-wrap:wrap; gap:6px; }
.event-editor .event-team-panel legend { font-size:13px; color:var(--muted-foreground); }
html.atelier :is(.event-editor .event-team-panel [data-office-assignment],#atelier-boost) {
  color:var(--subcontract-edge); background:var(--subcontract-soft); border-color:var(--subcontract-edge);
}
