/* Scoped complaint, staff editor, and custom dialog refinements. */
div:has(> .complaint-modal-scroll) { max-width: 960px; }
.complaint-modal-scroll .input:disabled {
  cursor: default;
  opacity: 1;
  color: #5b6b66;
  background: #f4f7f5;
}
@media (min-width: 900px) {
  .complaint-modal-scroll > div { grid-template-columns: 260px minmax(0, 1fr); }
}
.staff-editor-overlay { padding: 24px; overflow: hidden; z-index: 90; }
.staff-editor-overlay .staff-editor-card {
  width: 100%;
  max-width: 680px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e1e8e4;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 80px #0e282433;
}
.staff-editor-card > form {
  display: flex;
  flex-direction: column;
  max-height: inherit;
  min-height: 0;
  outline: none;
}
.staff-editor-header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid #e1e8e4;
}
.staff-editor-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #0f7662;
  background: #edf5f1;
}
.staff-editor-heading { flex: 1; min-width: 0; }
.staff-editor-heading h2 { margin: 0; color: #17211f; font-size: 22px; line-height: 28px; font-weight: 700; }
.staff-editor-heading p { margin: 4px 0 0; color: #5b6b66; font-size: 13px; line-height: 20px; }
.staff-editor-close { flex-shrink: 0; width: 40px; height: 40px; }
.staff-editor-body {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #0f766247 transparent;
  scrollbar-gutter: stable;
  padding: 20px 24px;
}
.staff-editor-section { min-width: 0; margin: 0; padding: 0; border: 0; }
.staff-editor-section + .staff-editor-section { margin-top: 22px; }
.staff-editor-section legend { margin-bottom: 12px; padding: 0; color: #17211f; font-size: 14px; line-height: 20px; font-weight: 700; }
.staff-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.staff-editor-field { display: flex; flex-direction: column; min-width: 0; gap: 6px; }
.staff-editor-field--wide { grid-column: 1 / -1; }
.staff-editor-field > span { color: #5b6b66; font-size: 13px; line-height: 20px; font-weight: 600; }
.staff-editor-field .input { width: 100%; min-width: 0; height: 42px; margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 14px; line-height: 20px; color: #17211f; }
.staff-editor-field .input::placeholder { color: #5b6b66; font-weight: 400; }
.staff-editor-field .input:disabled { opacity: .7; cursor: wait; }
.staff-editor-footer {
  display: flex;
  flex-shrink: 0;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  border-top: 1px solid #e1e8e4;
  background: #f8faf9;
}
.staff-editor-footer > p { color: #5b6b66; font-size: 12px; line-height: 18px; }
.staff-editor-actions { display: flex; gap: 10px; }
.staff-editor-actions button { min-height: 42px; min-width: 100px; justify-content: center; border-radius: 10px; }
.staff-editor-card button:disabled { opacity: .6; cursor: wait; transform: none; }
.homey-dialog {
  width: min(440px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 16px;
  color: #17211f;
  background: #fff;
  box-shadow: 0 24px 80px #0e282438;
  font: inherit;
  overflow: auto;
}
.homey-dialog::backdrop { background: #102f2a99; }
.homey-dialog [hidden] { display: none; }
.homey-dialog__form { margin: 0; }
.homey-dialog__header { display: flex; align-items: center; gap: 12px; padding: 20px 22px 0; }
.homey-dialog__icon { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; background: #edf5f1; color: #0f7662; }
.homey-dialog--destructive .homey-dialog__icon { background: #fbedeb; color: #b44e4b; }
.homey-dialog__header h2 { flex: 1; margin: 0; font-size: 18px; line-height: 26px; font-weight: 700; }
.homey-dialog__close { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; padding: 0; border: 1px solid #e1e8e4; border-radius: 10px; color: #5b6b66; background: #fff; cursor: pointer; }
.homey-dialog__close:hover { background: #f4f7f5; }
.homey-dialog__body { padding: 16px 22px 22px; max-height: 55vh; max-height: 55dvh; overflow-y: auto; }
.homey-dialog__body p { margin: 0; font-size: 14px; line-height: 22px; color: #5b6b66; white-space: pre-line; overflow-wrap: anywhere; }
.homey-dialog .homey-dialog__input { margin-top: 16px; height: 44px; font-size: 16px; }
.homey-dialog__actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid #e1e8e4; background: #f8faf9; }
.homey-dialog__actions button { justify-content: center; min-width: 96px; min-height: 42px; border-radius: 10px; }
.homey-dialog--destructive .homey-dialog__accept { color: #fff; background: #b44e4b; box-shadow: none; }
.homey-dialog--destructive .homey-dialog__accept:hover { background: #983c39; }
.homey-dialog button:focus-visible { outline: 2px solid #0f7662; outline-offset: 3px; }
@media (max-width: 599px) {
  .staff-editor-overlay { padding: 10px; }
  .staff-editor-overlay .staff-editor-card { max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); border-radius: 16px; }
  .staff-editor-header { padding: 16px; gap: 10px; }
  .staff-editor-heading h2 { font-size: 20px; line-height: 26px; }
  .staff-editor-heading p { font-size: 12px; line-height: 18px; }
  .staff-editor-body { padding: 18px 16px; }
  .staff-editor-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .staff-editor-field .input { font-size: 16px; height: 44px; }
  .staff-editor-footer { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 16px; }
  .staff-editor-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .staff-editor-actions button { min-width: 0; min-height: 44px; }
  .homey-dialog__header { padding: 18px 18px 0; }
  .homey-dialog__body { padding: 14px 18px 20px; }
  .homey-dialog__actions { padding: 12px 18px; }
}
