.record-editor {
  padding: 0;
  color: var(--text);
  background: #080808;
  border: 1px solid var(--line);
  border-radius: 14px;
  width: min(840px, calc(100vw - 32px));
  max-height: calc(100svh - 40px);
  overflow: auto;
}
.record-editor::backdrop { background: rgb(0 0 0 / 78%); }
.record-editor-form { margin: 0; }
.record-editor-heading,
.record-editor-footer {
  position: sticky;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 28px;
  background: #080808;
}
.record-editor-heading { top: 0; border-bottom: 1px solid var(--line); }
.record-editor-heading h2 { font-size: 21px; line-height: 1.3; font-weight: 500; margin: 0; }
.record-editor-footer { bottom: 0; justify-content: flex-end; border-top: 1px solid var(--line); }
.record-editor-body { padding: 6px 28px 24px; }
.record-editor .form-section { margin: 26px 0 0; padding: 0; }
.record-editor .form-section h3 { margin: 0 0 14px; font-size: 17px; font-weight: 500; }
.record-editor .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.record-editor .field { min-width: 0; display: grid; gap: 7px; align-content: start; }
.record-editor .field label { color: var(--muted); font-size: 14px; }
.record-editor .form-field-wide { grid-column: 1 / -1; }
.record-editor input:not([type=checkbox]),
.record-editor textarea,
.record-editor select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  background: #111;
  border: 1px solid #303030;
  border-radius: 7px;
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
}
.record-editor select { appearance: auto; }
.record-editor textarea { resize: vertical; line-height: 1.5; }
.record-editor input::placeholder { color: var(--dim); }
.record-editor input:disabled { opacity: .6; }
.record-editor .form-help { margin: 0 0 12px; font-size: 13px; line-height: 1.5; }
.record-editor .field .form-help { margin: 0; }
.record-editor .form-error { color: var(--red); }
.record-editor-form > .form-error { margin: 20px 28px 0; }
.record-editor .owner-editors { display: grid; gap: 14px; }
.record-editor .owner-editor { min-width: 0; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; }
.record-editor .owner-editor legend { padding: 0 6px; color: var(--muted); font-size: 14px; }
.record-editor .owner-heading { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.record-editor .form-remove { color: var(--muted); font-size: 13px; }
.record-editor .form-add { margin-top: 14px; }
.record-editor .premise-selection { display: grid; max-height: 280px; overflow-y: auto; gap: 6px; margin-top: 10px; }
.record-editor .premise-option { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.record-editor .premise-option input { width: 18px; height: 18px; margin-top: 3px; flex-shrink: 0; accent-color: var(--green); }
.record-editor .premise-option span { display: grid; min-width: 0; overflow-wrap: anywhere; }
.record-editor .premise-option strong { font-weight: 500; }
.record-editor .premise-option .muted { font-size: 13px; }
.record-editor [hidden] { display: none !important; }
@media (max-width: 600px) {
  .record-editor { width: 100%; max-height: 100svh; height: 100svh; max-width: 100%; margin: 0; border-radius: 0; border: 0; }
  .record-editor-heading { padding: max(18px, env(safe-area-inset-top)) 18px 18px; }
  .record-editor-heading h2 { font-size: 19px; }
  .record-editor-body { padding: 0 18px 24px; }
  .record-editor-footer { padding: 16px 18px max(16px, env(safe-area-inset-bottom)); }
  .record-editor .form-grid { grid-template-columns: minmax(0, 1fr); }
  .record-editor .owner-editor { padding: 12px; }
  .record-editor-form > .form-error { margin: 16px 18px 0; }
}
