.calendar-admin-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
}
.calendar-admin-controls[hidden],
.calendar-row-form [hidden] { display: none; }
#calendar-admin-status,
.calendar-row-status,
.calendar-conflict p {
  color: var(--muted);
  font: 400 13px/1.5 var(--body);
}
.v4 .venue-schedule .calendar-edit svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}
.v4 .venue-schedule .lesson.calendar-editing {
  display: block;
  margin: 12px 0;
  padding: 24px;
  border: 1px solid var(--venue-accent);
  border-radius: 20px;
  background: var(--paper-deep);
}
.calendar-row-form,
.calendar-row-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.calendar-row-form { scroll-margin-block: 110px; }
.calendar-row-form legend {
  margin-bottom: 20px;
  padding: 0;
  color: var(--venue-accent);
  font: 700 11px/1.5 var(--body);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.calendar-row-primary,
.calendar-row-details {
  display: grid;
  gap: 18px;
}
.calendar-row-primary {
  grid-template-columns: 110px minmax(0, 1fr) minmax(170px, .4fr);
  align-items: end;
}
.calendar-row-details {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 20px;
}
.calendar-row-form label {
  display: block;
  min-width: 0;
  color: var(--ink);
  font: 600 12px/1.5 var(--body);
}
.calendar-row-form label > span { color: var(--muted); font-weight: 400; }
.v4 .calendar-row-form input,
.v4 .calendar-row-form select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: 400 16px/1.4 var(--body);
}
.v4 .calendar-row-name input {
  padding-top: 6px;
  padding-bottom: 6px;
  font: 400 30px/1.15 var(--display);
  text-transform: uppercase;
}
.v4 .calendar-row-form input[type="time"] { padding-inline: 8px; }
.v4 .calendar-row-form input:focus-visible,
.v4 .calendar-row-form select:focus-visible {
  outline: 2px solid var(--venue-accent);
  outline-offset: 2px;
}
.calendar-row-actions,
.calendar-delete-confirm {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.calendar-remove {
  margin-right: auto;
  min-height: 44px;
  padding: 8px 0;
  background: transparent;
  color: #b51f3a;
  font: 600 13px/1.5 var(--body);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.v4 .calendar-row-form .calendar-save,
.v4 .calendar-row-form .calendar-delete {
  background: var(--venue-accent);
  border-color: var(--venue-accent);
  color: #fff;
}
.v4 .calendar-row-form .calendar-save:hover,
.v4 .calendar-row-form .calendar-delete:hover {
  background: #fff;
  color: var(--venue-accent);
}
.calendar-row-status:not(:empty),
.calendar-conflict { margin-top: 16px; }
.calendar-conflict p { margin-bottom: 12px; }
.calendar-delete-confirm p { flex: 1 1 200px; font: 600 14px/1.5 var(--body); }
@media (max-width: 700px) {
  .v4 .venue-schedule .calendar-edit > span { display: none; }
  .v4 .venue-schedule .lesson.calendar-editing { padding: 18px; }
  .calendar-row-primary { grid-template-columns: 112px minmax(0, 1fr); gap: 16px 12px; }
  .calendar-row-name { grid-column: 1 / -1; grid-row: 1; }
  .calendar-row-access { grid-column: 2; }
  .calendar-row-details { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .v4 .calendar-row-name input { font-size: 26px; }
  .calendar-remove { flex-basis: 100%; text-align: left; }
  .calendar-row-actions .v3-pill { flex: 1; min-width: 0; padding: 12px; }
}

#site-editor-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 46px;
  background: #f8f9f4;
  color: #20211f;
  border-bottom: 1px solid #ccd1c4;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 7px 18px;
  font:
    12px/1.5 Manrope,
    system-ui,
    sans-serif;
  box-sizing: border-box;
}
#site-editor-bar[hidden] { display: none; }
#site-editor-status {
  margin-right: auto;
  max-width: 75%;
  font-size: 11px;
}
#site-editor-bar button,
#site-editor-inspector button {
  font:
    600 11px/1.5 Manrope,
    system-ui,
    sans-serif;
  padding: 6px 14px;
  min-height: 31px;
  white-space: nowrap;
  border: 1px solid #a2ab97;
  border-radius: 5px;
  background: #f8f9f4;
  color: #20211f;
  cursor: pointer;
}
#site-editor-bar #site-editor-save,
#site-editor-inspector #site-editor-field-apply {
  background: #273b22;
  color: #f6f7f1;
  border-color: #273b22;
}
#site-editor-bar button:disabled {
  opacity: 0.6;
  cursor: wait;
}
#site-editor-bar button:focus-visible,
#site-editor-inspector :focus-visible {
  outline: 2px solid #547643;
  outline-offset: 3px;
}
body.editor-active .site-header {
  top: 46px;
}
html.editor-active {
  scroll-padding-top: 152px;
}
.editor-active #site-editor-bar {
  background: #eef5e5;
}
.editor-active [data-editor-text] {
  cursor: text;
  outline: 1px dashed #617b4380;
  outline-offset: 2px;
  min-width: 3px;
}
.editor-active [data-editor-text]:hover,
.editor-active [data-editor-text]:focus {
  outline: 2px solid #486a33;
  outline-offset: 3px;
}
.editor-active [data-editor-image] {
  cursor: copy;
  outline: 3px dashed #7ca15d;
  outline-offset: -5px;
}
.editor-active
  :is(input[placeholder], textarea[placeholder], select):not(
    [data-editor-ui] *
  ) {
  cursor: pointer;
}
.editor-active [data-editor-text][contenteditable] {
  -webkit-user-select: text;
  user-select: text;
}
#site-editor-inspector {
  width: min(470px, calc(100vw - 32px));
  padding: 25px;
  border: 1px solid #bbc3b3;
  border-radius: 10px;
  color: #20211f;
  background: #f4f5ef;
  max-height: 90dvh;
  font:
    13px/1.7 Manrope,
    system-ui,
    sans-serif;
}
#site-editor-inspector h2 {
  font:
    700 20px/1.4 Manrope,
    system-ui,
    sans-serif;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}
#site-editor-inspector label {
  display: block;
  font-size: 12px;
  margin-bottom: 8px;
}
#site-editor-inspector textarea {
  width: 100%;
  padding: 11px;
  border: 1px solid #aab39e;
  background: #fbfcf7;
  border-radius: 4px;
  resize: vertical;
  font:
    14px/1.7 Manrope,
    system-ui,
    sans-serif;
  color: #20211f;
}
#site-editor-inspector form > div {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 16px;
}
#site-editor-field-error {
  font-size: 12px;
  color: #9b3425;
  margin: 10px 0;
}
#site-editor-inspector::backdrop {
  background: #17211399;
}
@media (max-width: 700px) {
  #site-editor-bar {
    padding: 7px 11px;
    gap: 7px;
  }
  #site-editor-status {
    font-size: 10px;
    max-width: 57%;
    line-height: 1.4;
  }
  #site-editor-bar button {
    font-size: 10px;
    padding: 6px 10px;
  }
  html.editor-active {
    scroll-padding-top: 130px;
  }
  .editor-active #site-editor-bar {
    min-height: 68px;
  }
  body.editor-active .site-header {
    top: 68px;
  }
}

.site-editor-image-button {
  position: fixed;
  z-index: 110;
  padding: 5px 10px;
  min-height: 28px;
  border: 1px solid #62764f;
  border-radius: 5px;
  background: #f2f8e9;
  color: #243a1a;
  font:
    600 11px/1.5 Manrope,
    system-ui,
    sans-serif;
  cursor: pointer;
  box-shadow: 0 1px 4px #121a141a;
}
.site-editor-image-button[hidden] {
  display: none !important;
}
