.inline-editor-drawer.order-remark-inline-drawer {
  max-width: min(430px, calc(100vw - 20px));
}

.order-remark-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.order-remark-cell-preview,
.order-remark-attachment-preview {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: zoom-in;
}

.order-remark-cell-preview {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: max-content;
  max-width: 100%;
  font-size: 11px;
  color: var(--muted, #667085);
}

.order-remark-cell-image,
.order-remark-cell-preview .admin-image-loading-frame {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: cover;
}

.order-remark-gallery-dialog {
  width: min(980px, calc(100vw - 28px));
  max-width: none;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: #111827;
  color: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .42);
}

.order-remark-gallery-dialog::backdrop {
  background: rgba(15, 23, 42, .72);
  backdrop-filter: blur(5px);
}

.order-remark-gallery-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(280px, 72vh) auto;
  min-height: min(680px, calc(100vh - 48px));
}

.order-remark-gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(17, 24, 39, .96);
}

.order-remark-gallery-head > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.order-remark-gallery-head span {
  color: #cbd5e1;
  font-size: 12px;
}

.order-remark-gallery-head button,
.order-remark-gallery-nav {
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .1);
  color: #fff;
  cursor: pointer;
}

.order-remark-gallery-head button {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 9px;
}

.order-remark-gallery-stage {
  display: grid;
  min-width: 0;
  place-items: center;
  overflow: hidden;
  background: #020617;
  touch-action: pan-y;
  user-select: none;
}

.order-remark-gallery-image,
.order-remark-gallery-stage .admin-image-loading-frame {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 72vh;
  object-fit: contain;
}

.order-remark-gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 44px;
  height: 58px;
  padding: 0;
  border-radius: 12px;
  font-size: 34px;
  line-height: 1;
  transform: translateY(-50%);
}

.order-remark-gallery-nav.is-prev { left: 12px; }
.order-remark-gallery-nav.is-next { right: 12px; }

.order-remark-gallery-thumbs {
  display: flex;
  gap: 8px;
  min-width: 0;
  padding: 10px 14px 12px;
  overflow-x: auto;
  background: rgba(17, 24, 39, .96);
}

.order-remark-gallery-thumbs > button {
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  padding: 2px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}

.order-remark-gallery-thumbs > button.is-active {
  border-color: #f472b6;
}

.order-remark-gallery-thumb,
.order-remark-gallery-thumbs .admin-image-loading-frame {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  object-fit: cover;
}

.order-remark-inline-editor {
  gap: 10px;
}

.order-remark-text-field,
.order-remark-file-field {
  display: grid;
  gap: 5px;
  font-size: 12px;
  color: var(--muted, #667085);
}

.order-remark-text-field textarea {
  min-height: 92px;
  resize: vertical;
}

.order-remark-file-field input[type='file'] {
  width: 100%;
  padding: 7px;
  border: 1px dashed #f2a8bd;
  border-radius: 10px;
  background: #fff8fb;
  color: #475467;
  font-size: 11px;
}

.order-remark-attachment-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.order-remark-attachment-item {
  position: relative;
  min-width: 0;
}

.order-remark-attachment-preview,
.order-remark-attachment-image,
.order-remark-attachment-preview .admin-image-loading-frame {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 9px;
  object-fit: cover;
  overflow: hidden;
}

.order-remark-attachment-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  min-height: 24px;
  padding: 3px 6px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  background: rgba(80, 22, 40, 0.82);
  color: #fff;
  font-size: 10px;
  cursor: pointer;
}

.order-remark-attachment-empty,
.order-remark-upload-feedback {
  margin: 0;
  font-size: 11px;
  color: var(--muted, #667085);
}

.order-remark-upload-feedback[data-status='uploading'] {
  color: #b54708;
}

.order-remark-upload-feedback[data-status='success'] {
  color: #067647;
}

.order-remark-upload-feedback[data-status='error'] {
  color: #b42318;
}

.order-remark-draft-editor {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.order-remark-draft-list {
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
}

.order-remark-draft-uploaded {
  display: grid;
  gap: 4px;
}

.order-remark-draft-uploaded > small {
  color: #4f6f61;
  font-size: 9px;
  font-weight: 800;
}

.order-remark-draft-uploaded .order-remark-attachment-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.order-remark-draft-item {
  position: relative;
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
}

.order-remark-draft-item > button:first-child {
  grid-area: 1 / 1;
  width: 42px;
  height: 42px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(111, 169, 216, .28);
  border-radius: 6px;
  background: #f8fbff;
  cursor: zoom-in;
}

.order-remark-draft-item img { display: block; width: 100%; height: 100%; object-fit: cover; }
.order-remark-draft-item > span { position: absolute; left: 3px; bottom: 3px; min-width: 14px; padding: 1px 3px; border-radius: 4px; background: rgba(23, 32, 51, .76); color: #fff; font-size: 8px; text-align: center; }
.order-remark-draft-item [data-order-remark-draft-edit], .order-remark-draft-item [data-order-remark-draft-remove] { position: absolute; top: 2px; min-height: 16px; padding: 1px 3px; border: 0; border-radius: 4px; background: rgba(255, 255, 255, .9); color: #344054; font-size: 8px; font-weight: 800; cursor: pointer; }
.order-remark-draft-item [data-order-remark-draft-edit] { left: 2px; }
.order-remark-draft-item [data-order-remark-draft-remove] { right: 2px; color: #b42318; }
.order-remark-draft-empty, .order-remark-draft-feedback { margin: 0; color: var(--muted, #68758a); font-size: 9px; line-height: 1.25; }
.order-remark-draft-add { position: relative; display: grid; min-height: 26px; place-items: center; overflow: hidden; border: 1px dashed rgba(242, 122, 154, .48); border-radius: 6px; background: var(--pink-soft, #fff2f6); color: var(--pink-strong, #d9537a); font-size: 9px; font-weight: 850; cursor: pointer; }
.order-remark-draft-add input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.order-remark-draft-add:focus-within { outline: 3px solid rgba(236, 72, 153, .3); outline-offset: 2px; }
.order-remark-draft-feedback[data-status='editing'], .order-remark-draft-feedback[data-status='uploading'] { color: #b54708; }
.order-remark-draft-feedback[data-status='success'] { color: #067647; }
.order-remark-draft-feedback[data-status='error'] { color: #b42318; }

.order-remark-cell-preview:focus-visible,
.order-remark-attachment-preview:focus-visible,
.order-remark-attachment-remove:focus-visible,
.order-remark-file-field input[type='file']:focus-visible {
  outline: 3px solid rgba(236, 72, 153, 0.3);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .order-remark-attachment-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .order-remark-gallery-dialog {
    width: calc(100vw - 12px);
    border-radius: 12px;
  }

  .order-remark-gallery-shell {
    grid-template-rows: auto minmax(240px, 70vh) auto;
    min-height: calc(100vh - 20px);
  }

  .order-remark-gallery-nav {
    width: 38px;
    height: 50px;
  }
}
