.order-attachments[hidden],
.attachment-viewer[hidden] {
  display: none !important;
}
.order-attachments {
  margin: 20px 0;
  padding: 16px 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}
.order-attachments h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: #333;
}
.order-attachments h3 small {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 400;
  color: #777;
}
.order-attachments p {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.5;
  color: #777;
}
.attachment-add {
  min-height: 44px;
  padding: 10px 16px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
}
.attachment-items {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.attachment-item {
  width: 72px;
  position: relative;
}
.attachment-preview {
  display: block;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  background: #fafafa;
  cursor: zoom-in;
}
.attachment-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.attachment-remove {
  position: absolute;
  right: -12px;
  top: -12px;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.attachment-remove span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  background: #333;
  color: #fff;
  border: 2px solid white;
  border-radius: 50%;
  font-size: 16px;
}
.attachment-state {
  display: block;
  font-size: 11px;
  line-height: 1.4;
  margin-top: 5px;
  color: #666;
}
.attachment-retry {
  font-size: 11px;
  background: none;
  border: 0;
  color: #b42318;
  min-height: 32px;
  cursor: pointer;
}
.attachment-error {
  color: #b42318 !important;
}
.attachment-discard {
  min-height: 44px;
  background: none;
  border: 0;
  text-decoration: underline;
  color: #666;
  cursor: pointer;
}
.attachment-viewer {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(12, 15, 20, 0.96);
  color: white;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
}
.attachment-viewer-header {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px max(12px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
}
.attachment-viewer-title {
  flex: 1;
  min-width: 0;
  line-height: 1.5;
  font-size: 14px;
  white-space: pre-line;
}
.attachment-viewer button {
  color: white;
  background: #30343c;
  border: 1px solid #555;
  border-radius: 8px;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  font-size: 16px;
}
.attachment-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.attachment-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  transform-origin: center;
}
.attachment-viewer-tools {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 12px 8px max(12px, env(safe-area-inset-bottom));
  flex-wrap: wrap;
}
.attachment-viewer-message {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  text-align: center;
}
.attachment-viewer-message button {
  margin-left: 10px;
}
.simple-table .col-attachment {
  width: 56px;
  box-sizing: border-box;
  text-align: center;
}
.simple-table tbody td.col-attachment {
  padding: 0 6px;
  line-height: 0;
}
.attachment-stack {
  display: block;
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: auto;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.attachment-stack img,
.attachment-stack::before,
.attachment-stack::after {
  position: absolute;
  width: 34px;
  height: 34px;
  box-sizing: border-box;
  border: 1px solid #c9cdd3;
  border-radius: 4px;
  background: #fff;
}
.attachment-stack img {
  left: 0;
  top: 0;
  object-fit: contain;
  z-index: 2;
}
.attachment-stack.multiple::before {
  content: '';
  left: 6px;
  top: 6px;
}
.attachment-stack.multiple::after {
  content: '';
  left: 3px;
  top: 3px;
}
.product-secondary {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.attachment-legacy {
  display: inline-flex;
  align-items: center;
  padding: 0;
  white-space: nowrap;
  font-size: 11px;
  min-height: 18px;
  border: 0;
  background: none;
  color: #555;
  text-decoration: underline;
  cursor: pointer;
}
