.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: #0c0f14;
  color: white;
  overscroll-behavior: contain;
}
.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-viewer .attachment-viewer-control {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #23262d;
  box-shadow: 0 2px 8px #0006;
  touch-action: manipulation;
}
.attachment-viewer-control[hidden] {
  display: none !important;
}
.attachment-viewer-control svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.attachment-viewer-control:focus-visible {
  outline: 2px solid white;
  outline-offset: 3px;
}
.attachment-viewer-close {
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
}
.attachment-viewer-previous,
.attachment-viewer-next {
  top: 50%;
  transform: translateY(-50%);
}
.attachment-viewer-previous {
  left: max(12px, env(safe-area-inset-left));
}
.attachment-viewer-next {
  right: max(12px, env(safe-area-inset-right));
}
.attachment-stage {
  position: absolute;
  inset: 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-position {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.attachment-viewer-message {
  position: absolute;
  top: max(76px, calc(env(safe-area-inset-top) + 64px));
  left: 64px;
  right: 64px;
  text-align: center;
  text-shadow: 0 1px 4px black;
}
.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;
}
