.mf-dialog {
  --mf-ink: #26372b;
  --mf-muted: #676f62;
  --mf-line: #d7dacd;
  --mf-paper: #fffef8;
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: min(456px, calc(100% - 28px));
  max-height: min(90dvh, 820px);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #cbd0be;
  border-radius: 18px;
  box-shadow: 0 18px 75px #18241833;
  background: var(--mf-paper);
  color: var(--mf-ink);
  font: inherit;
}
.mf-dialog::backdrop {
  background: rgb(27 38 28 / 44%);
}
html:has(.mf-dialog[open]) {
  overflow: hidden;
}
.mf-dialog * {
  box-sizing: border-box;
}
.mf-dialog [hidden] {
  display: none !important;
}
.mf-dialog button,
.mf-dialog input,
.mf-dialog textarea {
  font: inherit;
}
.mf-dialog button {
  cursor: pointer;
}
.mf-dialog :focus-visible {
  outline: 3px solid #67914b;
  outline-offset: 3px;
}
.mf-form {
  margin: 0;
  padding: 21px 24px 23px;
}
.mf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.mf-header h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 680;
  color: var(--mf-ink);
}
.mf-header h2:focus {
  outline: none;
}
.mf-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-right: -8px;
  border: 0;
  border-radius: 50%;
  color: var(--mf-muted);
  background: transparent;
}
.mf-close span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f0f1e8;
  font-size: 24px;
  line-height: 1;
}
.mf-fields {
  display: grid;
  gap: 18px;
}
.mf-field {
  display: grid;
  gap: 8px;
  min-width: 0;
  font-size: 14px;
  font-weight: 630;
  color: var(--mf-ink);
}
.mf-field small {
  font-weight: 450;
  color: var(--mf-muted);
  font-size: 13px;
  line-height: 1.5;
}
.mf-field input,
.mf-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--mf-line);
  border-radius: 8px;
  background: #fff;
  color: var(--mf-ink);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}
.mf-field textarea {
  min-height: 112px;
  resize: vertical;
}
.mf-field ::placeholder {
  color: #777d72;
  opacity: 1;
}
.mf-footer {
  display: grid;
  gap: 3px;
  margin-top: 22px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.mf-primary {
  min-height: 48px;
  padding: 10px;
  border: 1px solid #293f2d;
  border-radius: 9px;
  background: #293f2d;
  color: white;
  font-size: 16px;
  font-weight: 650;
}
.mf-primary:hover {
  background: #364e36;
}
.mf-review-changes {
  padding: 10px 12px;
  border: 1px solid #dfc9af;
  border-radius: 8px;
  background: #fff8ec;
  color: #734922;
  overflow-wrap: anywhere;
}
.mf-review-changes p {
  margin: 5px 0 0;
  white-space: pre-wrap;
}
.mf-review-target {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--mf-muted);
  font-size: 14px;
}
.mf-review-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.mf-back {
  min-height: 48px;
  border: 1px solid var(--mf-line);
  border-radius: 9px;
  color: var(--mf-ink);
  background: white;
}
.mf-danger {
  border-color: #844a3a;
  background: #844a3a;
}
.mf-danger:hover {
  background: #703d2f;
}
.mf-link {
  justify-self: center;
  min-height: 44px;
  padding: 7px 12px;
  border: 0;
  background: transparent;
  color: #445d3d;
  font-size: 14px;
  font-weight: 550;
}
.mf-dialog [disabled] {
  cursor: default;
  opacity: 0.65;
}
.mf-error,
.mf-file-error {
  margin: 15px 0 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.55;
  color: #943e2a;
}
.mf-area {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: -3px 0 0;
  color: var(--mf-muted);
  font-size: 13px;
}
.mf-area strong {
  color: var(--mf-ink);
  font-size: 14px;
  font-weight: 600;
}
.mf-public-note {
  margin: 0 0 6px;
  color: var(--mf-muted);
  font-size: 13px;
  line-height: 1.5;
}
.mf-pickers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.mf-transfer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  margin: 5px 0;
  color: var(--mf-muted);
  font-size: 13px;
}
.mf-transfer progress {
  grid-row: 2;
  align-self: start;
  width: 100%;
  height: 6px;
  accent-color: #416345;
}
.mf-transfer button {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: #6b4334;
}
.mf-preview-fallback {
  min-height: 90px;
  padding: 12px;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 12px;
  background: #eef0e7;
  color: var(--mf-muted);
}
.mf-file-label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  min-height: 52px;
  padding: 8px 12px;
  border: 1px dashed #a8b29b;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #445741;
  background: #f5f6ee;
}
.mf-file-label:focus-within {
  outline: 3px solid #67914b;
  outline-offset: 3px;
}
.mf-plus {
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}
.mf-file-label input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.mf-hint {
  margin: 7px 0 0;
  font-size: 12px;
  color: var(--mf-muted);
}
.mf-attachments {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none;
  gap: 9px;
  padding: 0;
  margin: 10px 0 0;
}
.mf-attachments:empty {
  display: none;
}
.mf-attachment {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--mf-line);
  border-radius: 8px;
  background: #fff;
}
.mf-attachment img,
.mf-attachment video {
  display: block;
  width: 100%;
  height: 100px;
  object-fit: contain;
  background: #eef0e7;
}
.mf-attachment video {
  background: #1c241d;
}
.mf-attachment div {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: space-between;
  padding-left: 8px;
}
.mf-attachment div span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.mf-remove {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6b4334;
  font-size: 12px;
}
@media (max-width: 540px) {
  .mf-dialog {
    inset: auto 0 0;
    width: 100%;
    max-width: none;
    max-height: min(95dvh, 850px);
    margin: 0;
    border-bottom: 0;
    border-radius: 17px 17px 0 0;
  }
  .mf-form {
    padding: 15px max(18px, env(safe-area-inset-right)) 14px max(18px, env(safe-area-inset-left));
  }
  .mf-header {
    margin-bottom: 16px;
  }
}
