.ktc-upload-open {
  overflow: hidden;
}

.ktc-upload-dialog[hidden],
.ktc-upload-dialog [hidden] {
  display: none !important;
}

.ktc-upload-dialog {
  --ktc-accent: #0066cc;
  --ktc-accent-light: #00d4ff;
  --ktc-ink: #1a1a1a;
  --ktc-muted: #6b6b6b;
  --ktc-border: #e2e2e2;
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  font-family: 'Open Sans', Arial, sans-serif;
}

.ktc-upload-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .64);
  backdrop-filter: blur(1px);
}

.ktc-upload-dialog__panel {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 26px;
  color: var(--ktc-ink);
  background: #fff;
  border: 1px solid rgba(0, 102, 204, .12);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 37, 77, .28);
}

.ktc-upload-dialog__panel h2 {
  margin: 0 0 12px;
  color: var(--ktc-ink);
  font-family: 'Poppins', 'Open Sans', Arial, sans-serif;
  font-size: 22px;
  font-weight: 600;
}

.ktc-upload-dialog__file {
  margin: 0 0 6px;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.ktc-upload-dialog__status,
.ktc-upload-dialog__volume {
  margin: 6px 0;
  color: var(--ktc-muted);
}

.ktc-upload-dialog__label {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0 5px;
  font-size: 13px;
  font-weight: 700;
}

.ktc-upload-progress {
  height: 12px;
  overflow: hidden;
  background: #e8eef5;
  border-radius: 999px;
}

.ktc-upload-progress span,
.ktc-upload-progress--total span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--ktc-accent) 0%, var(--ktc-accent-light) 100%);
  border-radius: inherit;
  transition: width .12s linear;
}

.ktc-upload-dialog__error {
  margin-top: 16px;
  padding: 12px;
  overflow-wrap: anywhere;
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #dc2626;
  border-radius: 4px;
}

.ktc-upload-dialog__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.ktc-upload-dialog__actions button {
  min-height: 44px;
  padding: 10px 14px;
  color: var(--ktc-accent);
  background: #fff;
  border: 1px solid var(--ktc-accent);
  border-radius: 4px;
  font: 600 14px/1.3 'Poppins', 'Open Sans', Arial, sans-serif;
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s, box-shadow .15s, transform .1s;
}

.ktc-upload-dialog__actions button[data-action='retry'] {
  color: #fff;
  background: linear-gradient(135deg, var(--ktc-accent) 0%, var(--ktc-accent-light) 100%);
  border-color: transparent;
}

.ktc-upload-dialog__actions button[data-action='cancel'] {
  grid-column: 1 / -1;
  justify-self: end;
  min-width: 120px;
  color: #3a3a3a;
  border-color: #c8c8c8;
}

.ktc-upload-dialog__actions button:hover {
  color: #fff;
  background: var(--ktc-accent);
  border-color: var(--ktc-accent);
}

.ktc-upload-dialog__actions button[data-action='retry']:hover {
  filter: brightness(.94);
}

.ktc-upload-dialog__actions button[data-action='cancel']:hover {
  color: var(--ktc-ink);
  background: #f2f2f2;
  border-color: #9ca3af;
}

.ktc-upload-dialog__actions button:active {
  transform: scale(.99);
}

.ktc-upload-dialog__actions button:focus-visible {
  outline: 3px solid rgba(0, 212, 255, .45);
  outline-offset: 2px;
}

@media (max-width: 520px) {
  .ktc-upload-dialog {
    place-items: end center;
    padding: 0;
  }

  .ktc-upload-dialog__panel {
    width: 100%;
    max-height: 88dvh;
    padding: 20px max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    border-radius: 8px 8px 0 0;
  }

  .ktc-upload-dialog__actions {
    grid-template-columns: 1fr;
  }

  .ktc-upload-dialog__actions button,
  .ktc-upload-dialog__actions button[data-action='cancel'] {
    grid-column: auto;
    justify-self: stretch;
    width: 100%;
  }
}