.download-error-dialog {
  box-sizing: border-box;
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 28px;
  border: 1px solid #3f3f46;
  border-radius: 20px;
  background: #18181b;
  color: #fafafa;
  font: inherit;
}
.download-error-dialog::backdrop { background: rgba(0, 0, 0, .65); }
.download-error-dialog h2 { margin: 0 0 16px; font-size: 24px; color: inherit; }
.download-error-dialog p { margin: 0 0 24px; line-height: 1.6; overflow-wrap: anywhere; }
.download-error-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.download-error-actions button, .download-error-actions a {
  padding: 12px 18px;
  border: 1px solid #71717a;
  border-radius: 10px;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  color: inherit;
}
.download-error-actions button:not([data-report-problem]) { background: #fafafa; color: #18181b; }
.download-error-actions :focus-visible { outline: 3px solid #86efac; outline-offset: 3px; }
html[data-theme="light"] .download-error-dialog { background: #fff; color: #18181b; border-color: #d4d4d8; }

.download-error-actions [hidden] { display: none !important; }

.download-error-dialog { position: fixed; inset: 0; margin: auto; }
.download-error-dialog h2 { padding-right: 24px; }
.download-error-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  opacity: .65;
  font: inherit;
  font-size: 24px;
  cursor: pointer;
}
.download-error-close:hover { opacity: 1; background: rgba(128,128,128,.12); }
.download-error-actions { flex-wrap: nowrap; gap: 10px; }
.download-error-actions button, .download-error-actions a {
  flex: 1;
  padding: 12px 10px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.4;
}
.download-error-actions button[data-network-retry] { background: #347e2a; color: #fff; border-color: #347e2a; }
.download-error-actions a { border-color: rgba(128,128,128,.35); }
.download-error-support { margin-top: 20px; font-size: 12px; line-height: 1.7; color: #a1a1aa; }
.download-error-support button,
.download-error-support [data-report-problem] {
  display: inline;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.download-error-dialog :focus-visible { outline: 3px solid #86efac; outline-offset: 3px; }
html[data-theme="light"] .download-error-support { color: #64646e; }
@media (max-width: 480px) {
  .download-error-dialog { padding: 24px; }
  .download-error-dialog h2 { font-size: 22px; }
  .download-error-discord::after { display: none; }
}

.download-error-support[hidden] { display: none; }
.download-error-community { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.download-error-support .download-error-community [data-report-problem],
.download-error-support .download-error-discord {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  width: 100%; min-width: 0; margin: 0; padding: 4px 8px; box-sizing: border-box;
  line-height: 1.45; text-align: center; overflow-wrap: anywhere;
  border: 1px solid #6366f14d; border-radius: 8px;
  gap: 7px; background: #5865f20d; color: #c7d2fe; font-size: 12px; font-weight: 500;
  text-decoration: none;
  transition: background-color 150ms ease;
}
.download-error-support .download-error-community [data-report-problem] {
  border-color: rgba(128,128,128,.3); background: transparent; color: inherit;
}
.download-error-support .download-error-community [data-report-problem]:hover { background: rgba(128,128,128,.1); }
.download-error-discord::after { content: "↗"; flex-shrink: 0; font-size: 13px; }
.download-error-support .download-error-discord:hover { background: #30305a; }
html[data-theme="light"] .download-error-support .download-error-discord { background: #eef0ff; color: #414ac1; }
@media (hover: hover) and (pointer: fine) {
  html[data-theme="light"] .download-error-support .download-error-discord:hover { background: #e3e7ff; }
}
@media (max-width: 380px) {
  .download-error-dialog { padding: 24px 20px; }
}

.download-error-dialog button[data-page-refresh] {
  width: 100%; margin-top: 12px; padding: 12px; border: 1px solid #71717a;
  border-radius: 10px; background: transparent; color: inherit; font: inherit; cursor: pointer;
}
.download-error-dialog button[data-page-refresh].is-primary {
  background: #347e2a; color: #fff; border-color: #347e2a;
  padding: 12px 10px; font-size: 14px; font-weight: 600; line-height: 1.4;
}
.download-error-dialog [data-refresh-note] { margin: 12px 0 0; font-size: 13px; }
.download-error-dialog [data-page-refresh][hidden], .download-error-dialog [data-refresh-note][hidden] { display: none; }

.dl-processing-support { display: none; }
.dl-processing.is-error .dl-processing-support {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px;
}
.dl-processing-support #dl-processing-feedback, .dl-processing-support .dl-processing-discord {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; max-width: 100%; padding: 6px 11px; margin: 0;
  border: 1px solid rgba(128,128,128,.3); border-radius: 8px;
  background: transparent; color: var(--text-muted); font: inherit;
  font-size: 12px; font-weight: 500; line-height: 1.7; text-decoration: none; cursor: pointer;
}
.dl-processing-support .dl-processing-discord { border-color: #6366f14d; background: #5865f20d; color: #c7d2fe; }
.dl-processing-support #dl-processing-feedback:hover { background: rgba(128,128,128,.1); }
.dl-processing-support .dl-processing-discord:hover { background: #5865f226; }
html[data-theme="light"] .dl-processing-support .dl-processing-discord { background: #eef0ff; color: #414ac1; }
.dl-processing-support :focus-visible { outline: 3px solid #818cf8; outline-offset: 3px; }

/* Partial archives can be saved without retrying unavailable attachments. */
.download-error-actions.has-available-save { flex-wrap: wrap; }
.download-error-actions.has-available-save button[data-save-available] { flex: 1 0 100%; background: #347e2a; color: #fff; border-color: #347e2a; }
.download-error-actions.has-available-save button[data-network-retry] { background: transparent; color: inherit; border-color: rgba(128,128,128,.35); }
